Skip to main content

apost or quote in cobol esql

  • August 2, 2022
  • 2 replies
  • 1 view

Hi 

compiling cobol + sql program on unix with SQL(DBMAN=ODBC) 

on ORACLE database

give error 

ORA-00904: "C": invalid identifier

if I use 'C' its work, I must change all quote in apost? 

I cannot stay with double quotes in cbl progmram?

EXEC SQL DECLARE CURSOR1 CURSOR FOR
.....
AND (A_COLL = "K" OR A_COLL = "C")   

....
END-EXEC.

thanks 

bye


#EnterpriseDeveloper
#SQL
#esql

2 replies

Kim Hoskin
Forum|alt.badge.img+2
  • Moderator
  • August 8, 2022

Hi 

compiling cobol + sql program on unix with SQL(DBMAN=ODBC) 

on ORACLE database

give error 

ORA-00904: "C": invalid identifier

if I use 'C' its work, I must change all quote in apost? 

I cannot stay with double quotes in cbl progmram?

EXEC SQL DECLARE CURSOR1 CURSOR FOR
.....
AND (A_COLL = "K" OR A_COLL = "C")   

....
END-EXEC.

thanks 

bye


#EnterpriseDeveloper
#SQL
#esql

Hi, as you have only posted part of the SQL code it is not easy for me to replicate the error you describe, but also see that if you use a single quote instead of double quotation mark it works. Can you use that as a solution moving forward?

I find this documentation page:
https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-VS2017/BKDBDBDYNAS014.html
If you are using dynamic SQL Statements you can use the above, there are examples of how to use / prepare these, and sample syntax.

If you need further assistance, then I suggest you to consider raising a support case, please then consider to provide simplified test case and also advise in which environment/product this compiled without error previously.


  • August 8, 2022

Hi, as you have only posted part of the SQL code it is not easy for me to replicate the error you describe, but also see that if you use a single quote instead of double quotation mark it works. Can you use that as a solution moving forward?

I find this documentation page:
https://www.microfocus.com/documentation/enterprise-developer/ed70/ED-VS2017/BKDBDBDYNAS014.html
If you are using dynamic SQL Statements you can use the above, there are examples of how to use / prepare these, and sample syntax.

If you need further assistance, then I suggest you to consider raising a support case, please then consider to provide simplified test case and also advise in which environment/product this compiled without error previously.

Hi,

I have solved  using single quote 

thanks