aspose file tools*
The moose likes JDBC and the fly likes Repeatable SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Repeatable SQL" Watch "Repeatable SQL" New topic
Author

Repeatable SQL

Prashant Langade
Ranch Hand

Joined: Jul 01, 2009
Posts: 71
Hi

I have a requirement like this below.

Table A contains data as below.

id Name Tasks

1 test IA
2 best ABC
3 zest IA
4 east BCD
5 west IA

Now column id is a foreign key referring to column cid in table B

cid Name

1 test
2 zest
3 east
4 west

Now my requirement is to update the table A's "Tasks" column based on the following conditions:
1> when Table A's "id" and Table B's "cid" columns match.
2>only update task column when it contains value as "IA" with ""(blank)

Can any one please help me?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30321
    
150

How about a subquery to determine the rows to update?



[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Repeatable SQL