Worse, you rewrite the whole thing in a stored procedure
CREATE PROCEDURE up_schedule_lunch
@cName VarChar(150),
@cQuestionText VarChar(500)
AS
DECLARE @lFundCheck BIT
SET @lFundCheck = (SELECT CASE WHEN @nBalance <= 10 THEN 0 ELSE 1 END as
lFundCheck FROM CoWorkers WHERE Name = @cName AND Question = @cQuestion)
IF @lFundCheck = 0
UPDATE CoworkerProfiles
SET Funds = '10.00'
FROM CoworkerProfiles
INNER JOIN CoWorkers ON
CoWorkers.CoWorkers_id = CoworkerProfiles.CoWorkers_id
WHERE CoWorkers.Name = @cName
GO
> -----Original Message-----
> From: cfhelp [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 26, 2003 11:00 AM
> To: CF-Community
> Subject: RE: You know you're a web dev junkie when...
>
>
> Or SQL Statements...
>
> SELECT Name, Answer, Time
> FROM CoWorkers
> WHERE Name = 'Vaughn'
> AND Question = 'Are we going to lunch'
>
> Then he replies...
>
> ODBC Error: 12345 Unable to process request do to lack of funds. Please
> check the query and ask again.
>
>
> Then you're forced to reply
>
> SELECT CoWoGUID as CoGUID
> FROM CoworkerProfiles
> WHERE Name = 'Vaughn'
>
>
>
> UPDATE CoworkerProfiles
> SET
> Funds = '10.00'
> WHERE CoWoGUID = '#CoGUID#"
>
>
> And he replies...
>
> TRUE
>
>
> Rick
>
>
>
> -----Original Message-----
> From: Candace Cottrell [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 26, 2003 9:32 AM
> To: CF-Community
> Subject: RE: You know you're a web dev junkie when...
>
> You <cfspeak> in tags.
>
> Candace K. Cottrell, Web Developer
> The Children's Medical Center
> One Children's Plaza
> Dayton, OH 45404
> 937-641-4293
> http://www.childrensdayton.org
>
>
> [EMAIL PROTECTED]
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=5
Get the mailserver that powers this list at http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5