I would loop through the string byte by byte, once I found the delimiter, I would insert the value into a global temp table. Once you've exhausted thee string, I would then execute your sql as a join to the temp table
sorry for the delay reply.
Iam getting an error too many arguments. I hope posstr function is taking 'IND,CHN,VEN' as string and searching one country code. Have you tried this by executing. Can you pls execute and send me the result.
I couldnt do that Query with POSSTR, but was able to do with LOCATE.
LOCATE is a special case of POSSTR, in which you can specify the starting position from where to start looking for the search-string. It surprises me that you can't get it working with POSSTR. Can you give the failing SQL and the error?
I heard that POSSTR will be removed in DB2 V8.2 , It is true?
That would mean rewriting all the existing programs that use POSSTR. Normally DB2 wants to be back compatible as much as possible. Don't believe a word of it. Doesn't DB2 v8.2 already exist about 2 years?
LOCATE works only for string, Is there any such Query which will work for Integers for the same condition.
In this case, you'd better use the solution suggested by Brett Kaiser. His solution is more general, but a bit more complex.
If you only need strings, I'd use the POSSTR-solution.
If you need other data types too, you'd better use Brett's solution.
The table was a sample table I had choosen for a larger solution. I may not be able to provide the original table as per company restrictiuons. I hope you understand my difficuly.
I'm not interested in the (confidential) data, but in the structure of the table, at least the few columns that would make it possible for somebody else to replicate your problem and find a solution. I hope you understand my difficulty.
With kind regards . . . . . SQL Server 2000/2005/2012
Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2. Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages