Re: [Sqlrelay-discussion] PLEASE HELP I'M LOST, VERY URGENT
Brought to you by:
mused
|
From: Firstworks/4access <dav...@fi...> - 2005-11-28 23:25:21
|
Postgresql 8 supports bind variables natively and uses "$1,$2,$3" to
represent bind variables rather than ":var1,:var2,:var3". Using
colon-delimited bind variables should work when using sqlrelay-0.36.4
against postgresql 8, but when using sqlrelay-0.37 pre-releases against
postgresql 8, you have to add fakebinds=3Dyes to the connectstring in
sqlrelay.conf, for example:
<connection connectionid=3D"db"
string=3D"user=3Dtestuser;password=3Dtestpassword;db=3Dtestdb;host=3D/tmp=
;typemangling=3Dno;fakebinds=3Dyes" metric=3D"6"/>
If that doesn't take care of the problem, call sqlrcon_debugOn() before
running your insert query and post the result, I'll take a look and see
if I can spot the problem.
Dave
dav...@fi...
On Mon, 2005-11-28 at 22:43 +0000, david forums wrote:
> Hi again
>=20
> I may be start to find where the problem occur:
> It seems that it does not bind the values in the request.
>=20
> I try to execute the following request in psql :
> INSERT INTO civility (l_id,c_libelle,c_id) VALUES (:l_id,:c_libelle,:c_=
id);
> Just like that and I got :
> ERREUR: erreur de syntaxe sur ou pr=C3=83=C2=A8s de =C3=82=C2=AB:=C3=82=
=C2=BB au caract=C3=A8re 52
> LIGNE 1 : ...NSERT INTO civility (l_id,c_libelle,c_id) VALUES =20
> (:l_id,:c_l...
> ^
> So it's the same message. It is like if the inputBind were not take in =
=20
> case.
>=20
> Hope it will help
>=20
> REgards
>=20
> David
>=20
>=20
>=20
> Le Mon, 28 Nov 2005 22:22:32 -0000, david forums <df...@vi...> =
a =20
> =C3=A9crit:
>=20
> > Hi
> >
> > My table :
> > civility : c_id integer NOT NULL
> > l_id integer NOT NULL=09
> > c_libelle character varying(30) NOT NULL
> >
> >
> > my php script :
> > $con=3Dsqlrcon_alloc("localhost",9001,"/tmp/mainPostgres.socket","tes=
tPostgres","test",1,3);
> >
> > $cursor =3D sqlrcur_alloc($con);
> >
> > sqlrcur_prepareQuery($cursor, "INSERT INTO civility =20
> > (l_id,c_libelle,c_id) VALUES (:l_id,:c_libelle,:c_id)");
> > sqlrcur_inputBind($cursor,"l_id",1);
> > sqlrcur_inputBind($cursor,"c_libelle","testee");
> > sqlrcur_inputBind($cursor,"c_id",5);
> > if(!sqlrcur_executeQuery($cursor)) {
> > echo sqlrcur_errorMessage($cursor);
>=20
> > }
> > sqlrcur_free($cursor);
> > sqlrcon_free($con);
> >
> > Result :
> > ERREUR: erreur de syntaxe sur ou pr=C3=83=C2=A8s de =C3=82=C2=AB:=C3=82=
=C2=BB at character 52 =20
> > Attempted Query: INSERT INTO civility (l_id,c_libelle,c_id) VALUES =20
> > (:l_id,:c_libelle,:c_id)
> > ERROR: syntaxic error on or close to =C3=82=C2=AB:=C3=82=C2=BB at ch=
aracter 52 Attempted =20
> > Query: INSERT INTO civility (l_id,c_libelle,c_id) VALUES =20
> > (:l_id,:c_libelle,:c_id)
> >
> > fedora core 3 or 4:
> > php (own compiled), version 5.0.4
> > apache 2.0.54(RPM)
> > sqlrelay 0.36.4(RPM) - 0.37 (own compiled): both work fine on select
> > Postgresql 8.0.4(RPM)
> >
> > I make several trial, every time is the same error.
> >
> > Please reply as soon as possible.
> >
> > Regards
> >
> > David
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through lo=
g =20
> > files
> > for problems? Stop! Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the web. DOWNLOAD SPLUN=
K!
> > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
> > _______________________________________________
> > Sqlrelay-discussion mailing list
> > Sql...@li...
> > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
> >
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log =
files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
> _______________________________________________
> Sqlrelay-discussion mailing list
> Sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
>=20
|