paragvshah
Programmer
I want to insert a row in a table where the datatype of customernumber is varchar(6) and with every insertion of row the cutomernumber should be incremented by 1 after getting the max id. for that i need to cast the customernumber from varchar to int. so i am using the following syntax to get the max id.
SELECT MAX(to_number(trim(CustomerNumber),'999999')) as max1 FROM Customers
I have cold fusion as my front end for coding.
I am able to run the above query successfully on my local postgresql database but not thru coldfusion.
I am getting an error while running the page through cold fusion:
Error Diagnostic Information
ODBC Error Code = S1000 (General error)
Error while executing the query; ERROR: Bad numeric input format ' '
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (13:1) to (13:90).
Please help me out with this problem.
Parag.
SELECT MAX(to_number(trim(CustomerNumber),'999999')) as max1 FROM Customers
I have cold fusion as my front end for coding.
I am able to run the above query successfully on my local postgresql database but not thru coldfusion.
I am getting an error while running the page through cold fusion:
Error Diagnostic Information
ODBC Error Code = S1000 (General error)
Error while executing the query; ERROR: Bad numeric input format ' '
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (13:1) to (13:90).
Please help me out with this problem.
Parag.