Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
REG:deletion in Embedded SQL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sihanature
Warnings : 1

New User


Joined: 01 Sep 2005
Posts: 33

PostPosted: Fri Oct 26, 2007 6:18 pm    Post subject: REG:deletion in Embedded SQL
Reply with quote

Hi,

Generally we use following query to delete the entry from particular table.

EXEC SQL
DELETE FROM EMP
WHERE EMP_NO =:WS-EMP-NO
END-EXEC

If suppose an employee belongs to two dept and want to delete the emp from any one dept.

I have used following query,but I'm getting -84 sqlcode(Unacceptable SQL stmt)

EXEC SQL
DELETE FROM EMP
WHERE EMP_NO =: WS-EMP-NO AND
DEPT =: WS-DEPT
END-EXEC

I appreciate if anyone would provide exact syntact of above deletion.

Thanks
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 26, 2007 8:53 pm    Post subject:
Reply with quote

Hello,

It appears as though you have invalid spaces between the ":" and the ws data-names. . .?
Code:
EXEC SQL
DELETE FROM EMP
WHERE EMP_NO =: WS-EMP-NO AND
DEPT =: WS-DEPT
END-EXEC


This (the code that works) does not.

Code:
EXEC SQL
DELETE FROM EMP
WHERE EMP_NO =:WS-EMP-NO
END-EXEC
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts cobol embedded sql MS_Developer COBOL Programming 7 Fri Oct 14, 2016 2:39 pm
No new posts Null Indicator value -2 means in Embe... deepak_shrivastava DB2 2 Wed Jan 06, 2016 10:27 pm
No new posts [SQL0029] INTO clause missing from em... HABBIE DB2 2 Fri Sep 04, 2015 3:54 pm
No new posts Embedded programs / link'ed programs sivakumar.karthik CICS 5 Fri Jun 05, 2015 1:12 am
No new posts DELETE query to have deletion of the ... tecnokrat DB2 2 Mon Nov 25, 2013 12:19 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us