Problem of retrieve a set of data when calling store procedure using vb with ODBC

when I use ODBC, it can return 1 record (1 field) using pass and retrieve the parameter. but it cannot success when return a set of data (using recordset to store it), when i do it, the error message (Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if availabl. No work was done.). Why ? and how can solve it ?\
Thanks in advance.

oh, really ? it is not use ODBC to connecto to oracle ?
Here is my program code:
STORE PROCEDURE:
PROCEDURE getInforcePolicy(PClient_ID IN VARCHAR2, PPolicy_No IN VARCHAR2, BasicCur OUT oraoledb.m_refcur, RiderCur OUT oraoledb.m_refcur)
IS
BEGIN
OPEN BasicCur FOR SELECT * FROM
inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No = 1;
OPEN RiderCur FOR SELECT * FROM
inforce200111 WHERE Client_ID = PClient_ID and Policy_No = PPolicy_No and coverage_No <> 1;
END getInforcePolicy;
PACKAGE oraoledb AS
TYPE m_refcur IS REF CURSOR;
END oraoledb;
Program:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim cmd As New ADODB.Command
Dim paramclient As New ADODB.Parameter
Dim parampolicy As New ADODB.Parameter
Dim I As Integer
cn.Open "ridev", "abc","abc"
cmd.ActiveConnection = cn
Set paramclient = cmd.CreateParameter("PClient", adVarChar, adParamInput, 10)
Set parampolicy = cmd.CreateParameter("PPolicy", adVarChar, adParamInput, 10)
paramclient.Value = "0000023011"
parampolicy.Value = "HK0010021U"
cmd.Parameters.Append paramclient
cmd.Parameters.Append parampolicy
cmd.CommandText = "{call getInforcePolicy}"
Set rs = cmd.Execute
Do While Not rs.EOF
Loop
Set rs2 = rs.NextRecordset
Do While Not rs2.EOF
loop
Where the RIDEV is a datasource that created from Data Source in Control Panel using the driver call "Microsoft ODBC for ORACLE"

Similar Messages

  • Problem when call store procedure over a database link

    Hi all,
    I've create a database link in server "EAST" similar like:
    CREATE DATABASE LINK db_link CONNECT TO tiger IDENTIFIED BY scott USING 'abc';
    and from server "EAST" i ran the procedure located in server "WEST" somethin like:
    exec testing_procedure@db_link('test');
    testing_procedure is look like:
    Create or Replace procedure testing_procedure (p_testing in varchar2)
    as
    cursor check_space is
    select sum(bytes)/1024/1204 tb_size
    from dba_data_files;
    my_check_space%ROWTYPE;
    begin
    open check_space;
    loop
    fetch check_space into my_check_space;
    exit when check_space%NOTFOUND;
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);
    end loop;;
    close check_space;
    end;
    and my problem is when i'm run procedure from "EAST" server, the values in test_tf table is the same as when you run that procedure from "WEST" server. I've check the size for both server "EAST", and "WEST" by select sum(bytes)/1024/1204 command. And the value is completely different. And i guest somehow it reuse the value of "WEST" server no matter when you run that procedure in "EAST" server. Any suggesttion, please give me some advices.
    Thanks,
    Kevin

    If this procedure is in WEST server then even if you call it from some another planet using db link, the cursor inside the procedure will fetch the data from that server only means WEST server. So "select sum(bytes)/1024/1204 tb_size
    from dba_data_files;" statement in your procedure always fetch the size of the datafiles belongs to the WEST database.
    If you want to store the data of two different databases then you have to create the similar procedure in EAST database also.
    BTW, you said the you created a database link "db_link" in EAST database to point to WEST database and on WEST database you have that procedure BUT I don't understand why r u using "db_link" in your procdure code in WEST server in this insert statement:
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);Is there a database link on that box also?? Where it is pointing to?? And if not then this code should not be compiled.
    Daljit Singh

  • SSIS - Failure when calling stored procedure using sp_executesql

    Hi
    Newbie here so if it doesn't  make sense I apologise.
    I have an SSIS (Visual Studio 2012) package that basically gets data from tables and inserts them into staging tables.
    There are 2 containers each having 20 Execute SQL Tasks running in parallel inside and the 2nd one is failing when I try to call a stored procedure that is using sp_executesql.
    All the connections are fine as I can change the call of sp_executesql to an insert statement and it works ok.
    Property Settings for the container have TransactionOption = Required. Inside the Execute SQL's have Supported.
    Settings for the Execute SQL Tasks have the isStoredprocedure = TRUE and the procedure name is correct.
    I have tried to change the procedure name to pass in parameters etc but it seems that every time the calls hit the sp_executesql it falls over if more than 3 are called at the same time.
    Anybody got any ideas?
    Thanks in advance

    Thanks for the quick reply the error is
    failed with the following error: "The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly,
    or connection not established correctly.
    The parameters getting passed are correct as I'm using them in the Insert statement that I substituted for the sp_executesql. It looks like as soon as there is a lot of connections then it falls over. It works fine with 1 or 2 execute sql tasks but not any
    more than that.

  • I am having problems transefering contacts to my I pod when syncing the message comes back with contact in use by I pod please close and try again, please could you let me know how to close contacts on the  pod or is there a setting that is wrong etc,

    I am having problems transfering contacts to my I pod when syncing the message comes back with contacts in use by I pod please close and try again, please could you let me know how to close contacts on the  pod or is there a setting that is wrong etc, i have restored the device. if i go to contact via settings the screen comes on for about 2 seconds and then goes off - Help

    Single click on the Home button. Then double click on the Home button. In the recently used row, touch and hold the Contact app till they start to wiggle and then tap the minus sing by the contacts app.
    Also make sure the Contact program on your computer is closed.

  • Array data sporadically lost when calling stored procedure

    We have weird problem with stored procedures for which I have not been able to find an explanation so far.
    Our app has a bunch of stored procedures which process arrays of integers or strings.
    From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
    We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ?

    We have weird problem with stored procedures for which I have not been able to find an explanation so far.
    Our app has a bunch of stored procedures which process arrays of integers or strings.
    From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
    We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ?

  • My ipad's battery is going flat very quickly and is using a lot of data when I am barely using it - any suggestions?

    My ipad's battery is going flat very quickly and is using a lot of data when I am barely using it - any suggestions?

    This is likely coming from a third-party program. You can try to Reset Firefox. [[Reset Firefox – easily fix most problems]]

  • I bught a new Time Capsule 2Tb. I connected it to my internet router. I manege to set it up as base station but when i try to use it with time machine I always get the message "Check your IP addres"? What am I doing wrong? On my computer I have OSX 10.7.5

    I bought a new Time Capsule 2Tb. I connected it to my internet router. I manage to set it up as base station but when i try to use it with time machine I always get the message "Check your IP addres"? What am I doing wrong? On my computer I have OSX 10.7.5

    What IP address does the TC have and what IP does the computer have?
    We need more info as we really have no idea what your network looks like.
    Modem router, model, type of broadband?
    TC setup as bridge or router?
    Is the computer getting internet via the TC?
    Are you using wireless or ethernet?
    Have you set IPv6 correctly to local link in the computer on whichever network client is doing the connection?
    Did this work the first time for backup and has now failed? If so simply reboot the TC. It is a constant bug that the TC is lost to the network.

  • Why does my menu bar still display yesterdays time/date when i have been using it all morning?

    why does my menu bar still display yesterdays time/date when i have been using it all morning?

    Incorrect date or time displayed in various applications in Mac OS X

  • Weird Problem calling Stored Procedure using JDBC

    Scenario is..
    I have J2EE application and calling stored procedure using JDBC.
    My application connects to instance "A" of testDB.
    Schema "A" does NOT own any packages/procedure but granted execute on oracle packages/procedures that reside in schema "B" of testDB.
    In java code I call procedure(proc1) in package(pac1) which internally calls procedure(proc2) in package(pac2).
    The problem occurs when procedure pac2.proc2 is modified. After the modification, my java code fails and throws an exception "User-Defined Exception" and I am also getting "ORA-06508: PL/SQL: could not find program unit being called". This clears up only if I bounce the web container. (This doesn't happen if I modify pac1.proc1 and run my application)
    Has any one faced this problem? Please suggest if any thing can be changed in jdbc code to fix this problem.
    Thanks

    Hi,
    I assume these are PL/SQL packages and that the changes are made at the package specification level?
    If so, it looks like you are hitting the PL/SQL dependencies rules. In other words, if the spec of proc2 is changed, then proc1 is invalidated, since proc1 still depends on the old version of proc2's spec. As a result, if you try to run proc1, its spec must either be explicitly rewritten before it could run again or implicitly recompiled first, if the (implicit) recompilation fails, it won’t run.
    Kuassi http://db360.blogspot.com

  • Iphone 5 IOS 6.1.4 all sounds only play when setting up not when calls etc come in

    my iphone5 about 1 year old running IOS 6.1.4 doesn not activate any (email, voice call, messenger, etc)  notification tones, occassionally it will vibrate. I have only default ringtones on the phone. All ringtones always work fine when selecting which to use. They function loud and clear when selecting. No sound is generated for incomoing calls, emails, or messages. I am running 6.1.4 as this is a work phone and some apps are required that are not ready for IOS 7.

    Your phone is inappropriately going into pre-autolock dimming.  Try:
    1. Reset phone (no data loss): press both power and home buttons for at least 10 seconds, releasing when the Apple logo appears.
    2. Restore in iTunes using a backup
    3. Restore in iTunes as new, without a backup.
    If #3 doesn't help, there is a hardware problem that needs warranty service.
    iTunes: Restoring iOS software

  • Setting some QoS params when calling stored procedures

    Hi All,
    Can I set some QoS params when calling a stored procedure like Timeout, Connection Timeout, Retry Count, etc?
    Thanks,
    Daniel

    Since anything between your client and your data can fail(including connectivity to the ALDSP server), we recommend that you exercise retries and timeouts from the client. If you attempt to implement retries and timeouts within the XQuery - you open up several cans of worms.(mentioned later) There is a Query Attribute (in RequestConfig) that you can use to specify a timeout on the query. And you can implement retries with a loop (for, while etc).
    If you use timeout/fail-over in your query - a number of things happen. First, if something happens outside your timeout or retry - you'll miss it (i.e. if someone unplugs one of your ALDSP servers, the fail-over in your xquery is not going to help). Second, adding timeout/fail-over function calls into your XQuery blocks query optimizations - if you put a fail-over around access to a CUSTOMER table in a database, the optimizer cannot combine that with an access to the ORDER table in the same database). Third, in ALDSP 2.5, the database connections within a query are cached, so if you have Oracle RAC, and one instance goes down - the fail-over function will fail-over to the same instance (unless you create a duplicate data source for the same RAC, but with a different name).
    ALDSP does not provide means to configure retries (like ALSB does).
    You can explicitly attempt to call a stored procedure mutliple times using the fn-bea:fail-over function.
    You can also retry (in case of timeout) by using the fn-bea:timeout function.
    Note that during a single query execution, if an instance of fail-over actually fails-over - it will not bother to evaluate the primary expression again during that query execution - it will simply evaluate the secondary expression. (The idea being that if a web service is down, then it will still be down a few milliseconds later). You can contact Customer Support if you need different functionality (there is a fail-over-retry function available in a patch).
    If you are calling a replicated web-service, you can implement round-robin in a web-service handler for that web service. Ask if you want an example.

  • Problem Executing Macro from Ribbon, Runs fine when called from intermediate, or 'normal' butons

    Hi,
    I've come across a very strange problem, we've been using some fairly simple macro's within excel for the last few months, I've recently come into a strange problem.
    I decided to make things easier by putting commands onto the ribbon and creating an addin, as this code is reused by most of our workbooks, and having thousands of files with this code in seems like an awesome way to fill up our drives :)
    Basically the code seems to just ignore the saveas command when run from the ribbon, code runs, ends saying successful, in the debugger stepping over the code it appears to step over the saveas command as appears that it's been excused without fail, however
    no file gets created, workbook does not get saved and it keeps its original book<x> caption
    here's a quick example of my code, I have a class module registering application commands
    the ribbon button i'm using is just a print button, using the application print which then calls this before print function
    this is the code that fires from the ribbon, we always print out 2 copies i'm not sure if this can be simplified?
    If Application.Workbooks.Count = 0 Then Exit Sub
    If CheckRangeExists("BVSID") = 1 Then
    ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, IgnorePrintAreas:=False
    End If
    Using CTRL P or File Print this works fine, BeforePrint triggers each time, but within Save Invoice it calls the Application.SaveAs function, when this print is fired from the ribbon this simply seems to get ignored
    Private Sub App_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As Boolean)
    'check worksheet belongs to bvs plugin
    If CheckRangeExists("BVSID") = 1 Then
    'code to save
    If SaveInvoice = 0 Then Cancel = True
    End If
    End Sub
    incase there is something weird i'm missing, this is the line that throws up no errrors, simply doesn't work, more annoyingly the SaveInvoice function returns no error, which in turn prints out the document, and its only until after you check for the file
    you would realise it didn't save, I've since put a check in to check the file has saved, so far everysingle time it does not save from the ribbon, pressing CTRL P or clicking File Print will always save the file?
    ActiveWorkbook.SaveAs Filename:=Path & Range("Invoice").Value & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    before I have Application.DisplayAlerts = False and after Application.DisplayAlerts = True
    As the code is within an Addin my probably overly basic idea is to create a hidden range with the name BVSID, with the idea the events only fire with the sheets I've created
    Finally, If I type the
    ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, IgnorePrintAreas:=False
    in the debug window the code also runs, triggers the before print and saves the files
    any help would be most appreciated :)

    Thanks for the time!
    it works fine when using the normal print button on the custom ui, its when using a macro combined with
    ActiveWindow.SelectedSheets.PrintOut
    I've just created a blank workbook, with a class module to capture the before print, I've put 2 buttons on the custom ribbon, one using the default command, and the other to call a macro to reference the printout command
    before print gets activated on both tries, however the saveas command gets ignored, seems to run, but not do anything when called using the .PrintOut command.
    Here's the code I've used to test
    This Workbook code
    Private XLApp As CExcelEvents
    'set applications to be avaliable in the cexcelevents class module
    Private Sub Workbook_Open()
    Set XLApp = New CExcelEvents
    End Sub
    Module for custom button (not actually sure if this needs to be in a module but this is to mimic the same behaviour i'm getting with the addin
    Sub PrintInvoice(control As IRibbonControl)
    ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, IgnorePrintAreas:=False
    End Sub
    Class Events CExcelEvents
    'get application events
    Private WithEvents App As Application
    Private Sub App_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As Boolean)
    ActiveWorkbook.SaveAs "C:\Test\Book1_Copy.xlsm", XlFileFormat.xlOpenXMLWorkbookMacroEnabled
    End Sub
    Private Sub Class_Initialize()
    Set App = Application
    End Sub
    Private Sub Class_Terminate()
    Set App = Nothing
    End Sub
    CustomUI Code
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon startFromScratch="false">
    <tabs>
    <tab id="customTab" label="Custom Tab">
    <group id="customGroup" label="Custom Group">
    <button idMso="FilePrint" imageMso="FilePrint" size="large"/>
    <button id="btnPrint" label="Print" imageMso="FilePrint" size="large" onAction="PrintInvoice" supertip="Saves Invoice Then Prints to Default Printer" enabled="true"/>
    </group>
    </tab>
    </tabs>
    </ribbon>
    </customUI>
    the button id btnprint is what I've been testing with so I copy pasted that button from the customui code I had
    I can't see away to add the workbook as an attachment, if needed I can upload it here too, this workbook was just created from scratch just incase its the addin I've got making some weird error

  • How to set the root path of XML document when calling Inserting procedure

    Hi,
    I was create a procedure to insert XML Document in to DBMS Tables, but i am not able to set the Start root element in calling procedure.
    My calling procedure is
    exec insXmldoc('pmc_sample.xml', 'pmc')
    When i am calling this procedure i got this error
    11:23:54 Error: ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 8
    ORA-06512: at line 2
    I am checking my XML file using XML Validator. My XML file was parsed with out errors.
    Please give the solution,and tell me where i did wrong in my calling procedure.
    suppose i have this XML file in local E drive ,how to set the path for that XML file in my calling procedure.

    Hi, I am doing the code likthis,please give the solution.
    SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    2 insCtx DBMS_XMLSave.ctxType;
    3 l_ctx dbms_xmlsave.ctxtype;
    4 rows number;
    5 begin
    6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    9 end;
    10 /
    Procedure created.
    SQL> begin
    2 insProc('/usr/tmp/ROWSET.xml', 'emp');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 7
    ORA-06512: at line 2
    Kishore B

  • Set TECO automatically when assembly scrap is used

    Hi Experts,
    could any of You help me pls with a mass processing of TECO status, when using assembly scrap at material master?
    In my scenario we use COHV / PPIO_ENTRY as a background job for mass process and set TECO each night - worked well till no assembly scrap was set and used.
    When assembly scrap is maintained at material master, we have a total order qty, a planned scrap and the output qty in prd order.
    When cnf is made for prd order, and reached the planned output qty I expected the same as before: automatic TECO set  - but it is not. The system still expect the total order qty to be reached - but we only go for the output qty. So when  cnf qty = to output the status should be set - if scrap is lower than the planned scrap figures the order is not technically closed by the PPIO_ENTRY backgroung job.
    Anyone pls support me with an idea, how to handle this situation, and set TECO automatically when cnf qty equals to expected output, pls?
    Answers will be appreciated

    dear friend,
    can you please look at checkbox "Generated Confirmations w/o Quantity Adjustments" in OPK4 for your plant/order type?
    do you have it 'ON' ?
    regards,

  • I always lose data when i read continous using serial

    I am developping a application, using serial communication for data
    acquisition.
    This serial read data continuous.but when i click on the graph or made
    a zoom i lose data in that interval ...
    What can i do

    If I understand correctly what you're saying, there is a gap in you data when you click on the graph, or zoom in on it. If you have the acquisition and the graph in the same loop, you could be essentially pausing or slowing down the loop while you are interacting with the graph. I've never noticed this effect before myself, but it is possible.One solution might be to put the acquisition process in a seperate loop and pass data to the loop containing the graph in something like a queue.Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for

  • SmoothCam: FCP7 or Snow Leopard or QTX or combo to blame?

    I have done several searches on the topic but It is not clear as to the specific root of the jitter issue - I read several users with OS 10.5+ are OK with FCP7 so it appears that the problem is SL/QTX??? Does SmoothCam in FCP6 work OK with SL? My rea

  • Acrobat 9 pro installation

    After installing Acrobat 9 pro (on mac osx), when I try to launch the program, I get the message "an internal error has occurred."  I have tried shutting down all applications including firewall before installation. I have no other versions of acroba

  • Import of DDL with data modeler

    Hello, I begin to use the data modeler of sql developer. I create un relational model with constraints about range and values list. Then I generate the corresponding DDL : -- Generated by Oracle SQL Developer Data Modeler Version: 2.0.0 Build: 584 --

  • C3750 & WCCP redirection

    Hi all, I am trying to setup a web cache using a WAE-612 and a C3750 switch. The switch is configured with three interfaces: CLIENTS ----- VLAN 1 ----- SWITCH ----- GI1/0/1 routed ---- SERVER(s)         WAE-ENGINE ---- VLAN2--| I have configured inbo

  • Firefox doesn't open with any extension switched on

    Hi, my firefox crashes with any extension turned on. I can open it in safe mode. But turning on any of extensions is causing firefox crash on open. Actually is just doesn't open at all without any reports. Firefox 3.6.3 at MacOS 10.6.3.