programmher
Programmer
I am re-creating a pre-existing stored procedure for a web application.
The stored procedure uses an embedded Select statement instead of values within an Insert statement. Ex:
INSERT INTO my_table
(field1, field2, field3, field4)
SELECT field1, field2, field3
FROM another_table
WHERE another_table field1 = #field1#
AND another_table field5 = 0
UPDATE another_table
SET field5 = 'something', field5 = 1
WHERE another_table.field1 = #field1" AND another_table.field5 = 0
Can I duplicate this code within CF EXACTLY the way it is in the stored procedure or will I have to use the standard syntax - supplying VALUES with the INSERT query, then referencing the INSERT query's values as variables in the second SELECT query?
The stored procedure uses an embedded Select statement instead of values within an Insert statement. Ex:
INSERT INTO my_table
(field1, field2, field3, field4)
SELECT field1, field2, field3
FROM another_table
WHERE another_table field1 = #field1#
AND another_table field5 = 0
UPDATE another_table
SET field5 = 'something', field5 = 1
WHERE another_table.field1 = #field1" AND another_table.field5 = 0
Can I duplicate this code within CF EXACTLY the way it is in the stored procedure or will I have to use the standard syntax - supplying VALUES with the INSERT query, then referencing the INSERT query's values as variables in the second SELECT query?