House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

Using Stored Procedures in ColdFusion

Author:
Joseph Flanigan
03/05/2004 09:18 PM

Brian: http://www.switch-box.org/cfsqltool/ is a new tool that makes working with CF and stored procedures easy. The tool works with CFMX and SQL Server.  We are still beta testing, but it will be GPL'd on the exchange when the testing is done. Because we are still testing, you may see some strange output. Originally I wrote some CF to help do stored procedures for inserts with CF5. Since then it has expanded to this version what is CFMX. If you are new to stored procedures or even experienced, the tool has a wizard for generating insert and update procedures. Another wizard can be run that will generate a CFFunction. It even documents the function by adding a copy of the procedure's SQL. CFMX CFC's really makes working with stored procedures much easier than other CF versions. So to learn the CF coding, 1. Make an insert stored procedure. A. pick the MindTargetSQL database and run the Build Insert procedure. B. The bottom left menu will load a list of all the tables in the DB. C. Select a table -- tContacts D. The table column selection menu will appear in the main exhibit frame. E. Use the checked boxes the wizard picks and check the RS box for ContactID The SQL code will show in a textarea box. This is ready for your DBA. 2. Build the CF Code. A. In the top right frame select MindTargetSQL and User Stored Procedure CFC wizard. B. On the left menu, choose pr_tContacts_INS C. In the exhibit frame, click on Show Generated Code.      (How about that? 3-click-coding. A new term. And a challenge.) The popped  window has all the CF code to run a stored procedure and some pre-defined namespaces. While the code is CFMX, a few hacks and it can be CF5. Now, one of the neat features of CFMX is the CFC. Try this: back in the left menu, select all the pr_tContacts procedures and hit submit. Wa-la in the exhibit frame pop window is a CFC with cffunctions for the procedures you just submitted. Joseph Joseph At 07:12 AM 3/5/2004, you wrote: >Hi all...In my 7 years of using CF, I have never used a stored >procedure.  Can anyone help me understand how I need to code it?  For >example purposes, lets just say I have 2 values that I need to pass to >it.  How would this be coded? > >Thanks much, > >Brian > >---------- >[


Search cf-talk

March 22, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31