How to register PL/SQL index table parameter in OracleCallableStatement ?

Hello ,
I am using Oracle release 8.1.6.0.0 . I need to call a PL/SQL procedure through JDBC, which specifies an INDEX TABLE OUT parameter(e.g. TYPE type_name IS TABLE OF VARCHAR2(10) INDEX BY BINARY_INTEGER) .
I found that with Oracle8i release 8.1.7, the Oracle JDBC OCI driver supports PL/SQL index-by tables using the registerIndexTableOutParameter method . But I have Oracle 8.1.6 and our client has 8.1.2!
Is there any way that I can read INDEX TABLE PARAMETER from PL/SQL procedure with Oracle release 8.1.2 and 8.1.6?
Another question is - Is it possible to do this with Oracle thin driver also ?
Regards,
Mukul

i got the same problem? did you find the way to do it yet?
thks a lot
regards.

Similar Messages

  • CONTEXT INDEX TABLE에 대한 PARAMETER 설정하는 방법

    제품 : ORACLE SERVER
    작성날짜 : 2002-04-12
    CONTEXT INDEX TABLE에 대한 PARAMETER 설정하는 방법
    ==================================================
    Purpose
    Oracle7.3과 Oracle8.0의 context option에서 index table의
    storage parameter를 설정하는 방법을 알아보자.
    Explanation
    1. ConText Index Table과 Index
    Context option 에서는 text column에 대한 Context Index Table과
    그 테이블에 대한 Index를 생성한다. 이 table과 index는
    ctx_ddl.create_index procedure를 통해 자동으로 만들어지는 데,
    생성시에 이들 table과 index에 대한 tablespace, storage clause,
    pctfree등의 parameter에 대해 설정할 수가 없고 이런 정보를 가진
    preference 를 생성하여 policy를 생성할 때 지정해야 한다.
    Parameter를 지정할 수 있는 Context Index Table과 Index는 다음과 같다.
    Table Index
    DR_nnnnn_I1T DR_nnnnn_i1I
    DR_nnnnn_KTB DR_nnnnn_KIK
    DR_nnnnn_KID
    DR_nnnnn_LST DR_nnnnn_LIX
    DR_nnnnn_SQR DR_nnnnn_SRI
    위에서 nnnnn은 policy의 id이다. 이 번호는 다음과 같이 확인할 수 있다.
    select pol_id from ctx_user_policies where pol_name = 'DEMO_POLICY';
    처음 policy를 생성한 후 create index시 생성되는 Table과 Index는
    default로 해당 유저의 default tablespace에 생성된다. 그러나 default
    tablespace가 부족하거나 생성되는 table의 크기가 크면 initial, next등의
    parameter가 작아서 maxextent를 초과하는 문제가 발생하기도 한다.
    이런 경우 원하는 데이타를 올바로 찾지 못할 수도 있다. 이 때에는 storage
    parameter나 tablespace등을 따로 지정해 주어야 한다.
    2. Preference 생성
    Index table에 대한 parameter를 지정하려면 먼저 Generic Engine
    Tile의preference를 생성해야 한다. 이 generic engine tile에는
    다음과 같은 attribute를 지정할 수 있다.
    (1) Generic Engine Tile의 Attribute
    - index_memory
    - optimize_default
    - i1t_tablespace i1t_storage i1t_other_parms
    - i1I_tablespace i1I_storage i1I_other_parms
    - ktb_tablespace ktb_storage ktb_other_parms
    - kid_tablespace kid_storage kid_other_parms
    - kik_tablespace kik_storage kik_other_parms
    - lst_tablespace lst_storage lst_other_parms
    - lix_tablespace lix_storage lix_other_parms
    - sqr_tablespace sqr_storage sqr_other_parms
    - sri_tablespace sri_storage sri_other_parms
    xxx_tablespace는 각 table과 index의 tablespace를 지정하며 xxx_storage는
    storage절을, xxx_other_parms는 그 외의 다른 parameter를 지정할 수 있다.
    (2) 명령 형식
    CTX_DDL.SET_ATTRIBUTE
    ( name in varchar2, - 원하는 attribute이름
    value in varchar2 ); - 앞의 attribute에 해당하는 값
    CTX_DDL.CREATE_PREFERENCE
    ( preference_name in varchar2, - 임의의 preference이름
    description in varchar2, - comment
    object_name in varchar2 ); - 이 경우 GENERIC ENGINE
    Example
    [ 예제 1 ] 새로운 policy를 생성하는경우 parameter지정하기.
    begin
    ctx_ddl.set_attribute('I1T_TABLESPACE','USERS');
    ctx_ddl.set_attribute('I1T_STORAGE','INITIAL 10M NEXT 10M');
    ctx_ddl.set_attribute('I1T_OTHER_PARMS','PCTFREE 10');
    ctx_ddl.set_attribute('I1I_TABLESPACE','USERS');
    ctx_ddl.set_attribute('I1I_STORAGE','INITIAL 10M NEXT 10M');
    ctx_ddl.set_attribute('I1I_OTHER_PARMS','PCTFREE 10');
    ctx_ddl.create_preference('ART_ENGIN','Test Case','GENERIC ENGINE');
    ctx_ddl.create_policy('DEMO_POLICY',
    'ARTICLES.TEXT',
    lexer_pref=>'CTXSYS.KOREAN',
    engine_pref=>'ART_ENGIN');
    ctx_ddl.create_index('DEMO_POLICY');
    end;
    위의 예에서는 I1T table과 i1I index에 대한 parameter를 설정하였다.
    preference를 생성한 후 create_policy에서 engine_pref 에 생성한
    preference이름을 준다. 위의 예와 같이 실행한 후에 다음과 같이
    확인해 볼 수 있다.
    SQL> select table_name, tablespace_name from user_tables
    2 where table_name = 'DR_01104_I1T1';
    TABLE_NAME TABLESPACE_NAME
    DR_01104_I1T1 USERS
    ( dr_01104_i1t 는 synonym이며 dr_01104_i1t1이 base table이다. )
    SQL> select index_name, tablespace_name from user_indexes
    2 where table_name = 'DR_01104_I1T1';
    INDEX_NAME TABLESPACE_NAME
    DR_01104_I1I1 USERS
    [ 예제 2 ] 기존의 policy에 새로운 preference 적용하기
    이 방법은 기존에 존재하는 policy를 update하여 preference 를 적용하는
    방법이다. 이 경우 generic engine 은 update_policy를 하기 전에 index를
    drop해야 한다.
    begin
    ctx_ddl.set_attribute('I1T_TABLESPACE','USERS');
    ctx_ddl.set_attribute('I1T_STORAGE','INITIAL 10M NEXT 10M');
    ctx_ddl.set_attribute('I1T_OTHER_PARMS','PCTFREE 10');
    ctx_ddl.set_attribute('I1I_TABLESPACE','USERS');
    ctx_ddl.set_attribute('I1I_STORAGE','INITIAL 10M NEXT 10M');
    ctx_ddl.set_attribute('I1I_OTHER_PARMS','PCTFREE 10');
    ctx_ddl.create_preference('ART_ENGIN','Test Case','GENERIC ENGINE');
    ctx_ddl.drop_index('DEMO_POLICY');
    ctx_ddl.update_policy('DEMO_POLICY',
    engine_pref=>'ART_ENGIN');
    ctx_ddl.create_index('DEMO_POLICY');
    end;
    Reference Document
    Context User's Guide and Context Reference

  • How to convert from SQL Server table to Flat file (txt file)

    I need To ask question how convert from SQL Server table to Flat file txt file

    Hi
    1. Import/Export wizened
    2. Bcp utility
    3. SSIS 
    1.Import/Export Wizard
    First and very manual technique is the import wizard.  This is great for ad-hoc and just to slam it in tasks.
    In SSMS right click the database you want to import into.  Scroll to Tasks and select Import Data…
    For the data source we want out zips.txt file.  Browse for it and select it.  You should notice the wizard tries to fill in the blanks for you.  One key thing here with this file I picked is there are “ “ qualifiers.  So we need to make
    sure we add “ into the text qualifier field.   The wizard will not do this for you.
    Go through the remaining pages to view everything.  No further changes should be needed though
    Hit next after checking the pages out and select your destination.  This in our case will be DBA.dbo.zips.
    Following the destination step, go into the edit mappings section to ensure we look good on the types and counts.
    Hit next and then finish.  Once completed you will see the count of rows transferred and the success or failure rate
    Import wizard completed and you have the data!
    bcp utility
    Method two is bcp with a format file http://msdn.microsoft.com/en-us/library/ms162802.aspx
    This is probably going to win for speed on most occasions but is limited to the formatting of the file being imported.  For this file it actually works well with a small format file to show the contents and mappings to SQL Server.
    To create a format file all we really need is the type and the count of columns for the most basic files.  In our case the qualifier makes it a bit difficult but there is a trick to ignoring them.  The trick is to basically throw a field into the
    format file that will reference it but basically ignore it in the import process.
    Given that our format file in this case would appear like this
    9.0
    9
    1 SQLCHAR 0 0 """ 0 dummy1 ""
    2 SQLCHAR 0 50 "","" 1 Field1 ""
    3 SQLCHAR 0 50 "","" 2 Field2 ""
    4 SQLCHAR 0 50 "","" 3 Field3 ""
    5 SQLCHAR 0 50 ""," 4 Field4 ""
    6 SQLCHAR 0 50 "," 5 Field5 ""
    7 SQLCHAR 0 50 "," 6 Field6 ""
    8 SQLCHAR 0 50 "," 7 Field7 ""
    9 SQLCHAR 0 50 "n" 8 Field8 ""
    The bcp call would be as follows
    C:Program FilesMicrosoft SQL Server90ToolsBinn>bcp DBA..zips in “C:zips.txt” -f “c:zip_format_file.txt” -S LKFW0133 -T
    Given a successful run you should see this in command prompt after executing the statement
    Starting copy...
    1000 rows sent to SQL Server. Total sent: 1000
    1000 rows sent to SQL Server. Total sent: 2000
    1000 rows sent to SQL Server. Total sent: 3000
    1000 rows sent to SQL Server. Total sent: 4000
    1000 rows sent to SQL Server. Total sent: 5000
    1000 rows sent to SQL Server. Total sent: 6000
    1000 rows sent to SQL Server. Total sent: 7000
    1000 rows sent to SQL Server. Total sent: 8000
    1000 rows sent to SQL Server. Total sent: 9000
    1000 rows sent to SQL Server. Total sent: 10000
    1000 rows sent to SQL Server. Total sent: 11000
    1000 rows sent to SQL Server. Total sent: 12000
    1000 rows sent to SQL Server. Total sent: 13000
    1000 rows sent to SQL Server. Total sent: 14000
    1000 rows sent to SQL Server. Total sent: 15000
    1000 rows sent to SQL Server. Total sent: 16000
    1000 rows sent to SQL Server. Total sent: 17000
    1000 rows sent to SQL Server. Total sent: 18000
    1000 rows sent to SQL Server. Total sent: 19000
    1000 rows sent to SQL Server. Total sent: 20000
    1000 rows sent to SQL Server. Total sent: 21000
    1000 rows sent to SQL Server. Total sent: 22000
    1000 rows sent to SQL Server. Total sent: 23000
    1000 rows sent to SQL Server. Total sent: 24000
    1000 rows sent to SQL Server. Total sent: 25000
    1000 rows sent to SQL Server. Total sent: 26000
    1000 rows sent to SQL Server. Total sent: 27000
    1000 rows sent to SQL Server. Total sent: 28000
    1000 rows sent to SQL Server. Total sent: 29000
    bcp import completed!
    BULK INSERT
    Next, we have BULK INSERT given the same format file from bcp
    CREATE TABLE zips (
    Col1 nvarchar(50),
    Col2 nvarchar(50),
    Col3 nvarchar(50),
    Col4 nvarchar(50),
    Col5 nvarchar(50),
    Col6 nvarchar(50),
    Col7 nvarchar(50),
    Col8 nvarchar(50)
    GO
    INSERT INTO zips
    SELECT *
    FROM OPENROWSET(BULK 'C:Documents and SettingstkruegerMy Documentsblogcenzuszipcodeszips.txt',
    FORMATFILE='C:Documents and SettingstkruegerMy Documentsblogzip_format_file.txt'
    ) as t1 ;
    GO
    That was simple enough given the work on the format file that we already did.  Bulk insert isn’t as fast as bcp but gives you some freedom from within TSQL and SSMS to add functionality to the import.
    SSIS
    Next is my favorite playground in SSIS
    We can do many methods in SSIS to get data from point A, to point B.  I’ll show you data flow task and the SSIS version of BULK INSERT
    First create a new integrated services project.
    Create a new flat file connection by right clicking the connection managers area.  This will be used in both methods
    Bulk insert
    You can use format file here as well which is beneficial to moving methods around.  This essentially is calling the same processes with format file usage.  Drag over a bulk insert task and double click it to go into the editor.
    Fill in the information starting with connection.  This will populate much as the wizard did.
    Example of format file usage
    Or specify your own details
    Execute this and again, we have some data
    Data Flow method
    Bring over a data flow task and double click it to go into the data flow tab.
    Bring over a flat file source and SQL Server destination.  Edit the flat file source to use the connection manager “The file” we already created.  Connect the two once they are there
    Double click the SQL Server Destination task to open the editor.  Enter in the connection manager information and select the table to import into.
    Go into the mappings and connect the dots per say
    Typical issue of type conversions is Unicode to non-unicode.
    We fix this with a Data conversion or explicit conversion in the editor.  Data conversion tasks are usually the route I take.  Drag over a data conversation task and place it between the connection from the flat file source to the SQL Server destination.
    New look in the mappings
    And after execution…
    SqlBulkCopy Method
    Sense we’re in the SSIS package we can use that awesome “script task” to show SlqBulkCopy.  Not only fast but also handy for those really “unique” file formats we receive so often
    Bring over a script task into the control flow
    Double click the task and go to the script page.  Click the Design script to open up the code behind
    Ref.
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • How to use PL/SQL type table in SQL FROM clause

    Hi All,
    I have to use a PL/SQL type table in our SQL statement as a table?
    I am using the syntax (below) but it gives PL/SQL: ORA-00902: invalid datatype
    SELECT ... FROM TABLE(CAST( var_pl/sql_table AS pl/sql_table)) tab WHERE tab.a=1;
    Plz reply with an example.
    Thanks.. Ratan

    You don't need a cast!!!
         select *
         from table ( <nested_table> )
         where <condition>Anyway, are you sure that tab.a is a number?
    Here follows an example with an useful function
    CREATE OR REPLACE
    type string_table  as table of varchar2(4000)
    CREATE OR REPLACE
    FUNCTION split_string (
         string IN varchar2,
         delimiter IN varchar2
    ) RETURN  string_table IS
         tab string_table;
         pre integer;
         post integer;
         step integer;
         i integer;
    BEGIN
         pre := 1;
         step := length(delimiter);
         i := 0;
         tab := string_table();
         loop
              tab.extend;
              i := i + 1;
              post := instr(string,delimiter,pre);
              if ( post = 0 ) then
                   tab(i) := substr(string,pre);
                   return tab;
              end if;
              tab(i) := substr(string,pre,post-pre);
              pre := post + step;
         end loop;
    END;
    select * from table (split_string('abc,dfg,hij',','))
    Query finished, retrieving results...
                                      COLUMN_VALUE                                  
    abc                                                                             
    dfg                                                                             
    hij                                                      

  • How to insert into SQL server table form oracle forms

    I created a form with oracle as my database. But there one trigger where I need to insert the data into a sql server table.
    Is this possible. If so can any help me out.
    Thanks in advance.
    Asha

    Hi,
    You can insert into sql server database using the following steps
    Note: Check wether you are using Forms 32 bit drivers. If not the Odbc data source will not work.
    step 1: Create ODBC data source for SQL server(one time creation);
    step 2: Logout from Oracle and login to SQL server giving the user name,password and host string as odbc:<odbc datasource name>;
    step 3: use EXEC SQL statement to insert the values into the SQL server and then logout and login again to your oracle database.
    Second Method.
    Check the sql server documentation to insert the values using command line parameters. Then you can call the host command to execute this.
    Third Method.
    Write a VB exe to enter the values in the sql server making two connections one to oracle another to SQL server and then getting values from Oracle and putting in the SQL server database. You can call this exe using the Host command.
    Hope this will help You.
    Regards
    Gaurav Thakur

  • How to create Function Module with TABLE parameter (for internal table)

    Hi Guys,
    I am trying to create a function module by using TABLE parameter. I have to pass an internal table to this function module for processing.
    But it saying : TABLES parameters are obsolete!
    And I am not going further.
    Please suggest any work arround.
    Thanks

    Hi,
    create a table type in SE11..
    Then use that in your function module importing/exporting/changing parameter for passing internal tables..
    Thanks,
    Naren

  • How to query a sql database table from webdynpro?

    Hi All,
    Can someone tell me the steps involved in accessing a sql server database table and retrieving the record set from a webdynpro application.
    Thanks in advance.
    Best regards,
    Divya

    Hello Divya,
    I would recommend you to read "Java Persistence" section in Development manual describing various options for database integration http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm
    Tutorials
    http://help.sap.com/saphelp_nw04/helpdata/en/46/ddc4705e911f43a611840d8decb5f6/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/91/9c2226df76f64fa7783dcaa4534395/frameset.htm
    Web serices
    http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm
    EJB
    http://help.sap.com/saphelp_nw04/helpdata/en/19/f9bc3d8af79633e10000000a11405a/frameset.htm
    Best regards, Maksim Rashchynski.

  • How to register PL/SQL function with Varchar2 argument in Discoverer

    Hi,
    I have registered a PL/SQL function in Discoverer Administrator 10.1.2.1. Function has two arguments with data type varchar2. In discoverer I've selected varchar as it doesn't have varchar2.
    When i use this function in report using discoverer desktop it gives an error "One of the function argument has an incorrect datatype.
    I would appreciate if somebody can help
    Regards
    BA

    Hi,
    First, do not wait to use it in order to check it.
    In the discoverer admin you can "Validate" the function on after registering it.
    there are couple of things you should know about registering the function:
    1. the "Varchar" option you selected is correct (there is no varchar2 in the admin definition).
    2. check the database function to verify that you indeed registered all its arguments and they match the names and types of the db function.
    3. during the registration, type everything in UPPER CASE.
    the other way to register the function (and you will not need to deal with the definition of it) is to search for the function in a list.
    in order to do that, on the register function screen press the "Import" button (on the bottom right side of screen).
    then search by the owner (db user / schema) that the function / package is registered.
    Tamir

  • How to set the tables parameter to a BAPI using adaptive RFC model

    Hi,
    I have a BAPI ZBAPI that has a tables parameter ZPernr of type ZTable with two elements pernr and name.
    I used adaptive RFC model and created model classes for the BAPI.
    My question how do i set list of pernr and name to the tables parameter in the webdynpro for java.
    I have the following methods available
    ZBAPI input = new ZBAPI();
    1.ZTable table = new ZTable();
    table.setPernr(pernr);
    table.setname(name);
    input.addZPernr(table);
    how do i set the table parameter for multiple pernr and name
    2.
    add all the pernr and name to list and set that list to input in the following way
    input.setZPernr(list) and list of typecom.sap.aii.proxy.framework.core. AbstractList
    out of two methods mentioned which one is correct.
    Please let me know the solution
    Thanks
    Bala Duvvuri

    Hi Bala,
                In your code:
    List pernrList = new ArrayList();
    pernrList  should be declared as the  type of class HROBJECT   ( The structure name in the model  e.g. the node PERFWARN type is Zhrecmfm_002_Perfrat_Warning_Input )
    Try this:
    HROBJECT  pernrList = new HROBJECT();
    pernrList.setPernr(pernr);
    input.setPernr_List(pernrList);
    // call BAPI execute method
    If you want to pass list of pernrs, you can pass in alternate way
    IPrivate<viewname>.I<nodeame>Node prNode = wdContext.node<node>();
    IPrivate<viewname>.I<nodeame>Element prEle;
    for (int i = 0; i < table.size(); i++) {
    HROBJECT  pernrList = new HROBJECT();
    pernrList.setPernr(pernr); // Set the pernr from current record
    prEle = prNode.create<nodeame>Element(pernrList);
    prNode.addElement(prEle);     
    // call BAPI execute method
    Once I execute the BAPI how do i iterate thru second table parameter PERNR_PERFRAT to get pernr and performance rating text
    Say your node name is  PERNR_PERFRAT
    for (int i = 0; i < wdContext.nodePERNR_PERFRAT().size(); i++) {
    wdContext.nodePERNR_PERFRAT().getPERNR_PERFRATElementAt(i).getPernr();
    wdContext.nodePERNR_PERFRAT().getPERNR_PERFRATElementAt(i).getPerfrat();
    Regards,
    Siva

  • A way to bind PLSQL indexed tables to ResultSets???

    Hello All,
    I got a stored procedure that returns several PLSQL indexed tables. Instead of handling them as separate arrays, I'd like to combine all of them as one resultset. Is that possible? Here is a sample code of what I'm trying to do:
    // Parameters 5 and 6 return PLSQL indexed tables of varchar
    OracleCallableStatement cmd = (OracleCallableStatement )cn.prepareCall(" begin PKG_MY_TEST.MY_TEST(?,?,?,?,?,?); end;");
    cmd.registerOutParameter(1, Types.NUMERIC, 8);
    cmd.registerOutParameter(2, Types.VARCHAR, 500);
    cmd.registerOutParameter(3, Types.VARCHAR, 30);
    cmd.registerOutParameter(4, Types.VARCHAR, 32);
    cmd.registerIndexTableOutParameter(5, 100, Types.VARCHAR, 32);
    cmd.registerIndexTableOutParameter(6, 100, Types.VARCHAR, 32);
    cmd.execute();
    String[] arr1 = (String[]) cmd.getPlsqlIndexTable(5);
    String[] arr2 = (String[]) cmd.getPlsqlIndexTable(6);
    // I have two string arrays. Can I make one resultset out of them?
    Thanks in advance!
    null

    Hello All,
    I got a stored procedure that returns several PLSQL indexed tables. Instead of handling them as separate arrays, I'd like to combine all of them as one resultset. Is that possible? Here is a sample code of what I'm trying to do:
    // Parameters 5 and 6 return PLSQL indexed tables of varchar
    OracleCallableStatement cmd = (OracleCallableStatement )cn.prepareCall(" begin PKG_MY_TEST.MY_TEST(?,?,?,?,?,?); end;");
    cmd.registerOutParameter(1, Types.NUMERIC, 8);
    cmd.registerOutParameter(2, Types.VARCHAR, 500);
    cmd.registerOutParameter(3, Types.VARCHAR, 30);
    cmd.registerOutParameter(4, Types.VARCHAR, 32);
    cmd.registerIndexTableOutParameter(5, 100, Types.VARCHAR, 32);
    cmd.registerIndexTableOutParameter(6, 100, Types.VARCHAR, 32);
    cmd.execute();
    String[] arr1 = (String[]) cmd.getPlsqlIndexTable(5);
    String[] arr2 = (String[]) cmd.getPlsqlIndexTable(6);
    // I have two string arrays. Can I make one resultset out of them?
    Thanks in advance!
    null

  • How to invoke PL/SQL Table parameter in the query string?

    Hello,
    I've met a problem invoking PL/SQL Table parameter in the query string, in OWS 3.0.
    What I'm going to do is, to invoke a stored procedure to generate a web page using PL/SQL Web Toolkit 2.0, like: "http://.../owa/test_proc".
    But there is a IN parameter for this procedure, and it's a PL/SQL Table variable. So I can't invoke the procedure sucessfully just using "http://.../owa/test_proc?v_plsql=i_plsql".
    Did someone have met this kind of problem or have the answer to it? Thanks so much for your help.

    When using procedures with pl/sql-tables as parameter they should be overloaded, e.g.:
    procedure my_procedure (my_var in varchar2)...
    and
    procedure my_procedure (my_var in owa_util.ident_arr)
    the procedure then can be called with:
    http://..../my_procedure?my_var=Scott, which invokes the version with the varchar2 parameter, or
    http://..../my_procedure?my_var=Scott&my_var=Miller......
    which invokes the version with the pl/sql-Table
    Another solution might be the use of flexible parameters, passing pairs of parameter_name, parameter_value to your procedure. Your procedure looks like:
    procedure my_procedure (name_array IN owa.vc_arr, value_array IN owa.vc_arr)..
    and is invoked (note the ! )
    http://..../!my_procedure?ename=Scott&sal=200&job=clerk.....
    looping through the pl/sql tables will retrieve values of ename, sal and job for name_array and Scott, 200 and clerk for value_array
    Hth
    null

  • How can I load a .xlsx File into a SQL Server Table using a Foreach Loop Container in SSIS?

    I know I've REALLY struggled with this before. I just don't understand why this has to be soooooo difficult.
    I can very easily do a straight Data Pump of a .xlsX File into a SQL Server Table using a normal Excel Connection and a normal Excel Source...simply converting Unicode to DT_STR and then using an OLE DB Destination of the SQL Server Table.
    If I want to make the SSIS Package a little more flexible by allowing multiple .xlsX spreadsheets to be pumped in by using a Foreach Loop Container, the whole SSIS Package seems to go to hell in a hand basket. I simply do the following...
    Put the Data Flow Task within the Foreach Loop Container
    Add the Variable Mapping Variable User::FilePath that I defined as a Variable and a string within the FOreach Loop Container
    I change the Excel Connection and its Expression to be ExcelFilePath ==> @[User::FilePath]
    I then try and change the Excel Source and its Data Access Mode to Table Name or view name variable and provide the Variable Name User::FilePath
    And that's when I run into trouble...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [56]]:SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occured. Error code: 0x80004005.
    Error at Data Flow Task [Excel Source [56]]: Opening a rowset for "...(the EXACT Path and .xlsx File Name)...". Check that the object exists in the database. (And I know it's there!!!)
    I don't understand by adding a Foreach Loop Container to try and make this as efficient as possible has caused such an error unless I'm overlooking something. I have even tried delaying my validations and that doesn't seem to help.
    I have looked hard in Google and even YouTube to try and find a solution for this but for the life of me I cannot seem to find anything on pumping a .xlsX file into SQL Server using a Foreach Loop Container.
    Can ANYONE please help me out here? I'm at the end of my rope trying to get this to work. I think the last time I was in this quandry, trying to pump a .xlsX File into a SQL Server Table using a Foreach Loop Container in SSIS, I actually wrote a C# Script
    to write the contents of the .xlsX File into a .csv File and then Actually used the .csv File to pump the data into a SQL Server Table.
    Thanks for your review and am hoping and praying for a reply and solution.

    Hi ITBobbyP,
    If I understand correctly, you want to load data from multiple sheets in an .xlsx file into a SQL Server table.
    If in this scenario, please refer to the following tips:
    The Foreach Loop container should be configured as shown below:
    Enumerator: Foreach ADO.NET Schema Rowset Enumerator
    Connection String: The OLE DB Connection String for the excel file.
    Schema: Tables.
    In the Variable Mapping, map the variable to Sheet_Name, and change the Index from 0 to 2.
    The connection string for Excel Connection Manager is the original one, we needn’t make any change.
    Change Table Name or View name to the variable Sheet_Name.
    If you want to load data from multiple sheets in multiple .xlsx files into a SQL Server table, please refer to following thread:
    http://stackoverflow.com/questions/7411741/how-to-loop-through-excel-files-and-load-them-into-a-database-using-ssis-package
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to get selected  row index  of a Table ?

    hi gurus,I'm new  to Webdynpro for abap
    I'm displaying    just Flight details in a Table  so
    how to get selected  row index  of a  Table  and need  to be display in Message manager.

    Hi,
    For getting the row index use the following code.
    DATA lo_nd_node TYPE REF TO if_wd_context_node.
      DATA lo_el_node TYPE REF TO if_wd_context_element.
      DATA index TYPE i.
    * navigate from <CONTEXT> to <NODE> via lead selection
      lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
      lo_el_node = lo_nd_node->get_lead_selection(  ).
      index = lo_el_node->get_index( ).
    node is the name of the node which is binded to the table.
    For printing the message u can use code wizard.
    Press ctrl-F7. Now Select generate message.
    IN this select the method  REPORT_SUCCESS
    In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
    Write the whole code in onLeadSelect of the table.
    Regards,
    Pankaj Aggarwal

  • ORA-06502: PL/SQL: numeric or value error: NULL index table key value??

    Hi,
    Can anyone let me know what is the issue on below code and how can we avoid that? i am getting the error like below
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
                        v_while_loop := 1;
                        v_delete_char_id := v_tabtype_result_values.FIRST;
                        WHILE v_while_loop <> v_tabtype_result_values.COUNT
                        LOOP
                            IF check_duplicate_nc_data (v_result_view,
                                                        v_tabtype_result_values(v_delete_char_id).value,
                                                        v_collection_id,
                                                        v_occurrence,
                                                        v_plan_id,
                                                        v_delete_char_id
                            THEN
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id);
                                v_tabtype_result_values.DELETE(v_delete_char_id);
                            ELSE
                                DBMS_OUTPUT.PUT_LINE(v_delete_char_id||','||v_tabtype_result_values(v_delete_char_id).id||','
                                                        ||v_tabtype_result_values(v_delete_char_id).value||','
                                                        ||v_tabtype_result_values(v_delete_char_id).validation_flag
                            END IF;
                            v_while_loop := v_while_loop + 1;
                            v_delete_char_id := v_tabtype_result_values.NEXT(v_delete_char_id);
                        END LOOP;

    Change:
    WHILE v_while_loop &#60;&#62; v_tabtype_result_values.COUNT to
    WHILE v_while_loop <= v_tabtype_result_values.LASTSY.

  • Exporting Parameter of type 'INDEX TABLE'

    Hi Experts,
    there is a standard method CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS in CRM which has an exporting parameter ET_TRADESPENDS of type INDEX TABLE. Could somebody give me a hint on how to call this method and work with the data that is returned? I am assuming that I will need field symbols for this, correct? Coding examples would be greatly appreciated.
    Thanks,
    Jens

    Hi Jens,
    INDEX TABLE is a generic type. The data object expected depends on configuration and/or context. As we don't have any CRM system I can check CL_CRM_MKTPL_OL_TRADE->GET_TRADESPENDS I can't give you the details.
    I have some experience with comparable methods in SAP Transportation Managament which uses the BOPF framework. In program context, we know what type of table structure will be expected, so we defined a local table accordingly and passed it to the ET parameter.
    If you don't have any idea on how to find out, just declare any internal table, i.e-lt_test  type table of string. Then call the method with parameter ET_TRADESPENDS = lt_test. This will dump for sure. Enter debugger and check what kind of data are returned. From the field names you may get a clue what structure it could be. Dump analysis may also provide some info.
    Regards,
    Clemens

Maybe you are looking for