Heh, one step a time. I'm pretty new to all this...

-----Original Message-----
From: Josh [mailto:[EMAIL PROTECTED]
Sent: 14 February 2004 3:49 pm
To: CF-Talk
Subject: Re: Multiple SQL queries in one CFquery?

even better, write a stored proc!

---
Exciteworks -- expert hosting for less!
http://exciteworks.com
specializing in reseller accounts

[EMAIL PROTECTED] wrote:

> Afternoon all,
>
> Basically I've got three cfqueries in a transaction which I think can
> be combined into one - and therefore making the database do the hard
> work instead of CF. I'm using Oracle 8i by the way.
>
> What I'd like to do is this:
>
> <cfquery ...>
> SELECT X, Y, Z
> FROM TABLE
> WHERE Z = 2
>
> IF RECORD COUNT = 0 -- Record count of prev. SELECT statement
> INSERT INTO TABLE
> VALUES (1, 2, 3)
>
> ELSE -- RECORD COUNT GTE 1
> UPDATE TABLE
> SET X = 1
>     Y = 2
>     Z = 3
> END IF
> </cfquery>
>
> Is this possible in Oracle 8i & CF 5.0?
>
> Cheers,
> Rob
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to