Re: OPO SQL-string (with into) problem

From: Leo Larson <llarson_at_continental.com>
Date: 1996/03/18
Message-ID: <314DBAF1.2DD8_at_continental.com>#1/1


Thomas Höljö wrote:
>
> I have the following problem when using string with
> EXEC SQL
>
> I have following code in the click() method av a button:
>
> dim vsqlstring as string
> dim vsqlstring1 as string
> dim vsqlstring2 as string
> x=1
>
> vSqlstring1=(" select p")
> vSqlstring2=(" into :vtro from tblpercentil where deltest = 'GP:A'")
> vSqlstring=vsqlstring1 &x &vsqlstring2
>
> exec sql AT SESSGPI :vsqlstring
> vsqlerrtext=sqlerrtext()
> msgbox sqlerrtext
>
> The result in sqlerrtext is: "SQL-00021: Expecting from, got into"
> (it works without the "into" statement)
>
> If a use EXEC SQL defining the statement without a string
> everything works perfect, but as soon as I use a string (i.e. :vSQLstring) with
> the "into" statement the error occur.
>
> I have OPO 1.0.4. I hope I have missed something out .....
>
> Thomas Holjo -> THHO9405_at_student.uu.se
> Student
> Uppsala Universitet
> Sweden

You cannot use a bind variable when dynamically building a string to execute. All bind variables must be quoted or left as a constant. Received on Mon Mar 18 1996 - 00:00:00 CET

Original text of this message