If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I'm trying to execute this kind of sentences using jdbc and db2:
SELECT * FROM SUBJECT SUB, SUSCRIPTOR SUS
WHERE SUB.SUBJECT = SUS.SUBJECT
The returned error is:
Couldn't execute query:select * from SUBJECT SUB, SUSCRIPTOR SUS WHERE SUB.SUBJECT=SUS.SUBJECT
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0206N "SUB.SUBJECT" is not valid in the context where it is used. SQLSTATE=42703
If I write:
SELECT * FROM SUBJECT SUB, SUSCRIPTOR SUS
WHERE SUB.'SUBJECT' = SUS.'SUBJECT'
Couldn't execute query:select * from SUBJECT SUB, SUSCRIPTOR SUS WHERE SUB.'SUBJECT'=SUS.'SUBJECT'
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "'SUBJECT'" was found following "IPTOR SUS WHERE SUB.". Expected tokens may include: "<identifier>". SQLSTATE=42601
but if I use:
SELECT * FROM SUBJECT
WHERE 'SUBJECT' = (SELECT 'SUBJECT' FROM SUSCRIPTOR)