syntax error inserting float numbers
Posted: Fri Sep 21, 2007 5:27 am
feyd | Please use
Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line1: syntax error near '12.00'., SQL state 37000 in SQLExecute
The data types are:
ID: int
CODIGO: nvarchar
UDS and PVPU: float
EXPDTE: nvarchar
I obtain UDS and PVPU from a SELECT and the values can be 12.00 or 1225.50 (for example). But if I try doing this:
I don't get the error and the INSERT is done correctly, so I think the problem is creating the string.
What I'm doing wrong?, Thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I'm trying to execute the following sentence but I get an error:Code: Select all
$result_id = odbc_prepare ($id_con,"insert into MEDICIONESTRABAJOS (ID, CODIGO, UDS,PVPU,EXPDTE) values ($id_trabajo,'$codigo',$uds,$pvpu, '$expdte')");The data types are:
ID: int
CODIGO: nvarchar
UDS and PVPU: float
EXPDTE: nvarchar
I obtain UDS and PVPU from a SELECT and the values can be 12.00 or 1225.50 (for example). But if I try doing this:
Code: Select all
$uds = 12.00;
$pvpu = 1225;What I'm doing wrong?, Thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]