Skip to main content
February 22, 2008
Question

Inserting by ame query in coldfusion 4.5 and coldfusion 8 creates problem

  • February 22, 2008
  • 1 reply
  • 334 views
Actually I am upgrading my system from coldfusion 4.5 to coldfusion 8. As database it is same for both Oracle 8.
The same insertion statement is working in cold fusion 4.5 but showing error while working with coldfusion 8. It is showing error missing right parantheses.
Query is:

<cfset #QueryModelInsert#="
INSERT INTO #ORADSQ#MNET_MODEL_YR
(MMY_MODEL_YR,MMY_START_DATE,MMY_END_DATE,
MMY_PRERIG_PAPER,MMY_PRERIG_ELEC,MMY_COOP_PAPER,
MMY_COOP_ELEC,MMY_TRAVIS_REBATE)
VALUES('#ModelYr#',To_Date('#StartDate#','yyyy-mm-dd'),To_Date('#EndDate#','yyyy-mm-dd'),#PrerigPaper#,
#PrerigElec#,#CoopPaper#,#CoopElec#,#TravisRebate#)">

<cfquery name="QueryModelInsert" datasource="#ORADSN#" username="#client.ORAUSERNAME#" password="#client.ORAPASSWORD#">
#PreserveSingleQuotes(QueryModelInsert)#
</cfquery>

According to me perhaps some date format is creatin problem.
This topic has been closed for replies.

1 reply

Inspiring
February 22, 2008
If start_date and end_date are date datatypes, and your variables are dates, you don't need to format anything. And, as you correctly guessed, attempting to do so causes problems.