"invalid name pattern"  when trying to user packaged TYPE

Hi,
I have problem with creating ArrayDescriptor instance of packaged DB TYPE.
There is declared TYPE
   type OBJ_ARRAY_TYPE is table of number(30)
in a DB package specification,
when i try to create description through jdbc, it fails on "java.sql.SQLException: invalid name pattern: PKG_NAME.OBJ_ARRAY_TYPE":
   desc = ArrayDescriptor.createDescriptor ("PKG_NAME.OBJ_ARRAY_TYPE", conn);
When OBJ_ARRAY_TYPE defined globally, outside the package, everything works fine. Is it limitation of JDBC(classes12.jar)/OracleDB9i not to allow using packaged types?
Thx for any suggestion.

I have same hiccup with 10g JDBC Driver (ojdbc14.jar) and 9i Database.
Test Case: Create the package with the type and a procedure that use this type as OUT parameter. Create a java application to invoke this procedure and consume the type.
Steps:
Create following package.
CREATE OR REPLACE PACKAGE test_type AS
  type avarchartabletype IS TABLE OF VARCHAR2(256) INDEX BY binary_integer;
  PROCEDURE getvcttdata(avcttdata OUT avarchartabletype,   irows IN OUT INTEGER);
END test_type;
CREATE OR REPLACE PACKAGE BODY test_type AS
  PROCEDURE getvcttdata(avcttdata OUT avarchartabletype,   irows IN OUT INTEGER) AS
  BEGIN
    FOR i IN 1 .. irows
    LOOP
      avcttdata(i) := 'Yo ' || i;
    END LOOP;
  END getvcttdata;
END test_type;2. Try to execute the above procedure using following Java code:-
public class TestType {
     public static void main(String[] args) throws Exception {
          java.sql.DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
          java.sql.Connection con = java.sql.DriverManager.getConnection(args[0],
                    args[1], args[2]);
          oracle.jdbc.driver.OracleCallableStatement stmt = (oracle.jdbc.driver.OracleCallableStatement) con
                    .prepareCall("call Test_Type.getVCTTData(?,?)");
           stmt.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.ARRAY,
                    "test_type.avarchartabletype");
          stmt.registerOutParameter(2, oracle.jdbc.driver.OracleTypes.INTEGER);
          stmt.executeUpdate();
          // Get the ARRAY object and print the meta data assosiated with it
          oracle.sql.ARRAY simpleArray = stmt.getARRAY(1);
          System.out.println("SQLTypeName=" + simpleArray.getSQLTypeName());
          System.out.println("BaseType=" + simpleArray.getBaseType());
          System.out.println("length=" + simpleArray.length());
          String[] values = (String[]) simpleArray.getArray();
          for (int i = 0; i < values.length; i++) {
               System.out.println("row[" + i + "]=" + values[i] + "<BR>");
          stmt.close();
          con.close();
Result:
Exception in thread "main" java.sql.SQLException: invalid name pattern: test_type.avarchartabletype
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
     at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:463)
     at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:362)
     at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1756)
     at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:272)
     at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:196)
     at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:165)
     at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:150)
     at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:115)
     at oracle.jdbc.driver.NamedTypeAccessor.otypeFromName(NamedTypeAccessor.java:71)
     at oracle.jdbc.driver.TypeAccessor.initMetadata(TypeAccessor.java:79)
     at oracle.jdbc.driver.T4CCallableStatement.allocateAccessor(T4CCallableStatement.java:630)
     at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:133)
     at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:179)
     at TestType.main(TestType.java:32)
This works fine when execute as PL/SQL using following snippet.
declare
  thepage   Test_Type.aVarCharTableType;
  irows     integer       := 10;
  cl        clob;
  begin
  Test_Type.getVCTTData(thepage, irows);
   for i in 1 .. irows
   loop
     cl := thepage (i);
     dbms_output.PUT_LINE(cl);
   end loop;
end;Message was edited by:
bonjonbovi

Similar Messages

  • 'Blank user name' error when trying to change email password

    My password on our mail server changed, when I tried to change the password on my Storm 9500 I get 'Blank user name' error when trying to change, but I have typed in a user name!!!!
    BLOODY frustrating because now I am not receiving any mails at all, so my business out of the office has come to a standstill!!!!
    Vicky
    Solved!
    Go to Solution.

    Try changing the email password on your PC, if you are having problems doing so from your device.
    From your desktop PC:  http://www.blackberry.com/btsc/KB02830
    North American Carriers - scroll down to select your carrier
    WorldWide Carriers - Find your carrier on the list
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Java.sql.SQLException: invalid name pattern:schema.file_import_nestedtable

    Hi all,
    I am trying to insert an array in nested table to another table. I have a nested table by the name 'file_import_nestedTable'.
    code for object 'file_import_obj'
    CREATE OR REPLACE TYPE file_import_obj AS OBJECT
    column_1 datatype,
    column_2 datatype,
    column_n datatype
    and for nested table 'file_import_nestedTable'
    CREATE OR REPLACE TYPE file_import_nestedTable as TABLE OF file_import_obj
    I have a package in place and it is valid.
    The problem started when I tried to use the weblogic pool connection to call the procedure. But this was overcome by using the Oracle connection i.e another pool and not the weblogic's own connection pool.
    But now I'm facing this exception when I try to use the ArrayDescriptor.
    java.sql.SQLException: invalid name pattern: PFEP.file_import_nestedTable
    Here is my code...
    Class.forName("oracle.jdbc.driver.OracleDriver");
    connection = DriverManager.getConnection("jdbc:oracle:thin:@myserver:1521:ANSD","user","password");
    // its throwing exception here.
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("file_import_nestedTable",connection);
    ARRAY arr1 = new ARRAY(desc,connection,strArrHeaderBodyData);
    OracleCallableStatement call[i]Long postings are being truncated to ~1 kB at this time.

    Hi all,
    I am trying to insert an array in nested table to another table. I have a nested table by the name 'file_import_nestedTable'.
    code for object 'file_import_obj'
    CREATE OR REPLACE TYPE file_import_obj AS OBJECT
    column_1 datatype,
    column_2 datatype,
    column_n datatype
    and for nested table 'file_import_nestedTable'
    CREATE OR REPLACE TYPE file_import_nestedTable as TABLE OF file_import_obj
    I have a package in place and it is valid.
    The problem started when I tried to use the weblogic pool connection to call the procedure. But this was overcome by using the Oracle connection i.e another pool and not the weblogic's own connection pool.
    But now I'm facing this exception when I try to use the ArrayDescriptor.
    java.sql.SQLException: invalid name pattern: PFEP.file_import_nestedTable
    Here is my code...
    Class.forName("oracle.jdbc.driver.OracleDriver");
    connection = DriverManager.getConnection("jdbc:oracle:thin:@myserver:1521:ANSD","user","password");
    // its throwing exception here.
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor("file_import_nestedTable",connection);
    ARRAY arr1 = new ARRAY(desc,connection,strArrHeaderBodyData);
    OracleCallableStatement call[i]Long postings are being truncated to ~1 kB at this time.

  • Invalid Name Pattern in SQL Developer Data Modeler

    I am using Data Modeler version 3.3.0.747, I have exported a couple of data models (logical and physical) to an Oracle 11.2.0.3 database. I used the Reporting_Schema_Permissions.sql file to define the ID that owns the repository. Each data model that I exported returned the successful export message.
    However when I use Oracle Data Modeler and connect (as a different user) to the repository to generate a report on one of the diagrams I immediately get an error returned. The error is (from the log file in datamodeler\log\datamodeler.log):
    2013-04-19 08:36:12,233 [Thread-18] ERROR ReportsGenerationDialog - Generating report from Reporting Schema exception - invalid name pattern: username.OBJECTS_LIST
    Where username is the name of the ID being used to generate the report (not the repository owner ID).
    I have created public synonyms on the repository tables and views (though I must have missed where that was a requirement) so the repository objects can be seen by other users.
    Has anyone encountered this and if so how did you resolve it. I have searched the web (and the Oracle forums) and so far had no hits on this issue. That seems to indicate that there is something I must have missed in the setup or such.
    Thanks

    Hi,
    I think you didn't grant EXECUTE to package and types. Here is full working script:
    DECLARE
    CURSOR cur IS SELECT table_name, owner FROM all_tables WHERE owner='<owner>';
    BEGIN
    FOR rec IN cur LOOP
    EXECUTE IMMEDIATE 'GRANT SELECT ON '||'<owner>'||'.'||rec.table_name||' to '||'<another_user>';
    EXECUTE IMMEDIATE 'CREATE SYNONYM '||'<another_user>'||'.'||rec.table_name||' FOR '||'<owner>'||'.'||rec.table_name;
    END LOOP;
    END;
    DECLARE
    CURSOR cur IS SELECT view_name FROM all_views WHERE owner='<owner>';
    BEGIN
    FOR rec IN cur LOOP
    EXECUTE IMMEDIATE 'GRANT SELECT ON '||'<owner>'||'.'||rec.view_name||' to '||'<another_user>';
    EXECUTE IMMEDIATE 'CREATE SYNONYM '||'<another_user>'||'.'||rec.view_name||' FOR '||'<owner>'||'.'||rec.view_name;
    END LOOP;
    END;
    DECLARE
    CURSOR cur IS SELECT type_name FROM all_types WHERE owner='<owner>';
    BEGIN
    FOR rec IN cur LOOP
    EXECUTE IMMEDIATE 'GRANT EXECUTE ON '||'<owner>'||'.'||rec.type_name||' to '||'<another_user>';
    EXECUTE IMMEDIATE 'CREATE SYNONYM '||'<another_user>'||'.'||rec.type_name||' FOR '||'<owner>'||'.'||rec.type_name;
    END LOOP;
    END;
    GRANT EXECUTE ON <owner>.pkg_osdm_utils to <another_user>;
    CREATE SYNONYM <another_user>.pkg_osdm_utils FOR <owner>.pkg_osdm_utils;
    There is no document for reporting repository install process. If you are exporting design for first time, the repository is automatically created for you.
    When you get new version of DM you can
    1. Use new repository
    2. Upgrade existing one. If so, the simplest variant is to run /datamodeler/reports/DMRS_Upgrade_Script_<latest_vesrion>. Eventually compile single stored procedure.
    Another variant for upgrade is with running osddm_upgr.sql, but there is some error, which is going to be fixed in the next release.

  • Java.sql.SQLException: invalid name pattern : SCOTT.QUERYARRAY

    exception in Callable Statement : java.sql.SQLException: invalid name pattern: SCOTT.QUERYARRAY
    Below is the java code snippet :
    String[] arr=new String[2];
    arr[0]="select sysdate from dual";
    arr[1]="select sysdate+1 from dual";
    oracle.jdbc.driver.OracleCallableStatement oraCall = (oracle.jdbc.driver.OracleCallableStatement)con.prepareCall("{call arrayTest(?,?)}");
    oracle.sql.ArrayDescriptor descrip = oracle.sql.ArrayDescriptor.createDescriptor("QUERYARRAY",con);
    oraCall.registerOutParameter(2,oracle.jdbc.OracleTypes.ARRAY,"QUERYARRAY");
    oracle.sql.ARRAY a = new oracle.sql.ARRAY(descrip,con,arr);
    oraCall.setARRAY(1,a);
    oraCall.execute();
    where "QUERYARRAY" is an array type created in oracle as
    create or replace TYPE QUERYARRAY is VARRAY(20) OF VARCHAR2(500);
    my procedure is :
    create or replace procedure arrayTest(array_in IN QUERYARRAY,array_out OUT QUERYARRAY)
    is
    begin
         for i in 1..array_in.count
         loop
         dbms_output.put_line('Query '||i||array_in(i));
         end loop;
    end;     
    The Exception is thrown at
    oracle.sql.ArrayDescriptor descrip =
    oracle.sql.ArrayDescriptor.createDescriptor("QUERYARRAY",con);
    oraCall.registerOutParameter(2,oracle.jdbc.OracleTypes.ARRAY,"QUERYARRAY");
    Please do let me know how to resolve the issue.
    thanks in advance....

    Has anyone found a solution to this??? I have the same problem. I seems to be a permissions problem since JDBC driver tries to access the types in my schema and not the owner of the types.

  • Iphone 4s is saying invalid security code when trying to put in my debit card to download apps and etc.

    i phone is saying invalid security code when trying to put in my debit card to get apps and etc

    Try Here  >  http://support.apple.com/kb/TS1646
    If no joy...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • I keep getting an error message that I have an invalid security code when trying to make purchased in itunes.  But my security code and billing info are valid.  How do I rectify this problem?

    I keep getting an error message that I have an invalid security code when trying to make purchased in itunes.  But my security code and billing info are valid.  How do I rectify this problem?

    Did you ever get an answer to this? Im having same issue now! So frustrating!

  • How can I overcome error message "missing or invalid personalisation info" when trying to re-install Elements 3. I need to re-install Elements 3,

    How can I overcome error message "missing or invalid personalisation info" when trying to re-install Elements 3. I need to re-install Elements 3,
    @ Alternatively purchase an Elements 9 or 10.  Holding Elements13 but that needs OS 10.8 (Lion) and much of my data is in Appleworks, which is incompatble
    Apologies if I am using this incorrectly.  My first time here

    Hi.  Thanks for coming back to me.  I am using Mountain Leopard (OSX 10.6.8).  Had major problem and have re-formatted my H/D and re-installing software.  Must have lost a file in the process.  Would upgrade to Lion only I have a lot of vital data in Officeworks, but that is incompatible with Lion.

  • Why do I get an "invalid signature" message when trying to download the latest version of iTunes?

    Why do I get an "invalid signature" message when trying to download the latest version of iTunes?  Apple Support is the lamest excuse for support I have EVER seen.

    That suggests that the installer is getting damaged during the download.
    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/itunes/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • Getting invalid server certificate when trying to send email on Droid x

    getting invalid server certificate when trying to send email on Droid x.....

    There was a possible solution posted at http://community.vzw.com/t5/DROID-X-by-Motorola/Invalid-Server-Certificate/td-p/228300

  • GetProcedureColumn of DatabaseMetaData gives invalid name pattern

    I want to know the parameter details of a given procedure..for that I am using getProcedureColumn() method which takes catalog name,schema name which can be null and procedure name pattern and column name pattern..I just gave the procedure name in the place of procedure name pattern..Its giving me invalid name pattern error...what does this procedure and column name pattern represent?Please let me know as early as possible...
    Thanks in advance
    Regards
    Suganya S

    I am facing a similar problem. Can yoy please explain the fully qualified path that you entered to solve the problem?
    Thanks,

  • Invalid session error when trying to transfer line items to shopping basket

    Hi All,
    I have a requirement in E-Commerce application.
    when a user searches for a product in B2B webshop in 'products' tab in left frame, search results table get displayed which will have a shopping basket icon for each line item.
    There we can transfer only a single item to shopping basket.
    if we want to transfer more than one item, again shopping basket icon has to be clicked..
    Now my requirement is that I have to add check boxes before each line item and a button below the results table ,so that when it is cliked, all the checked items should move to shopping basket in a shot.
    I added a button and called '/catalog/updateitems.do' (onclick of buttton) which is the action called when  'transferselection' button in 'productISA.jsp' is clicked.
    Now I am getting  an error saying 'Invalid session' when that button is clicked. I am not able to guess the reason.
    And also I want to ask experts, is this the correct way of proceeding for the requirement ?
    I am new to E-Commerce and any pointers in this regard will be of great help.
    Thanks,
    Anasuya.

    Hello Anasuya,
    Any reason why Catalog is not used but "Product" search list is used in the process? Catalog gives a more organized way of displaying and searching capabilities and makes the buying experience simple. Product search is a convenience tool for power users when you know the product.
    Without major UI changes - like de-framing, the use of Product search for "Add to Cart" of all "selected" products from search list will not excite the end users. Catalog is a powerful tool that is available to you. Unless you have a strong business reason, it is better to use the features the way they are intended. You need to go back to the drawing board with your customer.
    Anyway, I am assuming that you are doing a POC. I will give the same help I provided for your previous message on a similar topic. Re: Null poiner exception when trying to store extension data in existing BO.  We need to understand the basics of Servlet / JSP. Just adding any action (calling servlet) from any page (JSP) may not help. We must understand that the action (servlet) may be expecting many values in the request context which is available in the page (JSP) it was placed in. If that action is blindly placed in another page, it is highly unlikely that it will work, unless, you also took the pain to provide the servlet behind that action with the data it is expecting. So, adding the action from _'productsISA.jsp' _ in organizer-content-product-search1.jsp will have bad results. If you have done the required changes to the JSP, then let us know the changes you have done to really understand the issue.
    If you have not done so, here is what you can do for the POC. If you look at the JSP organizer-content-product-search1.jsp, it doesn't have any useful <INPUT tags that would pass on the Product data to the servlet. So
    Surround the product (tech key) with <Input tag. (Hint: see productISA.jsp)
    I am sure you already have this for the quantity1 and the new checkbox.
    Add a button to a custom action.
    inside the custom action read all the items and create a simple Java List of  BasketTransferItem. Use BasketTransferItemImpl to actually use the instance.
    Use methods setProductKey(String techKey), setQuantity(String quantity) and if you know the UoM use setUnit(String unit) to set the BasketTransferItemImpl object.
    Add each instance of BasketTransferItem to the java List.
    Now, place this list object in the request context under the attribute name baskettransferitemlist.
    On success forward to "addtodocument"
    Make proper changes to config.xml
    I hope this will work without much changes.
    (Note: This is not a cake served in a plate, but just a tested recipe for the cake. Please cook it nicely. If you need the cake immediately, then hire a Chef! - )
    Easwar Ram
    http://www.parxlns.com

  • Invalid cursor state when trying to insert record

    Hi everyone!
    I'm using JDBC-ODBC bridge to connect to a mySql database, which works fine. Then I try to insert new records, but this only works for the first record in the table.
    When there is already a record in the table, I always get "[Microsoft][ODBC Driver Manager] Invalid cursor state" when calling the updateRow()-method of the result set.
    Here is my code:            // open db connection
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                Connection conn = DriverManager.getConnection("jdbc:odbc:TTManager", "xxxx", "xxxx");
                // Prepare SQL statement
                java.sql.Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                ResultSet result = stmt.executeQuery("SELECT * FROM Player");
                result.moveToInsertRow();Then all fields are filled in this manner:            result.updateString("Name", name);And finally the insertRow should be written to the db:            result.insertRow();But at this point it gives the mentioned error, including these messages:         at sun.jdbc.odbc.JdbcOdbcResultSet.setPos(JdbcOdbcResultSet.java:5272)
            at sun.jdbc.odbc.JdbcOdbcResultSet.insertRow(JdbcOdbcResultSet.java:4132)Since I'm very unexperienced with Java, I guess (or hope^^) it's just some stupid beginner's mistake.
    Oh, almost forgot to mention: The new record's data doesn't violate any unique-constraints on the table, all fields are explicitely filled and all variable's data types are matching their according field types!
    Any help would be appreciated!
    reinski

    Ok, I needed to help myself and this is what I found out:
    If the table already contains records, it is not enough to doresult.moveToInsertRow();but I must beresult.last();
    result.moveToInsertRow();I didn't find any explanation and even the code examples from the Sun tutorial don't mention this, so I guess it's a bug occurring in my poor IT environment: DB server running mySQL 5.0.0-alpha on a P1-233-MMX w/ 64MB under WinNT4 (hey don't laugh!!^^).
    Maybe this information is of use to someone having similar problems...
    Greetings!
    reinski

  • Why do I get "invalid drive E:/" when trying to update my itunes software

    Why do I get the message "invalid drive E:/" while trying to upgrade itunes? It causes the update to fail.

    I'd try the following user tip with that one:
    "Invalid Drive X:\" install errors

  • Logon Failed - Invalid element error when trying to connect to SalesForce

    I had a working crystal reports database connection to salesforce until I installed a Crystal Reports update on my machine.  It is currently running v12.2.0.290 (CR Developer).
    Since the update when trying to connect, I enter my password and salesforce security token to get access to the database but now I receive an error that says:
    Logon Failed
    Details: Unexpected error
    ; nested exception is
      org.xml.sax.SAXException: Invalid element in com.sforce.soap.partner.LoginResult - metadataServerUrl
    Help is resolving this error would be appreciated.

    Hi Ron -- you have installed SP2 of Crystal Reports 2008. You will need to install the FP 2.2 as per this thread -- Crystal Reports 2008 SP2 update to the Salesforce.com connectivity
    Let us know if this solved your problem.
    Thanks,
    Pete

Maybe you are looking for

  • Project material status

    Hi I need to make out report  based on some non sap fields. How can i link  PO# with Project order #? I need PO,Material code,vendor and vendor name,Item,order quantity,Project order,Project order desc  etc. Can anyone suggest me any standard tcode,I

  • Required setup steps for Intercompany Invoice in 11i

    Hi, Am new to this forum am trying to setup Inter company Invoice Transactions between Two operating units i have done quite a few setups with the help of some documents online, I have created a sales order in one OU1 and Warehouse ID as OU2 and i ha

  • MacBook 2010 occasionally got color-grain-pattern display

    since I update to Lion in July, I occasionally experiencing color-grain-pattern (usually yellow), it happen when MacBook is on dual-display mode with my 1920x1080 external display (BenQ VW2420H). it could happen on every application (but I mostly see

  • RFQ header text in Sapscripts

    I have copied MEDRUCK sapscripts to ZMEDRUCK and I have a requirement to print some rfq header text. I have got the Text ID (A01), Text name (600000022), Text Object (EKKO). What is the syntax to print this header text using a INCLUDE statement ? I h

  • CS4 Crashing Problems - Questions

    Just curious in regards to all of these "CS4 Crashing" problems. 1) Before updating to Snow leopard, did you people do due diligence by at the very least checking the S.M.A.R.T. status of your drives and do a Permission Repair first BEFORE updating?