> in my shopping cart check out process, once an order
> has been recorded, i want to update the stock levels
> of my inventory too.
>
> i'm thinking of using triggers, so that if there is
> not enough stock, the trigger should raise an error
> (i'm using MSSQL7). in this case, how can ColdFusion
> know that the error is "out of stock" and the product
> ID of the error?

If your trigger returns a recordset, the CFQUERY tag which caused the
trigger to fire will receive that recordset. So, you could write a trigger
that returns a value using a SELECT statement, and read that value from CF.

Since you're using SQL Server 7, you might want to try doing this in a
stored procedure, as there's generally less overhead involved with stored
procedures than triggers. Also, with a stored procedure, you could return a
value instead of a recordset, and read that value without the overhead
involved with recordsets.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
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