View previous topic :: View next topic
|
Author |
Message |
sihanature Warnings : 1 New User
Joined: 01 Sep 2005 Posts: 33
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|