The correct way in ANSI SQL
would be something Like

DELETE FROM SystemQuote WHERE CFID Exists IN
(
Select CFID
FROM SystemQuote
WHERE (CFID=#CFID# AND CFTOKEN=#CFTOKEN#)
)

Check the syntax but something like that .....

Justin

----- Original Message -----
From: Chris Terrebonne <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 23, 2000 4:09 PM
Subject: RE: [Another Way...]Checking for a record, and then deleting it


> Never tried it on Oracle.  It works great on MS SQL 7.
> Check the Oracle docs for the correct SQL format of the statement and it
> should work
>
> Chris
> ----------------------------------------------
> Original Message
> From: "Frédéric LeMieux"<[EMAIL PROTECTED]>
> Subject: RE: [Another Way...]Checking for a record, and then deleting it
> Date: Fri, 23 Jun 2000 09:52:08 -0400
>
> >hmmm.... I never saw that kind of SQL statement. So I tried, and it is
not
> >working !
> >The Oracle Database returns "Invalid SQL statement".
> >
> >Where did you see that king of statement ? Can you give me more
information
> >on how to make this king of SQL working ?
> >
> >
> >-----Original Message-----
> >From: Chris Terrebonne [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, June 23, 2000 9:48 AM
> >To: [EMAIL PROTECTED]
> >Subject: Re:[Another Way...]Checking for a record, and then deleting it
> >
> >
> >Or you could do it all via SQL:
> >
> ><CFQUERY datasource="bwpc" name="TestForExistingQuote">
> >IF ((Select COUNT(*) FROM SystemQuote WHERE (CFID=#CFID# AND
> >CFTOKEN=#CFTOKEN#)) > 0)
> >     DELETE FROM SystemQuote WHERE CFID = #CFID#
> ></cfquery>
> >
> >Chris
> >----------------------------------------------
> >Original Message
> >From: "Chris Terrebonne"<[EMAIL PROTECTED]>
> >Subject: Re:Checking for a record, and then deleting it
> >Date: Fri, 23 Jun 2000 08:43:08 -0500
> >
> >>Just test for the RecordCount...
> >>
> >><CFQUERY datasource="bwpc" name="TestForExistingQuote">
> >>Select * FROM SystemQuote WHERE (CFID=#CFID# AND CFTOKEN=#CFTOKEN#)
> >></cfquery>
> >>
> >><CFIF TestForExistingQuote.RecordCount>
> >> <CFQUERY datasource="bwpc">
> >> DELETE FROM SystemQuote WHERE CFID = #CFID#
> >> </cfquery>
> >></cfif>
> >>
> >>----------------------------------------------
> >>Original Message
> >>From: "Chris Farrugia"<[EMAIL PROTECTED]>
> >>Subject: Checking for a record, and then deleting it
> >>Date: Thu, 22 Jun 2000 21:24:46 -0400
> >>
> >>>I have a table in a database that contains the fields CFID, CFTOKEN,
WDDX
> >>>(which is an array that I used CFWDDX on), and the date.  It is for a
> >>system
> >>>configurator for new computer systems.  When someone fills in the forms
> >for
> >>>what they want on their system, it puts it in a database, then they can
> >>>click a reconfigure button...  that takes them back to the form they
just
> >>>filled out so they can reconfigure their system.  THen they hit the
> submit
> >>>button again and here I need to check if a record in the quotes table
> >>>already exists (meaning this is at least the second time they've
> >configured
> >>>a system), and if it exists, then that record needs to be deleted.
Here
> >is
> >>>the code I've tried but it doesn't work:
> >>>
> >>><CFQUERY datasource="bwpc" name="TestForExistingQuote">
> >>>Select * FROM SystemQuote WHERE (CFID=#CFID# AND CFTOKEN=#CFTOKEN#)
> >>></cfquery>
> >>>
> >>><CFOUTPUT Query="TestForExistingQuote">
> >>><CFIF IsDefined('#WDDX#')>
> >>> <CFQUERY datasource="bwpc">
> >>> DELETE FROM SystemQuote WHERE CFID = #CFID#
> >>> </cfquery>
> >>></cfif>
> >>></cfoutput>
> >>>
> >>>
> >>>Does anybody know of a way of doing this?  Thanks in advance.
> >>>
>
>>>-------------------------------------------------------------------------
> -
> >-
> >>---
> >>>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.
> >>>
> >>
> >>_____________________________________________
> >>Free email with personality! Over 200 domains!
> >>http://www.MyOwnEmail.com
> >>
>
>>--------------------------------------------------------------------------
> -
> >---
> >>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.
> >>
> >
> >_____________________________________________
> >Free email with personality! Over 200 domains!
> >http://www.MyOwnEmail.com
> >
>
>---------------------------------------------------------------------------
> -
> >--
> >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.
> >
>
> _____________________________________________
> Free email with personality! Over 200 domains!
> http://www.MyOwnEmail.com
>
> --------------------------------------------------------------------------
----
> 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.

Reply via email to