--------------D82B2777473DE9569A6A5589
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I gather from your statement that it isn't legal to use a where clause. One solution I
thought of is to wrap this insert in a cfif statement. Thanks for your help
--Lisa
Jeff Bearer wrote:
> You don't want to use a where clause in an insert statement, if you are
> updating data, you want to use a update statement.
>
> -Jeff
>
> Lisa Greenberg wrote:
> >
> > I am trying to insert data into a table and get the
> > following errors. I provided the semicolon, yet I still get
> > the errors. What am I doing wrong?
> >
> > TIA,
> >
> > Lisa
> >
> > ODBC Error Code 37000 (Syntax error or access violation)
> > [ODBC Mircosoft Access Driver] Missing semicolon (;) at end
> > of SQL statement.
> >
> > <cfquery name="ptobs" datasource="#dsn#" dbtype="odbc">
> > insert into ptobs
> > (pi,patno,PSL_ID,currPI,PIreason,pires_ot,dttype,results,
> > modHAART, intHAART, intreason, fatmaldis, hypergly, gly_pre,
> >
> > hyperlip, lip_pre, lla_yn, ll_agent, lla_dose,
> > anti_dyn,anti_d, antid_ot, antid_ds)
> > values ( '#ptdat.pi#','#variables.patno#',
> > #session.PSL_ID#, '#currPI#',
> > '#attributes.PIreason#',
> > '#attributes.pires_ot#',
> > #CreateODBCDateTime(variables.dttype)#,
> > '#attributes.results#',
> > '#attributes.modHAART#',
> > '#attributes.intHAART#',
> > '#attributes.intreason#',
> > '#attributes.fatmaldis#',
> > '#attributes.hypergly#',
> > '#attributes.gly_pre#',
> > '#attributes.hyperlip#',
> > '#attributes.lip_pre#',
> > '#attributes.lla_yn#',
> > '#attributes.ll_agent#',
> > '#attributes.lla_dose#',
> > '#attributes.anti_dyn#',
> > '#attributes.anti_d#',
> > '#attributes.antid_ot#',
> > '#attributes.antid_ds#' )
> > where demog.PSL_ID=#session.PSL_ID#
> > ;
> > </cfquery>
> >
> > ------------------------------------------------------------------------------
> > Archives: http://www.eGroups.com/list/cf-talk
> > To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
>message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
> ------------------------------------------------------------------------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
>message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
--------------D82B2777473DE9569A6A5589
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I gather from your statement that it isn't legal to use a where clause.
One solution I thought of is to wrap this insert in a cfif statement.
Thanks for your help
<p>--Lisa
<p>Jeff Bearer wrote:
<blockquote TYPE=CITE>You don't want to use a where clause in an insert
statement, if you are
<br>updating data, you want to use a update statement.
<p>-Jeff
<p>Lisa Greenberg wrote:
<br>>
<br>> I am trying to insert data into a table and get the
<br>> following errors. I provided the semicolon, yet I still get
<br>> the errors. What am I doing wrong?
<br>>
<br>> TIA,
<br>>
<br>> Lisa
<br>>
<br>> ODBC Error Code 37000 (Syntax error or access violation)
<br>> [ODBC Mircosoft Access Driver] Missing semicolon (;) at end
<br>> of SQL statement.
<br>>
<br>> <cfquery name="ptobs" datasource="#dsn#" dbtype="odbc">
<br>> insert into ptobs
<br>> (pi,patno,PSL_ID,currPI,PIreason,pires_ot,dttype,results,
<br>> modHAART, intHAART, intreason, fatmaldis, hypergly, gly_pre,
<br>>
<br>> hyperlip, lip_pre, lla_yn, ll_agent, lla_dose,
<br>> anti_dyn,anti_d, antid_ot, antid_ds)
<br>> values ( '#ptdat.pi#','#variables.patno#',
<br>> #session.PSL_ID#, '#currPI#',
<br>> '#attributes.PIreason#',
<br>> '#attributes.pires_ot#',
<br>> #CreateODBCDateTime(variables.dttype)#,
<br>> '#attributes.results#',
<br>> '#attributes.modHAART#',
<br>> '#attributes.intHAART#',
<br>> '#attributes.intreason#',
<br>> '#attributes.fatmaldis#',
<br>> '#attributes.hypergly#',
<br>> '#attributes.gly_pre#',
<br>> '#attributes.hyperlip#',
<br>> '#attributes.lip_pre#',
<br>> '#attributes.lla_yn#',
<br>> '#attributes.ll_agent#',
<br>> '#attributes.lla_dose#',
<br>> '#attributes.anti_dyn#',
<br>> '#attributes.anti_d#',
<br>> '#attributes.antid_ot#',
<br>> '#attributes.antid_ds#' )
<br>> where demog.PSL_ID=#session.PSL_ID#
<br>> ;
<br>> </cfquery>
<br>>
<br>> ------------------------------------------------------------------------------
<br>> Archives: <a
href="http://www.eGroups.com/list/cf-talk">http://www.eGroups.com/list/cf-talk</a>
<br>> To Unsubscribe visit <a
href="http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk">http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk</a>
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.
<br>------------------------------------------------------------------------------
<br>Archives: <a
href="http://www.eGroups.com/list/cf-talk">http://www.eGroups.com/list/cf-talk</a>
<br>To Unsubscribe visit <a
href="http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk">http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk</a>
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.</blockquote>
</html>
--------------D82B2777473DE9569A6A5589--
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.