[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[sqr-users] Creating Comma Delimited Strings for "WHERE IN" statements




Hello All...

I'm trying to automate a SQL process using SQR. Up to this point, I've never 
had to deal with working with the "IN" portion of SQL within SQR. How do I pass 
a list of returned variables into a comma delimited string? Example:

BEGIN-PROCEDURE ABC
BEGIN-Select
a.ID
a.NBR  &NBR
  Move &NBR to $NBR
FROM TABLE A
END-Select
END-PROCEDURE

Based on the above procedure, I need to format my $NBR string where it now 
becomes ('$NBR','$NBR','$NBR','$NBR',....) for however many instances of &NBR 
procedure ABC returns. This way I can then use the values in the below 
procedure...

BEGIN-PROCEDURE ABC
BEGIN-Select
b.NBR
b.TEXT
FROM TABLE B
WHERE b.NBR in ($NBR)
END-Select
END-PROCEDURE

I will be doing this a few more times in my program and (for now) my values 
that I need passed into separate comma delimited strings are number values.

Any assistance would be greatly appreciated.

Thanks,
Darrel


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users