Simone
06/12/2023, 3:13 PMzackster
06/12/2023, 3:14 PMzackster
06/12/2023, 3:15 PMSimone
06/12/2023, 3:21 PMSimone
06/12/2023, 3:22 PM<cfstoredproc procedure="assign">
<cfprocparam type="IN" cfsqltype="VARCHAR" dbvarname="@itemID" value="#form.ItemId#" null="#!len(form.ItemId)#">
<cfprocparam type="OUT" cfsqltype="INTEGER" dbvarname="@id">
</cfstoredproc>zackster
06/12/2023, 3:24 PMzackster
06/12/2023, 3:25 PMpothys-mitrahsoft
06/12/2023, 3:31 PMSimone
06/12/2023, 4:09 PMSimone
06/12/2023, 4:10 PMSimone
06/12/2023, 4:10 PMRodney
06/12/2023, 5:31 PMSimone
06/12/2023, 6:04 PMCREATE PROCEDURE uspFindProductByModel (
@model_year SMALLINT,
@product_count INT OUTPUT
) AS
BEGIN
SELECT
product_name,
list_price
FROM
production.products
WHERE
model_year = @model_year;
SELECT @product_count = @@ROWCOUNT;
END;
how when i am caling the stored proc wth cfstoredproc, its not returning me the value then, i am using out in my case if you se at the code i posted, i have the sp running and giving me dataSimone
06/12/2023, 6:05 PMSimone
06/12/2023, 6:22 PMSimone
06/12/2023, 6:23 PMSimone
06/12/2023, 6:45 PMSimone
06/12/2023, 6:45 PMMatt Jones
06/12/2023, 7:07 PMcfprocparam( type="out", cfsqltype="cf_sql_integer", variable="pcount"); then you can reference pcount in your code. But, if you found something different, it could help future people to share your finding.Simone
06/12/2023, 7:54 PMSimone
06/12/2023, 7:54 PMSimone
06/12/2023, 7:54 PMSimone
06/12/2023, 7:55 PMMatt Jones
06/12/2023, 8:19 PMAny one of these should work on lucee with sql server for your 'if this is the sp' question
cfstoredproc( procedure="uspFindProductByModel" ) {
cfprocparam( value="2022");
cfprocparam( type="out", variable="pcount");
}
dump(pcount);
cfstoredproc( procedure="uspFindProductByModel" ) {
cfprocparam( sqltype="integer", value="2022");
cfprocparam( type="out", sqltype="integer", variable="pcount");
}
dump(pcount);
cfstoredproc( procedure="uspFindProductByModel" ) {
cfprocparam( cfsqltype="cf_sql_integer", value="2022");
cfprocparam( type="out", cfsqltype="cf_sql_integer", variable="pcount");
}
dump(pcount);
cfstoredproc( procedure="uspFindProductByModel" ) {
cfprocparam( cfsqltype="cf_sql_integer", value="2022", dbvarname="@model_year" );
cfprocparam( type="out", cfsqltype="cf_sql_integer", variable="pcount", dbvarname="@product_count");
}
dump(pcount);