SQL Newbie needs help (not not that kind)

jfaye

New Member
I have been trying to find Progress SQL codes examples and just can not seem to find any. Via ODBC, I need to send a list of user names, comma separated, look them up in a table and send back a variable that contains a semicolon separated list of e-mail address' for the list of users. If it helps, this is a ODBC Query from Deliveryware.

Thanks bunches,

jfaye :o
 
If you create a procedure, you can resolve your problems i think..

Input list will be passed through a input PARAMETER. Using functions like NUM-ENTRIES and ENTRY you may be able to separate single values.
To find them in a table, you can use FIND statement.
Put e-mails on an output PARAMETER.

For connection, try look in help for CONNECT statement..

Helps you out? I m also a newbie, but if i can be of any help....
Bye
 
NUM-ENTRIES and ENTRY are ABL functions, not SQL functions.

I don't know if this is something you can achieve in a single SQL query, at least not easily. Easy enough in ABL, but that doesn't help you. If you can do it, it would probably be some kind of thing with cursors, but since I never do that sort of thing, I can't tell you about that.
 
You're right, but you can build the two in sql.. i think.

I mean:

NUM-ENTRIES(separator) counts if a string contains the separator you specify. If it is equal or grather to 1, it is increased by one. Else it returns 0. Or other value for not-found.

ENTRY(n,separator) is a find of that character at the n occurrence in the string, and returns the characters preceeding n+1 separator position.

I think even in SQL there are string manipulation functions.. or not ?
If not, you will have to build a FIND(source, substring, [pos]) function and then you can proceed to others two.
I knew there were parameters even in sql functions.. ( i used ms sql server 2005 a few years ago )

Sorry to have misunderstood the problem.
 
Back
Top