Ask a Question related to Coldfusion Database Access, Design and Development.
-
Franklin LO #1
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
-
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... -
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... -
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 'PriceBreak' expects... -
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... -
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... -
paross1 #2
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
-
lokalun@gmail.com #3
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



Reply With Quote

