Hi all :

For the first time ever (and under immense time pressure as always) I'm trying to produce what I thought was a simple output based on three tables of data, but the problem is the price for the items is generated dynamically based on a stored procedure, (because depending on the people who are looking at the data, a different price is displayed to them.)
 
I tried first just running two seperate queries, one to grab all the data from the table in question, and one to run the stored procedure on the first query to generate the price.
 
My first query went like this (used to grab the data from the table in question);
 
<cfquery name="ruff" datasource="bg">
SELECT * from bg.#url.page#
</cfquery>
 
<cfquery name="GetRapPPC" datasource="bg">
bg.sp_GetRapPrice '#ruff.Shape#','#ruff.Clarity#','#ruff.Color#', #ruff.carat# 
</cfquery>
 
And to output:
 
<cfoutput query="GetRapPPC">
#ruff.Carat#;#ruff.Color#;#ruff.Clarity#;#ruff.Shape#;<b>#GetRapPPC.Price#</b>;#url.page#
</cfoutput>
 
The problem is, obviously, this only returns one row at a time. I tried doing the output through a CFloop, specifiying the same query name and from 1 to #ruff.recordcount#, but it also only displayed one row at a time.
 
A friend recommended using the CFstoredproc to me, and I've tried fooling around with it but none of the documentation in CFstudio or online really help much. The variable I'm trying to get at is referred to as '@Price' in the stored procedure, and I'm a little confused with all the syntax of it, and it seems like overkill for my simple prupose.

Anyone have any ideas??
 
Here was my attempt at cfstoredproc:
 
<cfstoredproc procedure="bg.sp_GetRapPrice" datasource="bg" returncode="Yes">
    <cfprocparam type="Out" cfsqltype="CF_SQL_INTEGER" variable="@Price" dbvarname="@Price" null="No">
    <cfprocresult name="GetRapPPC" maxrows="#ruff.recordcount#">
 </cfstoredproc>
 
Any ideas, advice, suggestions anyone has would be greatly appreciated.
 
Thanks
Take care
Sean
 

Reply via email to