Re: Pro *C problem...

From: Marc Mazerolle <informaze_at_sympatico.ca>
Date: Wed, 17 Feb 1999 09:14:58 -0500
Message-ID: <36CACEE2.7E735074_at_sympatico.ca>


SB,

Don't think you can change the parameter of the LIKE command with a bind variable. Try adding the '%' in your string before the SELECT but i have not much hope either.

You could try this :

where substr(value,1,length(:temp)) = :temp

but it won't use the index and on a large table, it could kill you process.

Regards,

Marc Mazerolle
InforMaze Technologies

Shashi Bhushana wrote:

> Hello,
>
> I am trying to extract a substring of a column, using SELECT
> statement...
>
> VARCHAR Region[2];
> VARCHAR Temp[4];
> (Temp is containing value like '123' before execution of this statement)
>
> (VALUE is a column in the table STABV and will contain values like
> '123=W'
> , '456=E', etc...I am trying to extract value 'E' or 'W', and so on)
>
> EXEC SQL
> SELECT substr(VALUE,5,1)
> INTO :Region
> FROM STABV
> WHERE NAME = 'MC REGION'
> AND VALUE LIKE :Temp || '%';
>
> I tried to execute the same statement at sql prompt. It is working
> fine....But in Pro *C
> it is not giving any value...Is there any other method to do this task
> ?? Any help
> would be highly appreciated...
>
> Thanks in advance,
> SB
Received on Wed Feb 17 1999 - 15:14:58 CET

Original text of this message