PDA

View Full Version : Pro*Cobol - Sever al variables


Michael
06-30-2003, 01:42 AM
Hi,

Doing some work on legacy code.
Need to allow a user input the contents of one or more variables at
run time.
Having done that a select statement should populate a cursor taking
account of the user input values. e.g.

accept ch-userval1 (the user inputs all the values (e.g.
01,02,05)
....


select columns
into c1
from table1...table5
where :c_variable in ('ch-userval1')

where ch-userval1 has all the user inputs in one variable in this
case (01,02,05)



It appears the pro cobol compiler does'nt like the in statement.
Please note that a variable number of user values can be submitted.

Would welcome any comments or help.

Michael

Guest
06-30-2003, 05:29 AM
mcgrathm@tcd.ie (Michael) wrote in message news:<96c2e6fc.0306300142.6c5e3357@posting.google.com>... Hi, Doing some work on legacy code. Need to allow a user input the contents of one or more variables at run time. Having done that a select statement should populate a cursor taking account of the user input values. e.g. accept ch-userval1 (the user inputs all the values (e.g. 01,02,05) .... select columns into c1 from table1...table5 where :c_variable in ('ch-userval1') where ch-userval1 has all the user inputs in one variable in this case (01,02,05) It appears the pro cobol compiler does'nt like the in statement. Please note that a variable number of user values can be submitted. Would welcome any comments or help. Michael


You need to use *dynamic* sql

Sybrand Bakker
Senior Oracle DBA


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service