Error in PREPARE
Posted in 1999
This is a multi-part message in MIME format.
------=_NextPart_000_0106_01BEEBDD.5E2D00E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have the following SQL, which I build inside a file using ESQLC
INSERT INTO t_temp_aps (acct_num, slct_crt_code, prod_id, =prod_init_date) SELECT t_applacct.acct_num,'?', t_applacct.prod_id, =
t_applacct.appl_prod_init_dt FROM t_applacct, OUTER t_prd_grp_dtl WHERE =
( t_applacct.aps_cust_id <>2 AND t_applacct.prod_id =3D =
t_prd_grp_dtl.prod_id AND t_applacct.prod_id IN (SELECT prod_id FROM =
t_prd_grp_dtl WHERE prod_grp_id IN (SELECT prod_grp_id FROM =
t_slct_crt_hdr WHERE slct_crt_code =3D '?')))
I read this into a char variable "chrsql", and then do the following =
statements
EXEC SQL prepare sql_id from :chrsql;
EXEC SQL execute sql_id USING :mstrslctcd, :mstrslctcd;
"mstrslctcd" is a char variable
This returns the error -254 :Using-clause does not match dynamic =
parameters
Please help me work around this
Thanks
George
------=_NextPart_000_0106_01BEEBDD.5E2D00E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have the following SQL, which I build =
inside a=20
file using ESQLC</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>INSERT INTO t_temp_aps (acct_num, =
slct_crt_code,=20
prod_id, prod_init_date) SELECT t_applacct.acct_num,'?', =
t_applacct.prod_id,=20
t_applacct.appl_prod_init_dt FROM t_applacct, OUTER t_prd_grp_dtl =
WHERE=20
( t_applacct.aps_cust_id <>2 AND t_applacct.prod_id =3D=20
t_prd_grp_dtl.prod_id AND t_applacct.prod_id IN (SELECT prod_id FROM=20
t_prd_grp_dtl WHERE prod_grp_id IN (SELECT prod_grp_id FROM =
t_slct_crt_hdr WHERE=20
slct_crt_code =3D '?')))</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>I read this into a char variable =
"chrsql", and then=20
do the following statements</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>EXEC SQL prepare sql_id from =
:chrsql;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> EXEC SQL execute sql_id =
USING=20
:mstrslctcd, :mstrslctcd;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>"mstrslctcd" is a char =
variable</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>This returns the error -254 =
:Using-clause does not=20
match dynamic parameters</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Please help me work around =
this</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>George</FONT></DIV></BODY></HTML>
------=_NextPart_000_0106_01BEEBDD.5E2D00E0--