Dynamic replacing in WHERE clause



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Dynamic replacing in WHERE clause

Postby vegafacundodaniel » Sun Mar 08, 2015 4:52 am

Hello. In my program cobol/db2, I am using theses sentences:


01 cond1 pic x(30).
01 var-employe pic 9(8).

move "nroemp1 = :var-employe'" to cond1
move 11111111 to var-employe

EXEC SQL
Select nroemp
into ws-nroemp
from table
where cond1
AND nroemp2 = 99999999
END-EXEC.


and when I compile, I get an error on the WHERE.
Could anyone help me, please?

I am hoping after the dynamic replacing my query be:

EXEC SQL
Select nroemp
into ws-nroemp
from table
where nroemp1= 11111111
AND nroemp2 = 99999999
END-EXEC.



thanks in advance
vegafacundodaniel
 
Posts: 61
Joined: Tue Jul 20, 2010 4:27 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Dynamic replacing in WHERE clause

Postby NicC » Sun Mar 08, 2015 1:28 pm

What error are you getting?
What is your analysis of the error after studying the manuals?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Dynamic replacing in WHERE clause

Postby vegafacundodaniel » Sun Mar 08, 2015 7:09 pm

SQLCODE : -000000104
I didn't find this topic in the manuals
thanks
vegafacundodaniel
 
Posts: 61
Joined: Tue Jul 20, 2010 4:27 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Dynamic replacing in WHERE clause

Postby Robert Sample » Sun Mar 08, 2015 8:25 pm

Google is your friend. Googling sqlcode -104 returns 806,000 hits -- you should be able to figure out your problem from them.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Dynamic replacing in WHERE clause

Postby vegafacundodaniel » Sun Mar 08, 2015 9:43 pm

Yes!!! thanks very much!
I solved my problem :)
vegafacundodaniel
 
Posts: 61
Joined: Tue Jul 20, 2010 4:27 pm
Has thanked: 1 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post