Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to compare rows

 
aliya sharma
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm fairly new to java.
we have 2 databases (AS400 and SQL Server2000). There's a table in AS400 (named: ORHDR) with fields HORDNO, HOSTAT(P,W,X,) where x stands for "cancelled". In sql server, i have a table named Order with fields order_num, order_status(F,C,A).

i want to search the order table in SQL Server where order_status is "a" and then look up the corrosponding row in AS400. If the HOSTAT is "x", then update the field in SQL server to "C".

I know how to connect to both databases and select statement where order_status is "a". I just don't know how to compare that row with the corrosponding row of AS400 and then update the status adn keep doing this till the whole table is finished.
Any hints or sample code would be greatly appreciated. Thanks for your time

Regards,
Aliya
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JDBC forum...
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i can go for just one way. i dont know whether there is some better way.
but we can always get that row as String in our code and update the other on a certain condition. using some loops and if..else.

couldn't we??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic