Jochem


This is the full query code


<cftransaction>


  <cfquery name="LOOKUP" datasource="intranetv8">
   SELECT Max(id) NewID
   FROM itarticle
  </cfquery>


  <cfif lookup.newid is "">
   <cfset id = 1>
  <cfelse>
   <cfset id = lookup.newid + 1>
  </cfif>


<!--- Insert contact into the contacts tabel in the tes8 Database --->


<cfset storydate = form.event_month & "/" & form.event_day & "/" &
form.event_year>
<cfset storydate = #CreateODBCDate(storydate)#>
<cfset formatted_date = dateformat(storydate, "MM/DD/YYYY")>

<cfset content = REReplacenocase(content, "</*font[^<>]*>", "", "ALL")>
<cfset content = REReplacenocase(content, "</*span[^<>]*>", "", "ALL")>


<cfif form.uploadfile neq "">


<cffile action="" filefield="Form.UploadFile"
destination="F:\Websites\Intranet\itintranet\itnews\images\"
nameconflict="OVERWRITE">
</cfif>
<!--- Make sure that file is of correct type --->


<!--- Insert the story record --->


<cfquery datasource="#Application.DSN#" name="insert_query">
INSERT INTO
itarticle
(id, articledate, articletitle, articlesummary, articleauthor, security,
imgsrc)
VALUES (
#id#, TO_DATE('#formatted_date#', 'MM/DD/YYYY'), '#articletitle#',
'#articlesummary#', '#Session.Fname# #Session.Lname#', '#security#',
<cfif
isdefined("file.serverFile")>'#file.serverFile#'<cfelse>NULL</cfif>)
</cfquery>


<!--- Insert the long text into the story record --->
<cfquery datasource="#Application.DSN#" name="insert_query">
DECLARE new_text LONG;
BEGIN
new_text := '#content#';


UPDATE itarticle
SET articlebody = new_text
WHERE id = #id#
and articletitle = '#articletitle#'
and articlesummary = '#articlesummary#'
and articleauthor = '#Session.Fname# #Session.Lname#'
and security = '#security#'
and storydate = TO_DATE('#formatted_date#', 'MM/DD/YYYY');
END;
</cfquery>


</cftransaction>

-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: 22 December 2003 11:52
To: CF-Talk
Subject: Re: Date Errors in MX ?


Ian Vaughan said:
>
> Can anybody shed some light on the error I am getting below,
it is
> pointing at the date area of the code ?

More likely it is pointing at the semicolon.

> Any ideas why MX 6.1 does
> not like this, and how can I get around this problem ?

Strict interpretation of the JDBC spec says one query per
statement.

> <cfquery datasource="#Application.DSN#" name="insert_query">
> INSERT INTO
> itarticle
> (id, articledate, articletitle, articlesummary, articleauthor,
> security, imgsrc)
> VALUES (
> #id#, TO_DATE('#formatted_date#', 'MM/DD/YYYY'),
'#articletitle#',
> '#articlesummary#', '#Session.Fname# #Session.Lname#',
'#security#',
> <cfif
>
isdefined("file.serverFile")>'#file.serverFile#'<cfelse>NULL</cfif>)
> </cfquery>

This is not the query from the error.

Jochem
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to