Stored procedure frustrated me

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Stored procedure frustrated me

    Hello,

    I have asked the professional here yesterday about the stored procedure
    problem but it is still not solved. I use the query analyzer to test the SP
    and it got exactly what I want. However, I duuno how to get it back to my
    webpage, I have the code here:

    <cfstoredproc procedure="dbo.dt_calwppercent"
    datasource="#Application.datasource#">
    <cfprocparam CFSQLTYPE="cf_sql_char" value="#var#">
    <cfprocresult name="sp_result">
    </cfstoredproc>

    But whenever I click the + in "Bindings", it prompted me that "Error Executing
    Database Query". I really need help otherwise I may be crazy @@ I can provide
    any other information for you to solve my problem. MANY THANKS

    Franklin LO Guest

  2. Similar Questions and Discussions

    1. MS SQL stored procedure
      I am new to MS SQL server and stored procedures. I currently have a query that looks like: select from table where fieldname IN...
    2. stored procedure help
      Hi all! I am in need of writing a few stored procedures. The first one is to create a stored procedure to recover a database from backup and the...
    3. Using a stored procedure
      I am trying to pass a ProdID to a stored procedure, but I get an error: Error Executing Database Query. Procedure &apos;PriceBreak&apos; expects...
    4. help with a stored procedure
      I am new to postgres stored procedures and would like a little help. My function basically takes 2 arguments and inserts data into a table from a...
    5. need help on a stored procedure
      I have 2 tables. table1 and table2 I do a select on table1 and join table 2 on id. I want to check newprice in table1. if it is null, I want to...
  3. #2

    Default Re: Stored procedure frustrated me

    So, what happens when you try to access the result set from your stored
    procedure? It behaves as if you had run a query with the name that you used in
    your cfprocresult tag.

    <cfstoredproc procedure="dbo.dt_calwppercent"
    datasource="#Application.datasource#">
    <cfprocparam CFSQLTYPE="cf_sql_char" value="#var#">
    <cfprocresult name="sp_result">
    </cfstoredproc>

    <cfoutput query="sp_result">#your_field_name1# #your_field_name2#
    #etc#</cfoutput>

    Phil

    paross1 Guest

  4. #3

    Default Re: Stored procedure frustrated me

    Hi Phil, Thanks for your help. However, the problem has not solved.
    When I added the code you suggested, i.e.

    <cfoutput query="sp_result">
    #your_field_name1# #your_field_name2#
    #etc#</cfoutput>

    And error occured when it process <cfoutput query="sp_result">. It said
    it was invalid.

    I have spent LOTS of time in solving this problem. What's wrong ~!?

    Here is my stored procedure code:

    CREATE PROCEDURE dbo.dt_calpercent @ID nvarchar (10) AS

    DECLARE @tbl_record table(date datetime, name nvarchar(30), course
    nvarchar(20), class int, equipment nvarchar(30))

    INSERT INTO @tbl_record

    SELECT history.date, trainer.trainerName, course.courseName,
    history.className, history.equipment

    FROM dbo.tbl_history history, dbo.tbl_trainer trainer,
    dbo.tbl_course course, dbo.tbl_status status

    WHERE history.historyID = @ID
    AND history.trainerID = trainer.trainerID AND history.courseID =
    course.courseID

    GROUP BY history.date, trainer.trainerName, course.courseName,
    history.className, history.equipment
    GO

    Please help me~! It's really urgent ~!!

    lokalun@gmail.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139