No idea?

Thank you

"Andrea Chiado' Piat" <[EMAIL PROTECTED]> ha scritto nel messaggio
ao6nf6$2p1$[EMAIL PROTECTED]">news:ao6nf6$2p1$[EMAIL PROTECTED]...
> Hi all,
>
> I have this problem with ODBC:
>
> I create a test table like this:
>
> CREATE TESTTABLE (CODICE CHAR(5), VALORE INTEGER DEFAULT 0)
>
> When I run this statement from Visual FoxPro, it runs ok
>
> cSql="INSERT INTO testtable (codice) VALUES ('12345')
> sqlexec(nConnHandle, cSql)
>
> result is
>
> codice              valore
> -------             -------
> 12345                      0
>
> When I run this, it runs ok
>
> cSql="INSERT INTO testtable (codice, valore) VALUES ('12345', NULL)
> sqlexec(nConnHandle, cSql)
>
> result is
>
> codice              valore
> -------             -------
> 12345                      ?
>
> But if I assign a variable
>
> cCodice='12345'
> nValore=NULL
> cSql="INSERT INTO testtable (codice, valore) VALUES (?cCodice, ?nValore)
> sqlexec(nConnHandle, cSql)
>
> it returns this error:
> Connectivity error: [SAP AG][SQLOD32.DLL] Integrity constraint violation.
>
> Why?
>
> Thanks in advance
>
> Andrea Chiad� Piat
> Bit Informatica s.r.l.
> Progettazione e Sviluppo




_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to