on 09-01-2006 7:26 AM
Hi All,
I have 2 tables. First table
Header
-
Name EmpId Status
Jai 5601 0
Karthik 5579 0
Item
-
Name Contactnumber
Jai 9894268913
Jai 04312432431
Karthik 98984110335
Karthik 04222643993
Now I need to select a single record from Header and all its corresponding records from Item then I need to update the status field to prevent processing the same record and move to next header and all its corresponding Item records. How can I achieve this in a scenario with out BPM? How should I write my SQL and Update SQL in sender commn channel?
Appreciate your help in this.
Thanks & Regards,
Jai Shankar.
Hi Jai,
I guess I got it.
You have to select a single document from the database. The problem is to qualify your select statement.
a) The solution is to select the MIN record (MIN means you select only ONE)!
b) On the other hand you want wo select corresponding from a second table.
So you have to combine a) with b)
a) select * from table_1 where event_id = (select min(event_id) from table_1 where status = 0)
b) select * from table_2 t1, table_1 t2 where t1.name = t2.name
Unfortunately I am not a SQL specialist.
Somebody else should be able to combine the statements a) and b)
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
This querry works.
select Header.Name, Header.EmpId, Item.Contactnumber from Header,Item where Header.Name = (select min(Header.Name) from Header where Header.Status = 0) and Header.Name = Item.Name
Update SQL :
update Header set status = 1 where name = (select min(name) from Header where status = 0)
Thanks for the idea Mario.
Thanks & Regards,
Jai Shankar.
Hi Jai,
this one should also very helpful for your problem:
Replication of Nodes Using the Graphical Mapping:
/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
you can achieve this one with BPM only.
Sekhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jai,
Dont think this is possible without a BPM.
In thesense, you want the SENDER JDBC adapter 's query to be Dynamic and yet process only one record at a time.. Dont think this can be done without a BPM.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.