Ask a Question related to Macromedia ColdFusion, Design and Development.
-
helpster #1
semicolon requested
Can someone help me on this. I'm trying to insert data into 2 tables using cf
defined statements from the insert form wizard. When I run the code in IE it
keeps insisting I need to add a semicolons. See errors below:
Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] Missing semicolon (;) at end of SQL statement.
The error occurred in C:\CFusionMX\wwwroot\MyColdfusion\Untitled-insert.cfm:
line 136
Called from line 2
Called from line 1
Called from line 136
Called from line 2
Called from line 1
134 : <cfelse>
135 : NULL
136 : </cfif>
137 : )
138 : </cfquery>
--------------------------------------------------------------------------------
SQL INSERT INTO tblCustomer (CustomerName, CustomerPhone, CustomerEmail,
CustomerTypeID ) VALUES ( 'John Doe' , 'xx' , 'xx' , 1 ) INSERT INTO
tblNTracking (CategoryID, ECID, DNID, NNumber, NED, PubID, RecID,
OtherCustomerEntry, Description, Resolution, DateInitiated, DateResolved,
Assignee, OpenClosedStatus, ICID, INTID, SubjectID, Library ) VALUES ( '4' ,
'2' , '30' , 'xx' , 'xx' , '73' , '2' , 'xx' , 'xx' , 'xx' , '040805' , NULL ,
NULL , Open , '6' , '695' , '93' , 'xx' )
DATASOURCE TraDatabase
VENDORERRORCODE -3516
SQLSTATE 42000
Please try the following:
Check the ColdFusion documentation to verify that you are using the correct
syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
My Code is as follows:
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "form1">
<cfquery datasource="TraDatabase">
INSERT INTO tblCustomer (CustomerName, CustomerPhone, CustomerEmail,
CustomerTypeID ) VALUES (
<cfif IsDefined("FORM.CustomerName") AND #FORM.CustomerName# NEQ "">
'#FORM.CustomerName#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.CustomerPhone") AND #FORM.CustomerPhone# NEQ "">
'#FORM.CustomerPhone#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.CustomerEmail") AND #FORM.CustomerEmail# NEQ "">
'#FORM.CustomerEmail#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.CustomerTypeID") AND #FORM.CustomerTypeID# NEQ "">
#FORM.CustomerTypeID#
<cfelse>
NULL
</cfif>
)
INSERT INTO tblNTracking (CategoryID, ECID, DNID, NNumber, NED, PubID,
RecID, OtherCustomerEntry, Description, Resolution, DateInitiated,
DateResolved, Assignee, OpenClosedStatus, ICID, INTID, SubjectID, Library )
VALUES (
<cfif IsDefined("FORM.CategoryID") AND #FORM.CategoryID# NEQ "">
'#FORM.CategoryID#'
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.ECID") AND #FORM.ECID# NEQ "">
'#FORM.ECID#'
<cfelse>
NULL
</cfif>
,
< **Code continues**
NULL
</cfif>
,
**Code continues**
<cfif IsDefined("FORM.Library") AND #FORM.Library# NEQ "">
'#FORM.Library#'
<cfelse>
NULL
</cfif>
)
</cfquery>
</cfif>
:confused;
helpster Guest
-
cfgrid and semicolon bug
This problem was posted way back in 2005 but I have not seen a solution to it. When querying from a database a record that contains a semicolon and... -
Missing semicolon problem
I am getting the error of Missing semicolon at end of SQL statement on the LAST insert of the following code, but I don't know why. <cfquery... -
What does a semicolon do at the beginning of a line?
Was browsing the documentation on reading a configuration file and found this. What does a semicolon do at the beginning of a line? ; <?php DO... -
behavior of semicolon on return line
Does the semicolon behave any differently for a return test statement? Example, sub validate { return shift =~ /^*\.+$/ } or sub validate -
how to output semicolon with php
hi! thanx for reading! my problem: I want to print : 7] Xerox: print '<a href='. '"javascript:;"'. "onClick='hideAll(); showHideLayers... -
paross1 #2
Re: semicolon requested
You may need to put a semicolon between your insert statements, but more
likely, you will have to put each insert statement into its own CFQUERY. Some
databases and connections will allow multiple queries with a single CFQUERY,
but most do not.
Phil
paross1 Guest



Reply With Quote

