Deleting records from sys.aud$ from stored procedure

We have a stored procedure that is trying to move records from the sys.aud$ table to a historical table (in an attempt to keep sys.aud$ to a more manageable size, I guess -- full disclosure I did not write this proc). The basic flow is:
select count(*) into rowcount from sys.aud$
if (rowcount > 1000) {
copy all rows from sys.aud$ to historical table
delete from sys.aud$
I am told this proc used to work just fine in the murky past (I am new to the client) but has now not worked for some time. When we try and compile the proc, we get the error
"table or view does not exist," and the highlighted line is the "delete from sys.aud$". The "select count(*) from sys.aud$" line appears to cause no issue, but the proc will not compile as is. If I comment out the "delete from sys.aud$" line, however, the proc compiles just fine.
Confusingly, if I log in as the same account that owns this proc, I can run both the select count(*) from sys.aud$ AND delete from sys.aud$ clauses with no complaints at all (altering slightly to work with only 1 record at a time, of course), but I cannot get the same to compile within a stored proc.
I assume this is permissions related? Can anyone point me to the permissions the owner requires to be able to delete from sys.aud$ within a stored procedure? Or is there something else that needs to be done here? Any pointers much appreciated.
Thanks.

956928 wrote:
We have a stored procedure that is trying to move records from the sys.aud$ table to a historical table (in an attempt to keep sys.aud$ to a more manageable size, I guess -- full disclosure I did not write this proc). The basic flow is:
select count(*) into rowcount from sys.aud$
if (rowcount > 1000) {
copy all rows from sys.aud$ to historical table
delete from sys.aud$
I am told this proc used to work just fine in the murky past (I am new to the client) but has now not worked for some time. When we try and compile the proc, we get the error
"table or view does not exist," and the highlighted line is the "delete from sys.aud$". The "select count(*) from sys.aud$" line appears to cause no issue, but the proc will not compile as is. If I comment out the "delete from sys.aud$" line, however, the proc compiles just fine.
Confusingly, if I log in as the same account that owns this proc, I can run both the select count(*) from sys.aud$ AND delete from sys.aud$ clauses with no complaints at all (altering slightly to work with only 1 record at a time, of course), but I cannot get the same to compile within a stored proc.
I assume this is permissions related? Can anyone point me to the permissions the owner requires to be able to delete from sys.aud$ within a stored procedure? Or is there something else that needs to be done here? Any pointers much appreciated.
Thanks.privileges acquired via ROLE do NOT apply within named PL/SQL procedures.
GRANT DELETE ON SYS.AUD$ TO <your_schema>;

Similar Messages

  • Sys Tables In Stored Procedure

    How can I use Sys Table in Stored Procedure.
    I want to use DBA_TAB_COLOUMNS, in stored procedure.
    When I used this table in stored procedure I got an error
    ORA - 00942 Table or View Does not exists.
    Thanks,
    Ahamed

    From http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_packages.htm#i1006224
    >
    Note:
    To create without errors (to compile the procedure or package successfully) requires the following additional privileges:
    The owner of the procedure or package must be explicitly granted the necessary object privileges for all objects referenced within the body of the code.
    The owner cannot obtain required privileges through roles.
    >
    You need to run
    grant select on dba_tab_columns to <owner of procedure>;

  • How to get multiple out parameters from a pl/sql stored procedure in ADF Jdeveloper 11g release2

    I´m trying to call from AppModuleImpl a stored procedure from my oracle DB which receives one input parameter and returns 5 out parameters. 
    I´m using jdeveloper 11g release2  ADF and I have created a java bean "ProRecallPlatesBean " with the atributes and accesors and I serialize it. just like in this article http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvgen.htm#sm0297
    This is my code so far:
    public ProRecallPlatesBean getCallProRecallPlates(String numPlates) {
    CallableStatement st = null;
    try {
              // 1. Define the PL/SQL block for the statement to invoke
              String stmt = "begin CTS.Pk_PreIn.proRecallPlates(?,?,?,?,?,?); end;";
              // 2. Create the CallableStatement for the PL/SQL block
              st = getDBTransaction().createCallableStatement(stmt,0);
              // 3. Register the positions and types of the OUT parameters
              st.registerOutParameter(2,Types.VARCHAR);
    st.registerOutParameter(3,Types.VARCHAR);
    st.registerOutParameter(4,Types.VARCHAR);
    st.registerOutParameter(5,Types.VARCHAR);
    st.registerOutParameter(6,Types.VARCHAR);
    // 4. Set the bind values of the IN parameters
    st.setString(1,numPlates);
    // 5. Execute the statement
    st.executeUpdate();
    // 6. Create a bean to hold the multiple return values
    ProRecallPlatesBean result = new ProRecallPlatesBean();
    // 7. Set values of properties using OUT params
    result.setSpfVal(st.getString(2));
    result.setTransportTypeVal(st.getString(3));
    result.setTransportCompanyVal(st.getString(4));
    result.setCompanyDescrVal(st.getString(5));
    result.setDGAPrint(st.getString(6));
    // 8. Return the result
    return result;
    } catch (SQLException e) {
    throw new JboException(e);
    } finally {
    if (st != null) {
    try {
    // 9. Close the JDBC CallableStatement
    st.close();
    catch (SQLException e) {}
    In Jdeveloper I went into AppModule.xml JAVA>Client Interface section and expose "getCallProRecallPlates" Then I can see "getCallProRecallPlates" in Data Controls, I drag and drop it to a JSF page, an input text component and a button are generated in order to put in there the procedure input parameter (numPlates).
    I don't know if I'm on the right track.
    When I click the button, the "result" variable is supposed to be filled with data from the stored procedure. I want each of those values to be displayed in Output text or input text adf components but I dont know how. Thank you very much in advance I´m a newbie and i'll appreciate your help!

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • Passing collection parameters from/to Oracle 8i stored procedure to/from Weblogic java program

    Environment- Oracle DB 8.1.7 (Sun) - JDBC OCI 8.1.7 - Application Server (WebLogic 6.0 or 6.1)QuestionHow to pass oracle collection data types from PL/SQL stored procedures to Weblogic java program as in/out stored procedures parameters. I am hitting oracle error 2006 unidentified data type trying to pass the following data types:-o java.sql.Structo java.sql.Arrayo oracle.sql.STRUCTo oracle.sql.ARRAYo oracle.jdbc2.Structo oracle.jdbc2.Arrayo any class implemented oracle.jdbc2.SQLData or oracle.sql.CustomDatumInformationAbout PL/SQL stored procedure limitation which only affects the out argument types of stored procedures calledusing Java on the client side. Whether Java methods cannot have IN arguments of Oracle 8 object or collection type meaning that Java methods used to implement stored procedures cannot have arguments of the following types:o java.sql.Structo java.sql.Arrayo oracle.sql.STRUCTo oracle.sql.ARRAYo oracle.jdbc2.Structo oracle.jdbc2.Arrayo any class implemented oracle.jdbc2.SQLData or oracle.sql.CustomDatum

    this is becoming a mejor problem for me.And are you storing it as a blob?
    Oracle doesn't take varchars that big.
    And isn't LONG a deprecated field type for Oracle?
    From the Oracle docs......
    http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10759/sql_elements001.htm#sthref164
    Oracle strongly recommends that you convert LONG RAW columns to binary LOB (BLOB) columns. LOB columns are subject to far fewer restrictions than LONG columns. See TO_LOB for more information.

  • Applying an XSLT against results from XSU in Java Stored Procedure

    Is there an easy way to have a Java Stored Procedure apply an XSLT against the results of an OracleXMLQuery? The only examples I can find are with regular Java code outside the database.
    I'm running 9.2.0.2 on Windows 2000 Server.

    This is what I use:
    (I have table called params where I have stored encodinf, XSL, and stuff like that)
    DOMParser parser;
    XMLDocument xml, xsldoc, outXML;
    URL xslURL;
    URL xmlURL;
    Connection conn = getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rset= stmt.executeQuery("select xsl_varchar2,encoding,version,host,port,host_path,usrnm,passwrd from params");
    rset.next();
    String strXSL=rset.getString(1); //This is XSL transformation
    String strEncoding=rset.getString(2);
    String strVersion=rset.getString(3);
    rset.close();
    stmt.close();
    parser = new DOMParser();
    parser.setPreserveWhitespace(true);
    StringReader rXSL= new StringReader(strXSL);
    xslURL=createURL("test");
    parser.parse(rXSL);
    xsldoc=parser.getDocument();
    OracleXMLQuery qry = new OracleXMLQuery(conn, "select * from somewhere");
    xml=(XMLDocument) qry.getXMLDOM();
    // instantiate a stylesheet
    XSLStylesheet xsl = new XSLStylesheet(xsldoc, xslURL);
    XSLProcessor processor = new XSLProcessor();
    // display any warnings that may occur
    processor.showWarnings(true);
    processor.setErrorStream(System.err);
    // Process XSL
    DocumentFragment result = processor.processXSL(xsl, xml);
    // create an output document to hold the result
    outXML = new XMLDocument();
    outXML.setVersion(strVersion);
    outXML.setEncoding(strEncoding);
    outXML.appendChild(result);
    outXML is your XML.

  • URGENT: Passing Array from JSP to a Stored Procedure

    Hi,
    Can some one please help me understanding how can I pass array from JSP page to a stored procedure in database.
    Thanks in advance.
    Jatinder

    Thanks.
    I tried ArrayExampla.java and was successful in passing array values to the stored database procedure.
    How can I use this class in JSP? Like I have first JSP where in I will collect input from the user and then submit it to the second JSP - that needs to call the ArrayExample.java to pass the values as array to the database.
    How should I call this java code in my second JSP?
    Thanks in advance.

  • Select from sys table in package procedure

    Is it possible to use a table in the SYS schema in a procedure defined in a package?
    Right now, these errors are raised:
    SQL> SHOW ERRORS PACKAGE BODY App_security_context;
    Errors for PACKAGE BODY APP_SECURITY_CONTEXT:
    LINE/COL ERROR
    17/3 PL/SQL: SQL Statement ignored
    18/8 PLS-00201: identifier 'SYS.DBA_ROLE_PRIVS' must be declared
    eg)
    CREATE OR REPLACE PACKAGE App_security_context IS
         PROCEDURE Set_restrictions;
    END App_security_context;
    CREATE OR REPLACE PACKAGE BODY App_security_context IS
    PROCEDURE Set_restrictions
    IS
    data_code VARCHAR2(16);
    BEGIN
    SELECT MD_SYS_USER_DATA_CODE.code_id INTO data_code
    FROM
    MD_SYS_USER_DATA_CODE
    , SYS.DBA_ROLE_PRIVS
    WHERE SYS.DBA_ROLE_PRIVS.grantee = SYS_CONTEXT('USERENV', 'SESSION_USER')
    AND SYS.DBA_ROLE_PRIVS.granted_role = MD_SYS_USER_DATA_CODE.role_id;
    DBMS_SESSION.SET_CONTEXT('app_entry', 'data_code', data_code);
    END Set_restrictions;
    END App_security_context;

    You need the select grant on the SYS view granted directly to you - not through a role. See here for more details:
    http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.html

  • How to see deleted records in delta extraction from view

    Hi folks,
    i am currently reflecting about delta extraction from a view:
    The view contains a date field (change date) which is used to identify new or changed records.
    So the delta extraction of new and changed records works without problems.
    But what is happening with records that are deleted in the source system?
    My current understanding is that deleted records will not be shown in the view. Therefore the deletion is not visible in the extraction.
    - Is there a workaround for this problem?
    - How is deletion of records normaly handled in generic extractors? 
    - Is it impossible to extract a deletion when using views?
    any suggestions and help will be appretiated...
    bye

    Hello Florian,
    Generally records will not be deleted (until if you physically delete it from table) but will have a status deleted.
    So it doesn't matter whether you use view or tables the deleted records will be extracted through the view to update the BW data targets.
    Thanks
    Chandran

  • Retrive a new sequence value from a table using Stored Procedure

    Dear experts
    i have written the following stored procedure, but i want this to return itemid to the environment. Please help as i am absolutely new to oracle.
    create or replace procedure "SP_ITEMS"
    (vitem IN VARCHAR2,
    vqty IN NUMBER,
    vrate IN NUMBER)
    is
    begin
    INSERT INTO ITEMS (item,qty,rate)
    VALUES (vitem,vqty,vrate);
    end;
    Thanks
    With regards
    Manish Sawjiani

    If you want a column to be automatically populated with a sequence, then you need to create a sequence, and create a trigger to populate the column with the sequence. You can use the returning clause in a select statement to return the value of the inserted sequence. You can do this with just sql or you can put it in a procedure. I have demonstrated both below. This is a general sql and pl/sql problem, not something specific to the Express Edition, so please post future such questions in the sql and pl/sql discussion group instead.
    SCOTT@10gXE> CREATE TABLE items
      2    (itemid NUMBER,
      3       item   VARCHAR2 (50),
      4       qty    NUMBER (10, 3),
      5       rate   NUMBER (10, 3))
      6  /
    Table created.
    SCOTT@10gXE> CREATE SEQUENCE item_sequence
      2  /
    Sequence created.
    SCOTT@10gXE> CREATE OR REPLACE TRIGGER items_bir
      2    BEFORE INSERT ON items
      3    FOR EACH ROW
      4  BEGIN
      5    SELECT item_sequence.NEXTVAL
      6    INTO   :NEW.itemid
      7    FROM   DUAL;
      8  END items_bir;
      9  /
    Trigger created.
    SCOTT@10gXE> SHOW ERRORS
    No errors.
    SCOTT@10gXE> VARIABLE g_itemid NUMBER
    SCOTT@10gXE> INSERT INTO items (item, qty, rate)
      2  VALUES ('item1', 2, 3)
      3  RETURNING itemid INTO :g_itemid
      4  /
    1 row created.
    SCOTT@10gXE> PRINT g_itemid
      G_ITEMID
             1
    SCOTT@10gXE> CREATE OR REPLACE PROCEDURE sp_items
      2    (p_item      IN  VARCHAR2,
      3       p_qty      IN  NUMBER,
      4       p_rate      IN  NUMBER,
      5       p_itemid OUT NUMBER)
      6  AS
      7  BEGIN
      8    INSERT INTO ITEMS (item, qty, rate)
      9    VALUES (p_item, p_qty, p_rate)
    10    RETURNING itemid INTO p_itemid;
    11  END sp_items;
    12  /
    Procedure created.
    SCOTT@10gXE> SHOW ERRORS
    No errors.
    SCOTT@10gXE> EXECUTE sp_items ('item2', 3, 4, :g_itemid)
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> PRINT g_itemid
      G_ITEMID
             2
    SCOTT@10gXE> SELECT * FROM items
      2  /
        ITEMID ITEM                                                      QTY       RATE
             1 item1                                                       2          3
             2 item2                                                       3          4
    2 rows selected.
    SCOTT@10gXE>

  • Disconnected rowset CachedRowSet from a select inside stored procedure?

    Hello everyone
    I am using CachedRowSet returning it from a parameterised select statement and it works fine.
    If I put the same select statement into a simple read-only stored procedure then I get this exception: "A result set was generated for update".
    I am not trying to update the rowset in my code.
    I tried to make the CachedRowSet to be read-only but it does not help, same error.
    Question 1 : can a stored procedure returning a single result-set be called to populate a read-only CachedRowSet? (in a similar fashion to a CallableStatement prepareCall method with input/output parameters).
    Question 2: in general is using CachedRowSet, WebRowSet, FilteredRowSet (disconnected) and JDBCRowSet (connected) something to be encouraged for future develpment or are they deprecated, or replaced by something else/better??
    thank you very much in advance

    Thank you for the initial bite.
    This is for Microsoft SQL Server 2008 using Microsoft JDBC driver, type 4.0.
    The T-SQL stored procedure has a single select statement in it - see inside code.
    Below is the Java 6 source code (including the Java import statements, many unused at the moment), apologies for poor indendation, its a cut and paste problem.
    // start of Java code
    import java.io.*;
    import java.sql.*;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import com.microsoft.sqlserver.jdbc.*;
    import com.microsoft.sqlserver.jdbc.SQLServerDriver.*;
    import com.microsoft.sqlserver.jdbc.SQLServerDriver;
    import java.math.BigDecimal;
    import com.sun.rowset.CachedRowSetImpl;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.sql.Connection;
    import java.sql.Date;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.sql.Timestamp;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    import java.util.HashMap;
    import javax.sql.rowset.CachedRowSet;
    import javax.sql.rowset.spi.SyncProviderException;
    import javax.sql.rowset.spi.SyncResolver;
    public class JdbcRowSetTesting
    public static void main(String[] args)
      String connectionUrl =
      "jdbc:sqlserver://ABCDE-SERVER:1433;" +
       "databaseName=SecurityTransaction;integratedSecurity=false;user=somedbuser;password=somesortofpassword";
      Connection conn = null;
      Statement sqlstmt = null;
      ResultSet rs = null;
      CachedRowSet crs = null;
       try
      conn = DriverManager.getConnection(connectionUrl);
      System.out.println("inside try block, connected");
      conn.setAutoCommit(false);
      crs = new CachedRowSetImpl();
      crs.setUrl(connectionUrl);
      crs.setReadOnly(true);
      crs.setType(ResultSet.TYPE_FORWARD_ONLY);
      crs.setConcurrency(ResultSet.CONCUR_READ_ONLY);
      System.out.println("inside try block, connected to CachedRowSet URL"); 
    // this works fine:
      crs.setCommand("select ADDRESSID, COUNTRY, POSTCODE, STATE, ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, CREATEDBY, CREATEDDATE, UPDATEDBY, UPDATEDDATE from dbo.address where ADDRESSID > ?;");
    -- this does not work - the SP has  the same SELECT as above inside it:
      crs.setCommand("{ call dbo.p_testCachedJDBCRowSet (?) }");
      crs.setInt(1, 10);
      crs.execute();
       while (crs.next())
      System.out.println("" + crs.getInt("ADDRESSID") + " " +
      crs.getString("ADDRESS1"));
       catch (Exception e)
      System.out.println("inside catch block, calling Exception printStackTrace(); method now:");
      e.printStackTrace();
       finally
      System.out.println("inside finally block");
       if (rs != null) try { rs.close(); } catch(Exception e) { e.printStackTrace(); }
       if (sqlstmt != null) try { sqlstmt.close(); } catch(Exception e) { e.printStackTrace(); }
       if (conn != null) try { conn.close(); } catch(Exception e) { e.printStackTrace(); }
    return;
    // end of Java source code

  • Invoke/Return Dataset from WebService in CLR Stored Procedure

    Hello,
    I am running SQL Server 2008 R2 or 2012 and Visual Studio 2010 Premium sp1. I have a stored procedure which currently returns a dataset which is used via SQLDataReader within a C# code-behind module in an ASP.NET application. This application uses the .NET
    4.0 framework. 
    I need to join the results from an external webservice (but within the same network) to this dataset. Instead of getting the data and putting it into a data table in code-behind (probably a HashTable which I could join with key/value pairs), I would like
    to get all of the data in the same stored procedure. I was thinking I could invoke the webservice and pass the input parms to the webservice then put the results into a temp table which I could then join with the query to the physical table.
    So, I have done quite a bit of researching online but have been unable to find any definitive answer or solution. I read the related forum thread "CLR Stored procedure consume webservice" but this does not address my versions of SQL Server / .NET
    framework.
    If someone could offer any suggestions or point in the right direction I would greatly appreciate it. Perhaps what I am trying to do is simply not possible?
    Regards,
    Buster

    Hello,
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    Fanny Liu
    TechNet Community Support

  • Get error message from a nested/encrypted stored procedure

    Hi,
    I have an encrypted procedure, that is used inside my 'own' complex procedure as:
    Begin try
    Begin tran
    Do a lot
    insert into #tmp exec xp_encryptedSP
    Do a lot more
    commit tran
    end try
    begin catch
    print ERROR_MESSAGE()
    rollback tran
    end catch
    Some error occur on the insert into #tmp exec xp_encryptedSP row, and in this case it's correct that the error occur, but:
    If I run only exec xp_encryptedSP in query analyzer, I can see the root cause error message,
    but in my complex procedure all I get is:
    Cannot use the ROLLBACK statement within an INSERT-EXEC statement.
    I have tried to enclose the insert into #tmp exec xp_encryptedSP in an own try block, but all I get is the message above.
    Please help
    /Magnus
    Magnus Burk

    No, the error message has nothing to do with the fact that the procedure obfuscated. It is a limitation of INSERT-EXEC. A quite silly one, since a consequence of the error is that the transaction is rolled back...
    There are better ways to share data between stored procedures, but most of them assumes that you can change the procedure you call, and obviously this is not possible since this is a vendor procedure.
    So it looks like you are in for heavy artillery, that is the CLR. See here for an example:
    http://www.sommarskog.se/share_data.html#CLR
    I should warn you in advance that error handling when the CLR is involved is also a very difficult thing.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How do you send a date from java to a stored procedure

    Oracle 8.0.5
    using thin drivers
    I'm trying to pass a date to a stored procedure. Does anybody
    have an example of how to do this.
    I want to send a month-day-year 01/01/1999 to oracle to be
    inserted into the table. what should the java code look like?
    and what should the (in) line look like in oracle.
    Thanks
    Kirk
    null

    Wow. You got me there.  All of the pdfs that i have, when i tap that icon, open a drop down window with the choices of e mail or print.  I wonder if the particular pdf you are working on is somehow protected?  Try a different pdf and see if the box recats the same way.   You might also do a full shut down and just try again.  Make sure there is not an old instance of i books, or some other pdf editor sitting in the task bar, by doblue clicking the home button, and shutting down any open apps.

  • How can I pass a BLOB parameter 32K from VB to a stored procedure?

    I am using Visual Basic 6 and the Oracle database 10g to call stored procedures. I am passing a XML input parameter to this stored proc. This variable has been defined as BLOB in stored proc and as XMLType in the table to which it finally gets stored through procedure.
    But there seems to be a limit to the size of a parameter you can pass in. This seems to be 32K!!! It works fine as long as my input is < 32k but once it becomes > 32k, Oracle gives the following error:-
    "ORA-01460: unimplemented or unreasonable conversion requested"
    I searched on net and found lots of examples for a workaround with .Net (using OracleLob). For Vb6, the only examples I found were using AppendChunk method etc through a loop, where each call will insert 32k chunk. But, that would mean lots of calls to stored proc, as we need to do this for thousands of files and each file of size > 100k.. So, this method would not be acceptable.
    Can someone please help me with this.

    Mofizur,
    You can achieve the same using Session variable.
    If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    Note - You have a few of the threads left open, mark it as answered if solved.
    Regards,
    Gyan

  • How to determine number of records in recordset returned by stored procedure?

    In TestStand 3.0 I am calling an SQL stored procedure where the stored
    procedure returns a recordset. Everything appears to work (I can
    iterate through the recordset and see that the data is valid).
    However, I can not figure out how to easilly determine how many
    records are actually in the recordset. Unlike the 'Open SQL
    Statement' step, in the 'Data Operation' step that actually invokes
    the stored procedure, there is no 'Number of Records Selected' option
    to specify a TestStand variable to accept this value. I know I could
    iterate through the returned recordset incrementing a counter until a
    Fetch fails, but for larger recordsets, traversing the table multiple
    times would be quite time consuming
    . I am hoping to avoid this if
    possible. Is there an easier way to get the number of records in a
    recordset returned from a stored procedure call?
    Bob

    Bob -
    The cursor type of the ADO Recordset object affects whether the number of records can be determined. The Recordset.RecordCount property will return -1 for a forward-only cursor; the actual count for a static or keyset cursor; and either -1 or the actual count for a dynamic cursor, depending on the data source.
    Because ADO does not let me set the cursor type for command objects which is what a stored procedure requires, it is up to the data source to determine the type of cursor and the support for record count.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

Maybe you are looking for

  • Can not install iTunes on Windows &

    Ok I got a new eMachine the other day to replace my old out of date PC. I can download iTues but when I double click the installer nothing happens. It did ask me if I trusted the source of the download and I said I did but then nothing happens. I ran

  • Change colors in pasted layer

    Would like the procedure for colorizing only the layer pasted into an image. Want to adjust colors in the new layer to more nearly harmonize with colors in the rest of the image. The usual adjustment layers want to adjust both the new layer and the h

  • Non - interactive PDF form needs to be typed in

    I have a PDF form, non-interactive, which I would like to type the answers into. Easiest and most effective way to do this? Thanks, Jay

  • Java files included in exploded folder

    When i compile weblogic platform 8.1 sp4 as an ear.exploded, why are the *.java files included in the output dir? Can this be a reason as to why i keep getting a java.lang.OutOfMemoryError? that there is too much to cache in the memory?

  • Repository Browswer

    In my ABAP Program I am trying to "Display Object List  CTL +SHIFT +F5" I do have the Parameters defined in my program. In the repository browswer I am not seeing the SCREEN Object. Any idea? parameters FName(20) type c default 'XYZZ'..