Hey all,
Basically, I have a table called Rates_New, and the column headers are like PartTime_SomeNumber_D, FullTime_SomeNumber_D, etc.... (with somenumber being anywhere between 01 and 99). Basically, I find out what the number is, whether or not they are fulltime or parttime, then send a variable to be stored into @check_index_d.
This is the code for my stored procedure:
And this is how I am calling it from coldfusion:
When I do a cfdump, I get:
What I should get is some numeric value instead of the variable itself, in the rate column. My question, is when I'm using a variable in the select statement, how do I return just the selected value instead of the value I sent up?
Thanks.
Basically, I have a table called Rates_New, and the column headers are like PartTime_SomeNumber_D, FullTime_SomeNumber_D, etc.... (with somenumber being anywhere between 01 and 99). Basically, I find out what the number is, whether or not they are fulltime or parttime, then send a variable to be stored into @check_index_d.
This is the code for my stored procedure:
Code:
CREATE PROCEDURE dbo.getEmpOnLeave @check_index_D varchar(14), @medical varchar(2)
AS
SELECT Rate=@check_index_D, Description
FROM Rates_New
WHERE ID = @medical
And this is how I am calling it from coldfusion:
Code:
<cfstoredproc procedure="getEmpOnLeave" datasource="#Datasource#">
<cfif EmpInfo.GHRFTPT EQ 'P'>
<cfset deduction = "PartTime_" & #EmpInfo.GHRPT# & "_D">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="check_index_D" value="#deduction#" null="No">
<cfelse>
<cfset deduction = "FullTime_" & #EmpInfo.GHRPT# & "_D">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="check_index_D" value="#deduction#" null="No">
</cfif>
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="medical" value="#EmpInfo.Medical#" null="No">
<cfprocresult name="EmpOnLeaveMedical" resultset="1">
</cfstoredproc>
When I do a cfdump, I get:
Code:
RATE DESCRIPTION
FullTime_57_D HMO : Employee Only
What I should get is some numeric value instead of the variable itself, in the rate column. My question, is when I'm using a variable in the select statement, how do I return just the selected value instead of the value I sent up?
Thanks.