SMO Table collections issue

Guys,
I am having issues in my script when am querying the collection objects in latest SMO (SQl 2012)
Using Microsoft.SqlServer.Smo, Version=9.0.242.0 below line returns valid table object.
$table = $db.Tables[$tablename]  
But using Microsoft.SqlServer.Smo, Version=11.0.0.0 the above line doesn't return anything so I am doing something like this to get table object.
$table = $db.Tables | Where-object {$_.name -eq $tablename}. this returns the table object I am looking for.
I have other similar issues when I am querying the collection objects.
For ex;
$procObject = $server.Databases[$database].StoredProcedures[$procname] (Doesn't work using latest SMO but works fine using older SMO)
And I verified that the stored proc is in the StoredProcedures collection.
Did this change in SQL 2012 SMO? 

Hi YMKKrammer,
Please check this forum, which has the similar issue with you:
Tables[tablename] returning $NULL
I hope this helps.

Similar Messages

  • Nested table collection in select query "in clause" taking long time

    create or replace type t_circuitids is table of varchar2(100);
    --Below anonymous block keeps on running and never ends
    DECLARE
       v_circuitid    t_circuitids;
       v_count number;
       l_circuitids   VARCHAR2 (4000)
          := 'value1,value2,value3,value4,value5';
    BEGIN
    --Below query converts comma concatinated output to list and stores in nested table collection v_circuitids
       WITH a AS
            (SELECT ',' || l_circuitids || ',' AS circuitid
               FROM DUAL)
       SELECT DISTINCT TRIM (SUBSTR (circuitid,
                                     INSTR (circuitid, ',', 1, LEVEL) + 1,
                                       INSTR (circuitid, ',', 1, LEVEL + 1)
                                     - INSTR (circuitid, ',', 1, LEVEL)
                                     - 1
                            ) cid
       BULK COLLECT INTO v_circuitid
                  FROM a
            CONNECT BY LEVEL <
                             LENGTH (circuitid)
                             - LENGTH (REPLACE (circuitid, ','));
       SELECT COUNT (1)
         INTO v_count
         FROM table
        WHERE name IN (SELECT COLUMN_VALUE
                                          FROM TABLE (v_circuitid));
    END;
    --I got the issue, query "SELECT COLUMN_VALUE FROM TABLE (v_circuitid)" which is used in above code is responsible for this.
    --Same code works fine in Development and Test environments, But in prod it keeps on running
    --I solved this issue by creating a temp table, loading all values in collection into the temp table and using that temp table in "in clause"    "
    --Can any one answer why its behaving like this when i use collection in where clause?
    --I am using Oracle 9i

    Below is the code i used
    DECLARE
       v_circuitid    t_circuitids;
       v_count number;
       l_circuitids   VARCHAR2 (4000)
          := 'value1,value2,value3,value4,value5';
    BEGIN
    --Below query converts comma concatinated output to list and stores in nested table collection v_circuitids
       WITH a AS
            (SELECT ',' || l_circuitids || ',' AS circuitid
               FROM DUAL)
       SELECT DISTINCT TRIM (SUBSTR (circuitid,
                                     INSTR (circuitid, ',', 1, LEVEL) + 1,
                                       INSTR (circuitid, ',', 1, LEVEL + 1)
                                     - INSTR (circuitid, ',', 1, LEVEL)
                                     - 1
                            ) cid
       BULK COLLECT INTO v_circuitid
                  FROM a
            CONNECT BY LEVEL <
                             LENGTH (circuitid)
                             - LENGTH (REPLACE (circuitid, ','));
       SELECT COUNT (1)
         INTO v_count
         FROM table
        WHERE name IN (SELECT COLUMN_VALUE
                                          FROM TABLE (ccard(v_circuitid)));
    END;
    And got below error
    ORA-06550: line 27, column 5:
    PL/SQL: ORA-00906: missing left parenthesis
    ORA-06550: line 24, column 4:
    PL/SQL: SQL Statement ignored

  • Selecting the contents of a table(collection) into a strong REF Cursor

    I'm trying to roll some data into a table collection and return it as a strong named cursor.
    I have not been able to do this successfully yet.
    I have tried casting the table and I couldn't get that to work either.
    I have included the whole procedure but here is the line I am getting errors on:
    SELECT * bulk collect into o_response_data_cur from table (response_data_tbl);
    Any help on this would be great.
    P.S. - As this is being picked up by BizTalk I can't return a table.
    Thanks,
    Todd M
    PROCEDURE create_customer (
    i_interface_hdr IN BizTalk_TestCustomer.interface_hdr_rec,
    i_customer_rec IN BizTalk_TestCustomer.customer_rec,
    i_address_cur IN BizTalk_TestCustomer.CUR_Addresses,
    i_contact_cur IN BizTalk_TestCustomer.CUR_Contact,
    o_interface_status OUT varchar2,
    o_response_data_cur OUT BizTalk_TestCustomer.CUR_CreateCustResponse)
    IS
    l_response_rec create_cust_response_rec;
    response_data_tbl create_cust_response_tbl;
    BEGIN
    FOR i IN 1 .. 10
    LOOP
    l_response_rec.ERROR_TYPE := 'Pre-Validation Error';
    l_response_rec.ERROR_CODE := 'DUMMY-' || i;
    l_response_rec.error_message := 'Test Error Message-' || i;
    response_data_tbl (i) := l_response_rec;
    END LOOP;
    SELECT * bulk collect into o_response_data_cur from table (response_data_tbl);
    o_interface_status := 'FAILURE';
    END create_customer;
    END BizTalk_TestCustomer;
    Here is the important Spec info:
    TYPE create_cust_response_rec
    IS
    RECORD (
    orig_system_party_ref varchar2 (240),
    orig_system_cust_acct_ref varchar2 (240),
    orig_system_site_ref varchar2 (240),
    oracle_party_id number,
    oracle_customer_id number,
    oracle_site_id number,
    ERROR_TYPE strar_cust_intf_err.ERROR_TYPE%TYPE,
    ERROR_CODE strar_cust_intf_err.ERROR_CODE%TYPE,
    error_message strar_cust_intf_err.error_message%TYPE
    TYPE CUR_Addresses IS REF CURSOR RETURN BizTalk_TestCustomer.address_rec;
    TYPE CUR_Contact IS REF CURSOR RETURN BizTalk_TestCustomer.contact_rec;
    TYPE CUR_CreateCustResponse IS REF CURSOR RETURN BizTalk_TestCustomer.create_cust_response_rec;
    TYPE create_cust_response_tbl
    IS
    TABLE OF create_cust_response_rec
    INDEX BY binary_integer;

    I think this is one of the most complicated one to develop and execute perfectly. ;)
    Here is one such case ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.55
    satyaki>
    satyaki>
    satyaki>create or replace type d_obj as object
      2    (
      3      buff    varchar2(310)
      4    );
      5  /
    Type created.
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>
    satyaki>create or replace type d_rec as table of d_obj;
      2  /
    Type created.
    Elapsed: 00:00:01.14
    satyaki>
    satyaki>
    satyaki>
    satyaki>
    satyaki>create or replace function pipe_buff(e_sal in number)
      2  return d_rec
      3  pipelined
      4  is
      5    cursor c1
      6    is
      7      select d_obj(
      8                    ename||' Joined On '||to_char(hiredate,'DD-MON-YYYY hh24:mi:ss')
      9                  ) str
    10      from emp
    11      where sal > e_sal;
    12     
    13   r1 c1%rowtype;
    14  begin
    15    for r1 in c1
    16    loop
    17      pipe row(r1.str);
    18    end loop;
    19    return;
    20  end;
    21  /
    Function created.
    Elapsed: 00:00:01.69
    satyaki>
    satyaki>
    satyaki>
    satyaki>create or replace procedure gen_cur_pipe(
      2                                            s_sal in number,
      3                                            rc in out sys_refcursor
      4                                          )
      5  is  
      6    str1  varchar2(500);
      7  begin  
      8    str1 := 'select *           
      9             from table(cast(pipe_buff('||s_sal||') as d_rec))';           
    10  
    11   open rc for str1;  
    12  exception  
    13    when others then    
    14      dbms_output.put_line(sqlerrm);
    15  end;
    16  /
    Procedure created.
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>
    satyaki>
    satyaki>create table test_dual
      2    (
      3      dummy    varchar2(310)
      4    );
    Table created.
    Elapsed: 00:00:00.10
    satyaki>
    satyaki>
    satyaki>
    satyaki>declare   
      2    rec_x test_dual%rowtype;   
      3    w sys_refcursor;
      4  begin  
      5    dbms_output.enable(1000000);  
      6    gen_cur_pipe(&num,w);  
      7    loop    
      8      fetch w into rec_x;     
      9       exit when w%notfound;             
    10         dbms_output.put_line('Employee Special Deatils: '||rec_x.dummy);
    11    end loop;  
    12    close w;
    13  exception  
    14    when others then    
    15      dbms_output.put_line(sqlerrm);
    16  end;
    17  /
    Enter value for num: 1000
    old   6:   gen_cur_pipe(&num,w);
    new   6:   gen_cur_pipe(1000,w);
    Employee Special Deatils: SATYAKI Joined On 02-NOV-2008 12:07:30
    Employee Special Deatils: SOURAV Joined On 14-SEP-2008 00:07:21
    Employee Special Deatils: WARD Joined On 22-FEB-1981 00:00:00
    Employee Special Deatils: JONES Joined On 02-APR-1981 00:00:00
    Employee Special Deatils: MARTIN Joined On 28-SEP-1981 00:00:00
    Employee Special Deatils: BLAKE Joined On 01-MAY-1981 00:00:00
    Employee Special Deatils: CLARK Joined On 09-JUN-1981 00:00:00
    Employee Special Deatils: SCOTT Joined On 19-APR-1987 00:00:00
    Employee Special Deatils: KING Joined On 17-NOV-1981 00:00:00
    Employee Special Deatils: TURNER Joined On 08-SEP-1981 00:00:00
    Employee Special Deatils: ADAMS Joined On 23-MAY-1987 00:00:00
    Employee Special Deatils: FORD Joined On 03-DEC-1981 00:00:00
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.30
    satyaki>
    satyaki>
    satyaki>/
    Enter value for num: 4000
    old   6:   gen_cur_pipe(&num,w);
    new   6:   gen_cur_pipe(4000,w);
    Employee Special Deatils: SATYAKI Joined On 02-NOV-2008 12:07:30
    Employee Special Deatils: SOURAV Joined On 14-SEP-2008 00:07:21
    Employee Special Deatils: CLARK Joined On 09-JUN-1981 00:00:00
    Employee Special Deatils: KING Joined On 17-NOV-1981 00:00:00
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.13
    satyaki>I'm not so sure about the performance.
    Regards.
    Satyaki De.

  • Using sql functions (min, max, avg) on varray or table collection

    Hi,
    I would like to know if there is a way to use sql function or oracle sql function like Min,Max, Avg or percentile_cont on varray or table collection ?
    Does anyone encountered this type of problem ?
    Thanks

    Yes you can apply Min,Max, Avg... if varray or table collection type is SQL (created in the databaase) UDF, not PL/SQL declared type:
    SQL> set serveroutput on
    SQL> declare
      2      type str_tbl_type is table of varchar2(4000);
      3      str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
      4      max_val varchar2(4000);
      5  begin
      6      select max(column_value)
      7        into max_val
      8        from table(str_tbl);
      9      dbms_output.put_line('Max value is "' || max_val || '"');
    10  end;
    11  /
          from table(str_tbl);
    ERROR at line 8:
    ORA-06550: line 8, column 18:
    PLS-00642: local collection types not allowed in SQL statements
    ORA-06550: line 8, column 12:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    ORA-06550: line 6, column 5:
    PL/SQL: SQL Statement ignored
    SQL> create or replace type str_tbl_type is table of varchar2(4000);
      2  /
    Type created.
    SQL> declare
      2      str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
      3      max_val varchar2(4000);
      4  begin
      5      select max(column_value)
      6        into max_val
      7        from table(str_tbl);
      8      dbms_output.put_line('Max value is "' || max_val || '"');
      9  end;
    10  /
    Max value is "ZZZ"
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Query Nested table (collection)

    I try to query on a nested table (collection).
    How ever, I get a 600 error.
    Is there any way to reuse the result of query in the store procedure?
    SQL&gt; DECLARE
    2 TYPE T_PER_ID IS TABLE OF PERIOD.PER_ID%TYPE;
    3 V_EXP_PER_ID T_PER_ID;
    4 V_EXP_PER_ID2 T_PER_ID;
    5 BEGIN
    6 SELECT PER_ID BULK COLLECT INTO V_EXP_PER_ID FROM PERIOD;
    7 SELECT * BULK COLLECT INTO V_EXP_PER_ID2 FROM TABLE(V_EXP_PER_ID);
    8 END;
    9 /
    DECLARE
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL
    execution], [], [], [], [], [], []
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [],
    ORA-06553: PLS-801: internal error [0]

    Oracle Version 8.1.6

  • Has any seen collection issues after 11g database upgrade?

    We do have an SR open.
    Just wondering if anyone else has experienced collection issues after upgrading the db to 11g? Our technical folks are hoping it is something else but for the past few weeks we have seen random issues stemming from collections. We run a full collections 5 nights a week. There are material transactions occurring during the two plus hours of collections. This seems to be randomly skewing on hand snapshots in collections as well as missing supply i.e. work orders. Only impacts a fraction of the records in material transactions and they are different every night.
    Reason I believe it has to do with transactions during collections is one collection run out of the five is generally pretty good...Sunday evening for there is very limited transactions taking place on this evening.
    Thanks in advance

    Answer to above question not required now as:
    Having read the 24th December update of note 761570.1 - 'Database Preparation Guidelines for an Oracle E-Business Suite Release 12.1.1 Upgrade' I have decided to upgrade the database to 11.2.0.x by following the Path C option.
    Unfortunately as the 11.2.0.x upgrade isn't covered by MWIZ yet I will have to follow the manual steps.

  • Table collection problem as in parameter

    Hi everyone,
    I'm having a little trouble in finding a solution for a problem.
    I suppose it must be very easy, but I cannot see it after many hours :(
    The package has no compilation errors
    The easy explanation :)
    Let's suposse I've in t_table the following values: 1, 2, 3, 4, 5. If I pass the values 1, 3, 5 to a function using a table collection, how can I get 2 and 4?
    The in-depth explanation...
    type t_reg is record (
    v_field number;
    type t_col is table of t_reg;
    Then, I've a function
    function f1(v_col in t_col) return boolean is...
    The problem is I get v_col with 0, 1 or more elements (which are also in a t_table BD table). I want to have in a table collection the items which are NOT passed as parameters but ARE in the t_table.
    Thank you very much

    type t_col is table of t_reg;Why are you using pl /sql-type collections?
    It gets so much easier with pure sql-type collections (following uses as an example the built-in dbms_debug_vc2coll collection):
    SQL> select deptno, dname
      from dept
    where to_char(deptno) not member of sys.dbms_debug_vc2coll (30, 40)
             DEPTNO DNAME               
                 10 ACCOUNTING          
                 20 RESEARCH            
                 50 SALES               
    3 rows selected.

  • What is Varray,Nested tables,Collections,Pragma?

    Hi,
    what is Varray,Nested tables,Collections,Pragma?
    and in Which Situations will We Use this?.
    Anyone having any dea regarding this?

    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/05_colls.htm
    http://awads.net/wp/2006/03/01/pragmatism-in-oracle-plsqlKhurram

  • Can I select element number from table collection expression?

    Hi, I know I can use COLUMN_VALUE to select column values from table collection expression. Is there any way to select the number of the element as well? (with Oracle 11.2.0.1.0)
    CREATE OR REPLACE TYPE plch_numbers_nt IS TABLE OF NUMBER;
    DECLARE
       l_numbers   plch_numbers_nt
                      := plch_numbers_nt (10,
                                          20,
                                          30,
                                          40,
                                          50);
    BEGIN
       -- This would be nice...
       FOR rec IN (SELECT COLUMN_VALUE, VALUE_INDEX FROM TABLE (l_numbers))
       LOOP
          DBMS_OUTPUT.put_line (rec.COLUMN_VALUE, rec.VALUE_INDEX);
       END LOOP;
    END;
    /

    First of all, I would like to thank you all for your replies. I really appreciate your help.
    The problem I'm trying to solve is more complicated than what I have shown so far. Right now I'm trying to decompose the problem into smaller problems. Maybe I should show you the full problem and hope that I still get a reply.
    I have a spatial column with collections of geometries (SDO_GTYPE 2004) and I have a VARRAY column of objects. For each row, each geometry in the geometry collection has some information in one element in the VARRAY. So I have this table
    -- +----+------------------+-----------------------------------------------------------------------------------+
    -- | ID | GEOM_COLL        | GEO_INFO                                                                          |
    -- +----+------------------+-----------------------------------------------------------------------------------+
    -- | 98 | sdo_geom(2004)_1 | ((geo_info_1_1_1; geo_info_2_1_1; ...);(geo_info_1_1_2; geo_info_2_1_2; ...) ...) |
    -- +----+------------------+-----------------------------------------------------------------------------------+
    -- | 99 | sdo_geom(2004)_2 | ((geo_info_1_2_1; geo_info_2_2_1; ...);(geo_info_1_2_2; geo_info_2_2_2; ...) ...) |
    -- +----+------------------+-----------------------------------------------------------------------------------+
    --  ...and I need this
    -- +----+--------------------+----------------+----------------+-----+
    -- | ID | SDO_GEOM           | GEO_INFO_1     | GEO_INFO_2     | ... |
    -- +----+--------------------+----------------+----------------+-----+
    -- | 98 | sdo_geom(2001)_1_1 | geo_info_1_1_1 | geo_info_2_1_1 | ... |
    -- +----+--------------------+----------------+----------------+-----+
    -- | 98 | sdo_geom(2002)_1_2 | geo_info_1_1_2 | geo_info_2_1_2 | ... |
    -- +----+--------------------+----------------+----------------+-----+
    -- +----+--------------------+----------------+----------------+-----+
    -- | 99 | sdo_geom(2002)_2_1 | geo_info_1_2_1 | geo_info_2_2_1 | ... |
    -- +----+--------------------+----------------+----------------+-----+
    -- | 99 | sdo_geom(2001)_2_2 | geo_info_1_2_2 | geo_info_2_2_2 | ... |
    -- +----+--------------------+----------------+----------------+-----+
    -- ...I need a flat version of the original table, if you will. My original plan was to convert the VARRAY values to rows and extract the geometries into rows. Then join both using their ROWNUMs. But this does not work as i need numbers that start at 1 for each ID and I'm not sure if ROWNUM will give me the right order. Hence my question for consecutive element numbers. I have no idea how to do it with SQL. I'm working on a PL/SQL solution right now. Sample code follows. Sorry for the length of this post.
    CREATE OR REPLACE TYPE geo_info AS OBJECT (
      just INTEGER,
      txt  VARCHAR2 (255)
    CREATE OR REPLACE TYPE geo_info_array AS VARRAY (10000) OF geo_info;
    CREATE TABLE geometries (
      id NUMBER (38) PRIMARY KEY,
      geom_coll SDO_GEOMETRY,
      geo_info geo_info_array
    INSERT INTO geometries (id, geom_coll, geo_info) VALUES (
      98,
      sdo_geometry (2004, NULL, sdo_point_type (0, 0, 0),
                    sdo_elem_info_array (1, 1, 1, 3, 2, 1, 7, 1, 1, 9, 1, 1),
                    sdo_ordinate_array (5408562.081181, 5696027.239777, 5408563.398, 5696028.369, 5408568.192, 5696028.132, 5408562.643029, 5696038.558968, 5408565.328059, 5696027.0783)),
      geo_info_array (geo_info (7, '10.9'),
                      NULL,
                      geo_info (7, '0.0'),
                      geo_info (7, '-4.8-'))
    INSERT INTO geometries (id, geom_coll, geo_info) VALUES (
      99,
      sdo_geometry (2004, NULL, sdo_point_type (0, 0, 0),
                    sdo_elem_info_array (1, 2, 1, 5, 1, 1, 7, 2, 1, 11, 1, 1, 13, 1, 1),
                    sdo_ordinate_array (5408575.262, 5696017.841, 5408575.255, 5696017.341, 5408573.318578, 5696016.67559, 5408575.255, 5696017.341, 5408574.155, 5696017.357, 5408573.359578, 5696017.97359, 5408572.012251, 5696017.299678)),
      geo_info_array (NULL,
                      geo_info (7, '0.5'),
                      NULL,
                      geo_info (7, '0.0'),
                      geo_info (7, '-1.1-'))
    /

  • HOW SMO TABLES AND ORIGINAL CRM TABLE UPDATE HAPPENS

    Hi,
    I have created program and populating data into BDOCS and calling SMW_CALL_MIDDLEWARE …
    The SMO tables are getting updated  but I would like to know how original CRM tables will get updated…
    Any help greatly appreciated…
    Plz let me know how 2 get relevant documents…
    Thanks in advance…..
    Regds..
    kris

    Hi,
    the online database gets updated with mbdocs, the CDB with sbdocs.
    you probably created an sbdoc in memory and passed it along to the middleware. You can do exactly the same with mbdocs, which will then update the online tables.
    eg. capgen_object_write updates the CDB, bupa_main updates online.
    You could also create the sbdoc (inbound), wich will then be processed accoring to the MSA flow: it will automatically be mapped to the mbdoc, which will be processed online, and which will then automatically call the outbound sbdoc flow.
    This is tricky stuff ==> No documentation available, but you can learn alot from understanding how the standard system & flows work.
    Michael.

  • ADF Table filter issue with OR or AND input value

    Hi all,
    adf:table filterable fields for OR or AND input value not works. Actually One of column is for State and it has "OR" value for -> OREGON State.
    and I tried using filterModel and queryListener for table attribute. But I am not getting exact clue where I need to fix for this issue. Any suggestion and help is appreciated greatly.
    jdev version 11.1.1.3
    Thank you.
    - Robin

    Something like this might work for the one case:
    public void handleQuery(QueryEvent queryEvent){
        // Replace the OR with an equivalent condition
        Map m =
          ((FilterableQueryDescriptor) (queryEvent.getDescriptor())).getFilterCriteria();
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(), "OR"))
            entry.setValue("O AND _R");
        // Process The Query
        ELUtils.invokeMethod("#{bindings.VOQuery.processQuery}",
                             QueryEvent.class, queryEvent);
        // Put the OR back
        for (Map.Entry entry: (Collection<Map.Entry>) m.entrySet())
          if (entry.getValue() != null &&
              StringUtils.equalsIgnoreCase(entry.getValue().toString(),
                                           "O AND _R"))
            entry.setValue("OR");
    }

  • Query hangs using db link and nested table collection

    Hi,
    I have a stored procedure which takes, as input, a string of values that can vary in length. The input is used as an IN operator within the queries that exist within the proc:
    Code:
    PROCEDURE get_contacts (i_customerids IN VARCHAR2)
    an example of the input would be: '987451',412897' or '7541256','75412','95412589'
    In order to process the dynamic "In-List", I created a custom collection type to convert the string to a table:
    Code:
    CREATE OR REPLACE
    TYPE stringtotable AS TABLE OF VARCHAR2(3900)
    (I've also tried the solutions on http://tkyte.blogspot.com/2006/06/varying-in-lists.html and http://fdegrelle.over-blog.com/article-1694534-6.html for handling dynamic in-lists and they also hang)
    The proc contains 2 queries, the first returns records from a table within the current database:
    Code:
    SELECT *
    FROM contacts
    WHERE customer_id IN (
    SELECT *
    FROM TABLE (stringtotable (i_customerids
    The second query returns records from a database that is defined via a db link:
    Code:
    SELECT b.customer_id, a.row_id, a.fst_name, a.last_name
    FROM userlist.customers@uldblink a, userlist.firms@ulbdlink b
    WHERE a.parent_id = b.row_id
    AND b.customer_id IN (
    SELECT *
    FROM TABLE (stringtotable (i_customerids
    The first query is executing without issue. The second query, however, is hanging indefinitely. Additionally, If I hard code the string in the IN operator, the second query executes without issue.
    I am not the DBA for the database, so I don't currently have access to the trace logs. I've requested access to the trace logs to see if I can figure out what is hanging.
    In the meantime, I was hoping someone would be able to tell me if
    a: there is a better way to handle "dynamic in- lists".
    or
    b: if there is something obvious that I'm not considering.
    Thanks for your help,
    Fielding
    Message was edited by:
    fwilson

    Hi Todd,
    Thanks for the suggestion. I was not aware of the cardinality hint.
    I tried adding it to my query but unfortunately the query still appeared to hang. It did get me thinking though... that maybe the stringtotable collection type is creating the table in memory, and therefore its records aren't accessible to the dblink
    so I inserted the values that were being returned via the stringtotable collection type into a physical table named TestTable. I then modified my query to select the values from TestTable.
    Code:
    ...in (select /*+ cardinality(t 3) */ t.*
    from testtable t)
    This worked.
    So that poses the questions-
    a: is my assumption about the in-memory table correct
    and
    b: if so is there a way around it?
    Thanks for your help

  • Table.convertToText() issue

    Hi all,
    I am not sure if this was reported before (can not match any searches)
    For me looks like a bug or something weird, at least.
    Start point is to convert a table to text (even by 1-liner script) and to make undo after this.
    A table is back and ready to use in UI (to select, to modify contents) but not by script.
    Although table.isValid == true no other property works and script returns error "object no longer exists"
    Everything goes available if textFrame with this table is duplicated OR after reopening doc (save doesnt help - save, close and open - helps)
    Can someone confirm this on his side OR - even better - throw some light on this issue?
    (CS 5.0 and Windows 7)
    Jarek

    @Jarek – I can see this as well.
    On Mac OSX 10.7.5 with InDesign CC 2014.2.
    One text frame with just one table is selected.
    $.writeln(app.selection[0].parentStory.tables.length);
    //1
    $.writeln(app.selection[0].parentStory.tables[0]);
    //[object Table]
    $.writeln(app.selection[0].parentStory.tables[0].getElements()[0]);
    //[object Table]
    Converted to text and then one undo will get you this:
    app.selection[0].parentStory.tables[0].convertToText("$","&");
    app.documents[0].undo();
    $.writeln(app.selection[0].parentStory.tables.length);
    //1
    $.writeln(app.selection[0].parentStory.tables[0]);
    //[object Table]
    $.writeln(app.selection[0].parentStory.tables[0].getElements()[0]);
    //[object ]
    //Error: Object is invalid
    I could even copy/pasted that text frame with the invalid table, duplicated it, and still, the table stays invalid.
    Exported to IDML, exported to IDMS.
    That finally crashed my InDesign:
    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
    VM Regions Near 0:
    -->
        __TEXT                 0000000108b12000-0000000108b18000 [   24K] r-x/rwx SM=COW  /Applications/Adobe InDesign CC 2014/Adobe InDesign CC 2014.app/Contents/MacOS/Adobe InDesign CC 2014
    Application Specific Information:
    objc[281]: garbage collection is OFF
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   com.adobe.InDesign.Table Model    0x00000001172f4ab5 0x117268000 + 576181
    1   PublicLib.dylib                   0x000000010a083650 RepresentScriptProvider::AccessLabel(IDType<ScriptID_tag>, IScriptRequestData*, IScript*) + 688
    2   PublicLib.dylib                   0x000000010a084b7b RepresentScriptProvider::AccessProperty(IDType<ScriptID_tag>, IScriptRequestData*, IScript*) + 283
    3   com.adobe.InDesign.Table Model    0x00000001172f8a49 0x117268000 + 592457
    4   PublicLib.dylib                   0x000000010a07f039 CScriptProvider::AccessProperties(IScriptRequestData*, IScript*) + 489
    5   com.adobe.InDesign.Scripting      0x0000000117daeac7 0x117d7d000 + 203463
    6   com.adobe.InDesign.Scripting      0x0000000117daf0e9 0x117d7d000 + 205033
    7   com.adobe.InDesign.INXCore        0x00000001190dd0fa 0x1190c4000 + 102650
    8   PublicLib.dylib                   0x000000010a1ee656 CScriptDOMElement::GetMultipleAttributes(K2Vector<IDType<ScriptID_tag>, K2Allocator<IDType<ScriptID_tag> > > const&, adobe::version_1::vector<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue>, adobe::version_1::capture_allocator<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue> > >&) + 374
    9   PublicLib.dylib                   0x000000010a01b988 CTextScriptDOMElement::GetNonStyleAttributes(short, adobe::version_1::vector<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue>, adobe::version_1::capture_allocator<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue> > >&) + 680
    10  com.adobe.InDesign.INXCore        0x000000011910b057 0x1190c4000 + 290903
    11  PublicLib.dylib                   0x000000010a1eed92 CScriptDOMElement::GetAttributes(adobe::version_1::vector<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue>, adobe::version_1::capture_allocator<KeyValuePair<IDType<ScriptID_tag>, DOMAttributeValue> > >&) + 194
    12  com.adobe.InDesign.INXCore        0x000000011911f4d3 0x1190c4000 + 373971
    Uwe

  • BULK COLLECT Issues in 10g

    I have a procedure that runs a function which uses BULK COLLECT INTO on a 9i database. When I try to run the same procedure with the same function on 10g, it fails. I can't figure out how to find the exact error message but have narrowed it down to the following:
    In the main procedure, I have this:
    Select Count(ApprId) into v_cnt
         From TABLE(udf_OverallPerms(v_camid))
         Where ApprId in
              (Select M_ApprId
                   From PM_MetricDefApproved Where M_AreaValueId=v_areaValueId and M_ParentId = 0
                   UNION
                   Select MDAC.M_ApprId
                   From PM_MetricDefApproved MDAC,
                        PM_MetricDefApproved MDAP
                   Where MDAC.M_ParentId=MDAP.M_ApprId
                        and MDAP.M_AreaValueId=v_areaValueId and MDAC.M_ParentId > 0);
    The code for the function is as follows:
    CREATE OR REPLACE FUNCTION udf_OverallPerms(v_UserCAMID IN VARCHAR2)
    RETURN OVERALL_TBL
    AS
         v_data OVERALL_TBL := OVERALL_TBL();
    BEGIN
         Select OVERALL_REC(ApprId, MAX(bRead), MAX(bWrite),
              MAX(bApprove), MAX(bDelete),
              MAX(bAdmin), MAX(bView), MAX(bViewWrite))
         BULK COLLECT INTO v_data
         From vwObjectRoles
         Where (ObjectId IN
              (Select GroupId as ObjectId from vwUsersInGroups
              Where UserCAMID=v_UserCAMID)
              AND ObjectTypeId=(Select ObjectTypeId From PM_ObjectTypes Where ObjectTypeCode='GRP'))
              OR
              (ObjectId =
              (Select UserId as ObjectId FROM PM_UserLookup
              Where UserCAMID=v_UserCAMID)
              AND ObjectTypeId=(Select ObjectTypeId From PM_ObjectTypes Where ObjectTypeCode='USER'))
         Group By ApprId;
         return v_data;
    END;
    Does anyone know of any issues in 10g with this? I have been banging my head on this for a day now.
    Thanks,
    Greg

    OK. I managed to get the EXCEPTION. Not sure it helps or not.
    ORA-02055: distributed update operation failed; rollback required
    ORA-22905: cannot access rows from a non-nested table item
    ORA-06512: at "C83_WEBDEV_PERFORM.USP_C8IMPORT_POLICY", line 179
    ORA-06512: at line 17
    Version is 10.2.0.1.

  • In BI Publisher RTF table layout issue for invoice printing

    Hi,
    I am working on check printing and invoice printing project on bi publisher and i am facing one issue. That is i have used section break on check priting so because of that if the the records are more than 20 then check will print on second page and on first page there would be void printed othervise it should print on first page only. In this case the preprinted stationary is not having invoice table form. we are using blank preprinted stationary to print this .
    Now i have done with invoice and cheque layout but in output if the number of records are more than 20 then its going to second page but the problem is that invoice table break into two parts and and the end lineof table layout is not coming on first page .even on second page i am not getting start layout line to make complete table outline.
    I want that full table layouton both the pages of the table. i have tried to to create table skeleton and used it as a watermark to print all the records on it but it is coming in to the middle of the page .so it not working.
    Please anyone knows the solution on this problem please let me know or share your thoughts on this issue.
    As i have tried many options but still stuck into this issue .Kindly help me.
    Regards,
    Prachi G.

    Hmmm ... sounds like a regression bug.
    I would contact support, provide, the version you are using, layout template, sample XML data, 2000 RTF output and 2003 RTF output and ask them to investigate.
    Tim

Maybe you are looking for