home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfstoredproc.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.6 KB  |  64 lines

  1. <!--- CFSTOREDPROC Example --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. CFSTOREDPROC Example
  6. </TITLE>
  7. </HEAD>
  8.  
  9. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  10. <BODY  bgcolor="#FFFFD5">
  11.  
  12. <H3>CFSTOREDPROC Function</H3>
  13.  
  14. <P>The following view-only example executes a Sybase stored procedure
  15. that returns three result sets, two of which we want. The
  16. stored procedure returns the status code and one output
  17. parameter, which we display. We use named notation
  18. for the parameters.
  19. <P>See the View Example pane to view the code.
  20. <!--- CFSTOREDPROC tag 
  21. <CFSTOREDPROC PROCEDURE="foo_proc"
  22.     DATASOURCE="MY_SYBASE_TEST"    USERNAME="sa"
  23.     PASSWORD=""    DBSERVER="scup"    DBNAME="pubs2"
  24.     RETURNCODE="YES" DEBUG>  --->
  25. <!--- CFPROCRESULT tags 
  26. <CFPROCRESULT NAME = RS1>
  27. <CFPROCRESULT NAME = RS3 RESULTSET = 3>  --->
  28. <!---  CFPROCPARAM tags 
  29. <CFPROCPARAM TYPE="IN"
  30.     CFSQLTYPE=CF_SQL_INTEGER
  31.         VALUE="1"    DBVARNAME=@param1>
  32.         
  33. <CFPROCPARAM TYPE="OUT"    CFSQLTYPE=CF_SQL_DATE
  34.     CFVARNAME=FOO    DBVARNAME=@param2>  --->
  35. <!--- Close the CFSTOREDPROC tag 
  36. </CFSTOREDPROC>  --->
  37. <!---
  38. <CFOUTPUT>
  39. The output param value: '#foo#'
  40. <br>
  41. </CFOUTPUT>
  42. <h3>The Results Information</h3>
  43. <CFOUTPUT QUERY = RS1>#NAME#,#DATE_COL#
  44. <br>
  45. </CFOUTPUT>
  46. <p>
  47. <CFOUTPUT>
  48. <hr>
  49. <p>Record Count: #RS1.RecordCount# >p>Columns: #RS1.ColumnList#
  50. <hr>
  51. </CFOUTPUT> 
  52. <CFOUTPUT QUERY=RS3>#col1#,#col2#,#col3#
  53. <br>
  54. </CFOUTPUT>
  55. <p>
  56. <CFOUTPUT>
  57. <hr>
  58. <p>Record Count: #RS3.RecordCount# <p>Columns: #RS3.ColumnList#
  59. <hr>
  60. The return code for the stored procedure is: '#CFSTOREDPROC.STATUSCODE#'<br>
  61. </CFOUTPUT>  --->
  62.  
  63. </BODY>
  64. </HTML>