IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SQLCODE -104 during runing of program


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Wed May 19, 2010 4:39 pm
Reply with quote

Hi,

I am using dynamic SQL in COBOL-DB2 program and following are the declaration made in program.

01 US.
49 US-LEN PIC S9(4) COMP.
49 US-TEXT PIC X(80).

PROCEDURE DIVISION.

MOVE 40 TO US-LEN.
ACCEPT US-TEXT.

EXEC SQL
EXECUTE IMMEDIATE :US
END-EXEC.

I am accepting US-TEXT , the SQL statement as sting from SYSIN DD * as like this

//SYSIN DD *
'DELETE FROM tbname WHERE EMPCD = "A002" '
/*

i am getting SQLCODE -104 during runing of program and checked with manual saying that it is sysntax error.

Please solve this.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 19, 2010 4:47 pm
Reply with quote

display your complete sqlca message, which will inidicate which token db2 has decided to flag as in error.

having no idea how you are executing your program,
the connect that has been/not been made,
it could simply be the qualification fo your tbname.

-104 is a rather specific type of 'syntax' error....................
Quote:
Please solve this.


solve it yourself.
Back to top
View user's profile Send private message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Wed May 19, 2010 4:56 pm
Reply with quote

i changed the quotes like this

//SYSIN DD *
'DELETE FROM EMPI WHERE EMPCD = 'A002''
/*

Now i am receiving SQLCODE -010 which says string not terminated properly

what z the meaning of that
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed May 19, 2010 5:18 pm
Reply with quote

why do you have quotes around the whole statement ?
try this :

//SYSIN DD *
DELETE FROM EMPI WHERE EMPCD = 'A002'
/*

or

//SYSIN DD *
DELETE FROM EMPI WHERE EMPCD = "A002"
/*

depending on your settings
Back to top
View user's profile Send private message
shreejita

New User


Joined: 16 Aug 2009
Posts: 60
Location: chennai

PostPosted: Thu May 20, 2010 10:17 am
Reply with quote

Thanks ALL, It is working now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top