Originally posted by: bits
lpCommand->Parameters->Item[_variant_t((long)2)]->Direction = adParamOutput;
_CommandPtr lpCommand;
_variant_t varLiReturn;
int liReturn = -99;
_bstr_t CmdText("p_distribute_ticket");
const char* szSQL = "call_ticket_00001";
try{
if (IsConnectClose())
return -1;//test connection lpCommand.CreateInstance(__uuidof(Command));
lpCommand->ActiveConnection = *mpConnection;
lpCommand->CommandText = CmdText;
lpCommand->CommandType = adCmdStoredProc;
lpCommand->Parameters->Item[_variant_t((long)1)]->Value = _variant_t((LPCTSTR)szSQL);
lpCommand->Parameters->Item[_variant_t((long)1)]->Direction = adParamInput;
lpCommand->ExecuteNULL,NULL,adCmdUnknown);
lpCommand->Parameters->Item[_variant_t((long)2)]->get_Value(&varLiReturn);//get the output return here
liReturn = varLiReturn.intVal;
return 0;
}
catch( _com_error )
{
ReportError(ErrFormTanslation);
return FALSE;
}
catch(...)
{
cout<<"Error while executing the Import"<<endl;
}
Originally posted by: liu kunling
I can use the procedures in ado with input paramenters.
but I can not receive the procedures's return value in ado
For example :
the procedure is:
create procedure lklcount
@k_1 int,
@k_2 int,
@k_value int OUTPUT
AS
select @k_value=@k_1*@k_2
Problems:
How can I get the return value in vc++ with ADO.
Thank You!!
Originally posted by: Saami Masoud
My problem is,
I have a StoredProcedures on Oracle as
/////////////////////////////////////////
PACKAGE TEST$PA_types
IS
TYPE db_return IS RECORD
(
elapsed NUMBER
);
....
....
END;
FUNCTION db_select (
i_ID IN NUMBER,
o_TEXT1 OUT VARCHAR,
)
RETURN TEST$PA_types
IS
....
...
END;
/////////////////////////////////////////
THE RETURNVALUE is an userDefined Strukture.
Ask (1)
How can I read the the ReturnValue???
Ask (2)
How can I ignore the the ReturnValue???
Originally posted by: Glenn
-glennc
Although the syntax is extremely convenient, the .Refresh() method should be avoided in most situations. The call results in multiple round trips to the SQL Server system tables (syscolumns in particular) in order to provide datatype/size values required to build an actual parameter. It is generally OK to make this trade-off in situations where the sp will be called infrequently.
Originally posted by: Andy Liang
Hi,
I'll try to use it in our program and respose to you if I have any problem.
Andy Liang
ReplyOriginally posted by: Prasanth
Thanks a lot. How about using the createParameters way
cheers
Prasanth
Originally posted by: Mohan
I would be intersted in learning about a Unified Way of invoking stored procs and getting their resultset. I want to see how this could be done in javascript and see how this could be extended to other scripting languages like VBScript, pearl.
Thanks in advance
Mohan
Hi,
Originally posted by: Anand Mohanram
Hi
I saw your article in Codeguru and tried to connect to an Oracle Stored Procedures from my VC++ 6.0 application. But I am having some problems with the input parameters.
My Stored procedure takes an integer and a CString.
How do I do this ?
Thanks
Anand
Originally posted by: Kathy
Hi,
I have tried using your code with Oracle, and am having problems with things like specifying the input parameters.
Has anyone had any success calling Oracle Stored procedures?
Thanks.
ReplyOriginally posted by: Paul
How can you specify a keyset or dynamic cursor?
Reply