This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: ADO Stored Procedure - Help
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 09, 2012
04:40 PM
ADO Stored Procedure - Help
I have an InstallScript custom action where I'm trying to execute a stored procedure that has an out parameter. I'm using ADO to accomplish this. This is what I have so far.
So my stored procedure has a varchar2 out parameter, and I want to get that value back after executing the stored procedure. I get an error after trying the Execute method where it says "Parameter type is not supported". I think this is in reference to the use of adVariant for VARCHAR2. I see a note saying ADO doesn't support adVariant, but that's what maps to Oracle VARCHAR2. I've tried adVarChar instead of adVariant, but then I get a generic error message instead.
Can anyone help me with the syntax for making this stored procedure call? There isn't much guidance out there for doing this in InstallShield. Thanks.
set oConn = CreateObject("ADODB.Connection");
/* I open the connection string using the Oracle ODBC driver. I've tested it and am able to execute select queries off of it and get results, so I know it works. */
set oCommand = CreateObject("ADODB.Command");
oCommand.ActiveConnection = oConn;
oCommand.CommandType = AD_CMD_STORED_PROC;
oCommand.CommandText = "myStoredProcedureName";
set oParams = oCommand.Parameters;
set oParam1 = oCommand.CreateParameter("myParam", AD_VARIANT, AD_PARAM_OUTPUT, 10);
oParams.Append(oParam1);
oCommand.Execute;
szResult = oParam1.Value;
So my stored procedure has a varchar2 out parameter, and I want to get that value back after executing the stored procedure. I get an error after trying the Execute method where it says "Parameter type is not supported". I think this is in reference to the use of adVariant for VARCHAR2. I see a note saying ADO doesn't support adVariant, but that's what maps to Oracle VARCHAR2. I've tried adVarChar instead of adVariant, but then I get a generic error message instead.
Can anyone help me with the syntax for making this stored procedure call? There isn't much guidance out there for doing this in InstallShield. Thanks.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jan 10, 2012
02:19 PM
After a lot of testing with some other stored procedures I created, I determined the data type for the number was incorrect. It should be adNumeric.