What is the syntax of adding C++ variables into SQL Server/mySQL?
Could anyone raise an example?
I've tried
insert into aTable (field1, field2) values (variable1, variable2)
But mySQL throws error messages at me saying varible1 is not in the field
list. Haven't tried it yet for SQL Server..
Thanks for your attention
Jack

Re: Adding C++ Variables into mySQL/SQL Svr by Majid

Majid
Mon Apr 26 07:07:58 CDT 2004

try this instade:
insert into aTable (field1, field2) values (:variable1, :variable2)

with ":" before each variable


"Jacky Luk" <jl@knight.com> a écrit dans le message news:
OU6KNizKEHA.2692@tk2msftngp13.phx.gbl...
> What is the syntax of adding C++ variables into SQL Server/mySQL?
> Could anyone raise an example?
> I've tried
> insert into aTable (field1, field2) values (variable1, variable2)
> But mySQL throws error messages at me saying varible1 is not in the field
> list. Haven't tried it yet for SQL Server..
> Thanks for your attention
> Jack
>
>



Re: Adding C++ Variables into mySQL/SQL Svr by Jack

Jack
Mon Apr 26 22:21:22 CDT 2004

it doesn't work.
Thanks anyway
Jack

"Majid LAISSI" <mlaissi@capgemini.fr> ¼¶¼g©ó¶l¥ó·s»D
:O7VNfc4KEHA.1340@TK2MSFTNGP12.phx.gbl...
> try this instade:
> insert into aTable (field1, field2) values (:variable1, :variable2)
>
> with ":" before each variable
>
>
> "Jacky Luk" <jl@knight.com> a écrit dans le message news:
> OU6KNizKEHA.2692@tk2msftngp13.phx.gbl...
> > What is the syntax of adding C++ variables into SQL Server/mySQL?
> > Could anyone raise an example?
> > I've tried
> > insert into aTable (field1, field2) values (variable1, variable2)
> > But mySQL throws error messages at me saying varible1 is not in the
field
> > list. Haven't tried it yet for SQL Server..
> > Thanks for your attention
> > Jack
> >
> >
>
>



Re: Adding C++ Variables into mySQL/SQL Svr by Jack

Jack
Tue Apr 27 20:54:47 CDT 2004

Oh, very sorry. As I was using your statement in mySQL, so on SQL Server
would work. Thanks
Jack

"Jack" <jl@knight.com> ¼¶¼g©ó¶l¥ó·s»D
:#Y5n1aALEHA.2488@TK2MSFTNGP10.phx.gbl...
> it doesn't work.
> Thanks anyway
> Jack
>
> "Majid LAISSI" <mlaissi@capgemini.fr> ¼¶¼g©ó¶l¥ó·s»D
> :O7VNfc4KEHA.1340@TK2MSFTNGP12.phx.gbl...
> > try this instade:
> > insert into aTable (field1, field2) values (:variable1, :variable2)
> >
> > with ":" before each variable
> >
> >
> > "Jacky Luk" <jl@knight.com> a écrit dans le message news:
> > OU6KNizKEHA.2692@tk2msftngp13.phx.gbl...
> > > What is the syntax of adding C++ variables into SQL Server/mySQL?
> > > Could anyone raise an example?
> > > I've tried
> > > insert into aTable (field1, field2) values (variable1, variable2)
> > > But mySQL throws error messages at me saying varible1 is not in the
> field
> > > list. Haven't tried it yet for SQL Server..
> > > Thanks for your attention
> > > Jack
> > >
> > >
> >
> >
>
>



Re: Adding C++ Variables into mySQL/SQL Svr by Jack

Jack
Tue Apr 27 21:26:00 CDT 2004

rc = SQLExecDirect (hstmt, (SQLCHAR *) "INSERT INTO functions
(a,b,c,d,e,f,g....) values (@var1, '10', '', '', '', '', '', '', '',
'','', '', @var2)", SQL_NTS);

mySQL equivalence, sorry for mentioning this in here.
If you don't mind.. :) . MySQL said var1 is NULL?!
Thanks
Jack

"Jack" <jl@knight.com> ¼¶¼g©ó¶l¥ó·s»D
:OlFx1PMLEHA.3808@TK2MSFTNGP12.phx.gbl...
> Oh, very sorry. As I was using your statement in mySQL, so on SQL Server
> would work. Thanks
> Jack
>
> "Jack" <jl@knight.com> ¼¶¼g©ó¶l¥ó·s»D
> :#Y5n1aALEHA.2488@TK2MSFTNGP10.phx.gbl...
> > it doesn't work.
> > Thanks anyway
> > Jack
> >
> > "Majid LAISSI" <mlaissi@capgemini.fr> ¼¶¼g©ó¶l¥ó·s»D
> > :O7VNfc4KEHA.1340@TK2MSFTNGP12.phx.gbl...
> > > try this instade:
> > > insert into aTable (field1, field2) values (:variable1, :variable2)
> > >
> > > with ":" before each variable
> > >
> > >
> > > "Jacky Luk" <jl@knight.com> a écrit dans le message news:
> > > OU6KNizKEHA.2692@tk2msftngp13.phx.gbl...
> > > > What is the syntax of adding C++ variables into SQL Server/mySQL?
> > > > Could anyone raise an example?
> > > > I've tried
> > > > insert into aTable (field1, field2) values (variable1, variable2)
> > > > But mySQL throws error messages at me saying varible1 is not in the
> > field
> > > > list. Haven't tried it yet for SQL Server..
> > > > Thanks for your attention
> > > > Jack
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Adding C++ Variables into mySQL/SQL Svr by Jack

Jack
Tue Apr 27 21:26:50 CDT 2004

And I have tested the variable before the insert, it is a valid C/C++
Pointer which contains data.

"Jacky Luk" <jl@knight.com> ¼¶¼g©ó¶l¥ó·s»D
:OU6KNizKEHA.2692@tk2msftngp13.phx.gbl...
> What is the syntax of adding C++ variables into SQL Server/mySQL?
> Could anyone raise an example?
> I've tried
> insert into aTable (field1, field2) values (variable1, variable2)
> But mySQL throws error messages at me saying varible1 is not in the field
> list. Haven't tried it yet for SQL Server..
> Thanks for your attention
> Jack
>
>