Hi,
I am executing a stored procedure written in ORACLE from VB. My problem is when I am executing this procedure from back end (i.e. ORACLE), I am getting the desired output/results. But if the same procedure is executed from VB, then the output is not what is desired.
I am unable to understand where the code is going wrong.
The procedure declaration in ORACLE is as follows,
procedure process_itax_calculation
(
p_run_id in number,
p_company in char,
p_emp_no in varchar2,
p_fin_year in char,
p_it_salary_head_cd in char,
p_it_it_type_cd in char,
p_future_months in number,
p_for_year in number,
p_for_month in number,
p_adhoc_it in char,
p_it_form in char
)
is
---some code here
begin
---some code here
end;
Following is the VB call to the above procedure....
Dim cmd_it_cal as New ADODB.Command
With cmd_it_cal
.ActiveConnection = CommonModule.cnn
.CommandType = adCmdStoredProc
.CommandText = "process_itax_calculation"
.Parameters.Append .CreateParameter("RunNo", adInteger, adParamInput, 6, li_run_no)
.Parameters.Append .CreateParameter("CoCd", adChar, adParamInput, 2, GS_COMP_CD)
.Parameters.Append .CreateParameter("EmpNo", adVarChar, adParamInput, 12, rs_tt_process_emp("emp_no".Value)
.Parameters.Append .CreateParameter("FinYr", adChar, adParamInput, 16, ls_fin_year)
.Parameters.Append .CreateParameter("TDSHead", adChar, adParamInput, 4, ls_tds_head_cd) '2006
.Parameters.Append .CreateParameter("Param1", adChar, adParamInput, 4, "9000"
.Parameters.Append .CreateParameter("FutureMonths", adInteger, adParamInput, 6, ln_future_months)
.Parameters.Append .CreateParameter("ForYear", adInteger, adParamInput, 6, li_for_yr)
.Parameters.Append .CreateParameter("ForMonth", adInteger, adParamInput, 6, li_for_month)
If ComboAdHocIT.Text = "No" Then
.Parameters.Append .CreateParameter("Param2", adChar, adParamInput, 1, "N"
ElseIf ComboAdHocIT.Text = "Yes" Then
.Parameters.Append .CreateParameter("Param2", adChar, adParamInput, 3, "Yes"
End If
.Parameters.Append .CreateParameter("Param3", adChar, adParamInput, 1, "N"
.Execute
End With
could anybody tell me where I am going wrong?
Thanks and Regards
rushtome
I am executing a stored procedure written in ORACLE from VB. My problem is when I am executing this procedure from back end (i.e. ORACLE), I am getting the desired output/results. But if the same procedure is executed from VB, then the output is not what is desired.
I am unable to understand where the code is going wrong.
The procedure declaration in ORACLE is as follows,
procedure process_itax_calculation
(
p_run_id in number,
p_company in char,
p_emp_no in varchar2,
p_fin_year in char,
p_it_salary_head_cd in char,
p_it_it_type_cd in char,
p_future_months in number,
p_for_year in number,
p_for_month in number,
p_adhoc_it in char,
p_it_form in char
)
is
---some code here
begin
---some code here
end;
Following is the VB call to the above procedure....
Dim cmd_it_cal as New ADODB.Command
With cmd_it_cal
.ActiveConnection = CommonModule.cnn
.CommandType = adCmdStoredProc
.CommandText = "process_itax_calculation"
.Parameters.Append .CreateParameter("RunNo", adInteger, adParamInput, 6, li_run_no)
.Parameters.Append .CreateParameter("CoCd", adChar, adParamInput, 2, GS_COMP_CD)
.Parameters.Append .CreateParameter("EmpNo", adVarChar, adParamInput, 12, rs_tt_process_emp("emp_no".Value)
.Parameters.Append .CreateParameter("FinYr", adChar, adParamInput, 16, ls_fin_year)
.Parameters.Append .CreateParameter("TDSHead", adChar, adParamInput, 4, ls_tds_head_cd) '2006
.Parameters.Append .CreateParameter("Param1", adChar, adParamInput, 4, "9000"
.Parameters.Append .CreateParameter("FutureMonths", adInteger, adParamInput, 6, ln_future_months)
.Parameters.Append .CreateParameter("ForYear", adInteger, adParamInput, 6, li_for_yr)
.Parameters.Append .CreateParameter("ForMonth", adInteger, adParamInput, 6, li_for_month)
If ComboAdHocIT.Text = "No" Then
.Parameters.Append .CreateParameter("Param2", adChar, adParamInput, 1, "N"
ElseIf ComboAdHocIT.Text = "Yes" Then
.Parameters.Append .CreateParameter("Param2", adChar, adParamInput, 3, "Yes"
End If
.Parameters.Append .CreateParameter("Param3", adChar, adParamInput, 1, "N"
.Execute
End With
could anybody tell me where I am going wrong?
Thanks and Regards
rushtome