Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Are double quotes not accepted in DB2

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

New User


Joined: 25 Mar 2006
Posts: 15
Location: pune(India)

PostPosted: Fri Mar 24, 2006 5:43 pm    Post subject: Are double quotes not accepted in DB2
Reply with quote

Hi

I was trying to execute a COBOL-DB2 program where in I was executing an SQL statement:

SELECT EMPNO,EMPNAME,EMPSAL.EMPDEPT

INTO :RAD-EMPNO,:RAD-EMPNAME, :RAD-EMPSAL, :RAD-EMPDEPT

FROM EMPLOYEE_MASTER

WHERE DEPTNO = ?D001?


Where RAD-EMPNO,RAD-EMPNAME,RAD-EMPSAL and RAD-EMPDEPT are the DCLGEN variables. DEPTNO is the primary key.

The above SQL statement gives an error at Precompilation time that the column is not specified in the table specified.

The solution is that we need to give the dept value in double quotes and not in single quotes as shown below


SELECT EMPNO,EMPNAME,EMPSAL.EMPDEPT

INTO :RAD-EMPNO,:RAD-EMPNAME, :RAD-EMPSAL, :RAD-EMPDEPT

FROM EMPLOYEE_MASTER

WHERE DEPTNO = ?D001?



So now my query is that, is there any Precompiler option to accept single apostrophes?
Back to top
View user's profile Send private message

DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Mar 27, 2006 8:15 am    Post subject: Re: Are double quotes not accepted in DB2
Reply with quote

ysuryawanshi_mcs,

This does not answer your specific question, but how about moving the departmant # "D001" to a working storage area first.

Code:


    05  WS-DEPT              PIC X(4).


    MOVE 'D001'     to WS-DEPT.

    SELECT EMPNO,EMPNAME,EMPSAL.EMPDEPT
    INTO :RAD-EMPNO,:RAD-EMPNAME, :RAD-EMPSAL, :RAD-EMPDEPT
    FROM EMPLOYEE_MASTER
    WHERE DEPTNO = :WS-DEPT



Dave
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 To change double quotes into csv read... Robert Sample COBOL Programming 3 Fri Feb 19, 2016 8:13 am
This topic is locked: you cannot edit posts or make replies. Put quotes in Symbolic parameter whil... Yashashri All Other Mainframe Topics 7 Mon Feb 15, 2016 12:24 pm
No new posts How to define and use Double dimensio... pkmurali DB2 3 Mon Jun 22, 2015 8:36 am
No new posts REXX EDIT MACRO unable to handle doub... anjali.bisht TSO/ISPF 10 Thu Mar 12, 2015 4:55 pm
No new posts How to delimit data with '|' which ha... gch77 DFSORT/ICETOOL 5 Wed Aug 13, 2014 9:16 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us