--------------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&nbsp; 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.&nbsp; I provided the semicolon, yet I still get
<br>> the errors.&nbsp; 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>> &lt;cfquery&nbsp; name="ptobs" datasource="#dsn#" dbtype="odbc">
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; insert into ptobs
<br>>&nbsp;&nbsp;&nbsp; (pi,patno,PSL_ID,currPI,PIreason,pires_ot,dttype,results,
<br>> modHAART, intHAART, intreason, fatmaldis, hypergly, gly_pre,
<br>>
<br>>&nbsp;&nbsp;&nbsp;&nbsp; hyperlip, lip_pre, lla_yn, ll_agent, lla_dose,
<br>> anti_dyn,anti_d, antid_ot, antid_ds)
<br>>&nbsp;&nbsp;&nbsp;&nbsp; values ( '#ptdat.pi#','#variables.patno#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #session.PSL_ID#, '#currPI#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.PIreason#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.pires_ot#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #CreateODBCDateTime(variables.dttype)#,
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.results#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.modHAART#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.intHAART#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.intreason#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.fatmaldis#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.hypergly#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.gly_pre#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.hyperlip#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.lip_pre#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.lla_yn#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.ll_agent#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.lla_dose#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.anti_dyn#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.anti_d#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.antid_ot#',
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#attributes.antid_ds#' )
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where&nbsp;&nbsp; demog.PSL_ID=#session.PSL_ID#
<br>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;
<br>> &lt;/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&amp;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&amp;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.

Reply via email to