Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
sviolet #1
problem with insert statement
HI there
it seems like i get the error when inserting records into a MS Access database
if the fields are null. :
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] Syntax error in INSERT INTO statement.
The error occurred in C:\Inetpub\wwwroot\instreamWorks\Instream_Enter3.c fm:
line 30
Called from C:\Inetpub\wwwroot\instreamWorks\Instream_Enter3.c fm: line 1
Called from C:\Inetpub\wwwroot\instreamWorks\Instream_Enter3.c fm: line 30
Called from C:\Inetpub\wwwroot\instreamWorks\Instream_Enter3.c fm: line 1
28 : <cfquery name="AddTrip" datasource="InstreamWorks">
29 : INSERT INTO TBL_PROJECT_GEOREFERENCE (TBL_PROJECT_INFO_ID, EASTINGS,
NORTHINGS)
30 : VALUES (#getid.maxid#, #Form.EASTINGS#, #Form.NORTHINGS#)
31 : </cfquery>
32 :
--------------------------------------------------------------------------------
SQL INSERT INTO TBL_PROJECT_GEOREFERENCE (TBL_PROJECT_INFO_ID, EASTINGS,
NORTHINGS) VALUES (93, , )
DATASOURCE InstreamWorks
****************
if the user fills out all the fields, then the records are inserted without a
problem. this doesn't happen on other insert queries of mine.
my code:
<cfquery name="AddTrip" datasource="InstreamWorks">
INSERT INTO TBL_PROJECT_GEOREFERENCE (TBL_PROJECT_INFO_ID, EASTINGS,
NORTHINGS)
VALUES (#getid.maxid#, #Form.EASTINGS#, #Form.NORTHINGS#)
</cfquery>
any ideas?
thanks
sviolet Guest
-
Help with INSERT INTO statement
I'm getting the following error on a query. I haven't seen this one before. Any ideas on what I'm doing wrong? Thanks. Error Executing Database... -
INSERT statement contains fewer items than the insert list
The block of code below shows how I am inserting field values into my dbase table: strSQLStatement = "INSERT INTO tblArticles... -
What am I doing wrong; problem with INSERT statement (ASP/MS ACCESS)
Does column desc allow empty strings? "Simom Thorpe" <simonocthorpe@hotmail.com> wrote in message... -
Problem with IDENTITY and ORDER BY in a INSERT statement
Peter, I think this is a minor bug with the SQL Server parser. I've passed it on to MS. Fortunately the workaround is simple. I'll also... -
Insert Statement help
Hello, I am having some difficulty keeping my data consistent throughout my tables. I have 3 tables that I need to be "synch'd up".... -
A3gis #2
Re: problem with insert statement
Hi,
are the fields eastings and northings integers? I dont mean to point out the
obvious but just in case, dont forget the single quotes for them if they're
textual fields.
have you tried using <cfqueryparam> tags for the values as well?
Cheers,
Aegis
A3gis Guest
-
sviolet #3
Re: problem with insert statement
Thanks a3gis,
Single quotes was not the problem but your suggestion to use cfqueryparam
worked:
<CFQUERY DATASOURCE="InstreamWorks" NAME="InsertGEO">
INSERT INTO TBL_GEOREF (
EASTINGS,
NORTHINGS
)
VALUES (
<cfqueryparam
value="#Form.EASTINGS#"
cfsqltype="CF_SQL_DOUBLE"<cfqueryparam>,
value="#Form.NORTHINGS#"
cfsqltype="CF_SQL_DOUBLE")>
</cfquery>
sviolet Guest
-
A3gis #4
Re: problem with insert statement
Cool :)
note, anywhere you're receiving form or url variables into a query, it is very
handy to use cfqueryparams, as they prevent users from being able to send
spurious SQL commands through those fields to trigger DROP TABLE commands etc.
Regards,
Aegis
A3gis Guest



Reply With Quote

