Extend function in pl/sql table

declare
type aar_test is table of varchar2(100)
index by binary_integer;
aar_main aar_test;
begin
aar_main.extend;
aar_main(aar_main.last) :='Extend Cell';
end;
it's return a error....it is possible??? if yes how...plzzzzzzzz help me...

Hi..
Please go through this...!!
EXTEND
This procedure has three forms. EXTEND appends one null element to a collection.
EXTEND(n) appends n null elements to a collection.
EXTEND(n,i) appends n copies of the ith element to a collection.
EXTEND operates on the internal size of a collection.
If EXTEND encounters deleted elements, it includes them in its tally.
You cannot use EXTEND with associative arrays.Regards
KPR
*If this response is correct then mark it as correct answer.
*If this response is helpful then mark it as helpful answer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Function returning pl/sql table of dynamic structure

    Hi,
    I use oracle11g/windows platform.
    I have a requirement to be coded like this:
    A function to return pl/sql table(cant use ref cursor) whose columns varies everytime it runs i.e.,
    means
    type pl_tab_type is object(col1 varchar2(1000), col2 varchar2(1000))
    type pl_tab is table of pl_tab_type
    func f return pl_tab
    as
    end;
    note : pl_tab_type will vary for each run of function f
    i.e.,for example, pl_tab_type can be changd to as follows:
    type pl_tab_type is object(col1 varchar2(1000), col2 varchar2(1000),col3 varchar2(1000))
    how to return pl/sql table of dynamic type from func, thanks for help in advance.

    WRONG FORUM!
    Please mark this question ANSWERED and repost it in the SQL and PL/SQL forum.
    PL/SQL

  • Using extend option with PL/SQL table of tables

    Hi,
    I have a PL/SQL table of tables sructure on which I want to use extend option available with PL/SQL tables.
    But I am not able to do so. Could anyone help?
    Below is sample code given.
    Type RA_TABLE is table of CALL_DETAIL_EXCEPTION.IC_CIRCT_GR_CD%TYPE;
    TYPE tab_of_RA_TABLE IS TABLE OF RA_TABLE;
    for idx in 1..cnt_interval Loop
    query1:='select Trunk_info from dbl.vw_cgi v where not exists (select 1 from dbl.varun f
    where f.ic_circt_gr_cd= v.TRUNK_INFO and f.call_gmt_dnect_dt_time between
    to_date('''||stime||''',''yyyymmddhh24miss'') and to_date('''||etime||''',''yyyymmddhh24miss''))';
    execute immediate query1 bulk collect into Outer_table(idx);
    ra_cnt_1:= Outer_table(idx).count;
    diff:= max_cnt-RA_CNT_1;
    dbms_output.put_line('idx: '||idx);
    dbms_output.put_line('diff: '||diff);
    if diff>=1 then
    Outer_table(idx).extend( Diff);
    end if;
    end loop;
    The extend doesnt work.
    Please help!!

    Hi,
    I have a PL/SQL table of tables sructure on which I want to use extend option available with PL/SQL tables.
    But I am not able to do so. Could anyone help?
    Below is sample code given.
    Type RA_TABLE is table of CALL_DETAIL_EXCEPTION.IC_CIRCT_GR_CD%TYPE;
    TYPE tab_of_RA_TABLE IS TABLE OF RA_TABLE;
    for idx in 1..cnt_interval Loop
    query1:='select Trunk_info from dbl.vw_cgi v where not exists (select 1 from dbl.varun f
    where f.ic_circt_gr_cd= v.TRUNK_INFO and f.call_gmt_dnect_dt_time between
    to_date('''||stime||''',''yyyymmddhh24miss'') and to_date('''||etime||''',''yyyymmddhh24miss''))';
    execute immediate query1 bulk collect into Outer_table(idx);
    ra_cnt_1:= Outer_table(idx).count;
    diff:= max_cnt-RA_CNT_1;
    dbms_output.put_line('idx: '||idx);
    dbms_output.put_line('diff: '||diff);
    if diff>=1 then
    Outer_table(idx).extend( Diff);
    end if;
    end loop;
    The extend doesnt work.
    Please help!!

  • SQL, PL/SQL functions, and ORA-04091 table is mutating

    Dears,
    Recently a question came up in an Oracle French forum about an insert/select that is throwing ORA-04091: table xxxx is mutating, trigger/function may not see it error in 11g while the same insert/select was working very well in 10g. The original poster gave a scenario that is easily reproducible. I am wondering what database release is correct the one throwing the error(11g) or the other one accepting the insert/select(10g)?
    *10g*
    mhouri.world > select * from v$version;
    BANNER                                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi               
    PL/SQL Release 10.2.0.4.0 - Production                                         
    CORE     10.2.0.4.0     Production                                                     
    TNS for Solaris: Version 10.2.0.4.0 - Production                               
    NLSRTL Version 10.2.0.4.0 - Production                                         
    mhouri.world > create table t_read_consistency (id number, vc varchar2(15), primary key (id));
    Table created.
    mhouri.world > insert into
      2        t_read_consistency
      3      select
      4        rownum id,
      5        rpad('a',15,'a')
      6      from
      7        dual
      8      connect by
      9        level<=1000;
    1000 rows created.
    mhouri.world > commit;
    Commit complete.
    mhouri.world > create or replace function f_read_consistency return varchar2
      2       as
      3        lv_vc  t_read_consistency.vc%type;
      4       begin
      5         select trc.vc
      6         into lv_vc
      7          from t_read_consistency trc
      8         where trc.id = 70 ;
      9        return lv_vc;
    10     end f_read_consistency;
    11    /
    Function created.
    mhouri.world >insert into
      2        t_read_consistency (id, vc)
      3      select
      4         1001
      5        ,f_read_consistency
      6      from dual;
          ,f_read_consistency
    ERROR at line 5:
    ORA-04091: table MHOURI.T_READ_CONSISTENCY is mutating, trigger/function may not see it
    ORA-06512: at "MHOURI.F_READ_CONSISTENCY", line 5
    _11g_
    mohamed@mhouri> select * from v$version;
    BANNER                                                                         
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production         
    PL/SQL Release 11.2.0.1.0 - Production                                         
    CORE     11.2.0.1.0     Production                                                     
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production                        
    NLSRTL Version 11.2.0.1.0 - Production                                         
    mohamed@mhouri> create table t_read_consistency (id number, vc varchar2(15), primary key (id));
    Table created.
    mohamed@mhouri> insert into
      2    t_read_consistency
      3  select
      4    rownum id,
      5    rpad('a',15,'a')
      6  from
      7    dual
      8  connect by
      9    level<=1000;
    1000 rows created.
    mohamed@mhouri>  create or replace function f_read_consistency return varchar2
      2   as
      3    lv_vc  t_read_consistency.vc%type;
      4   begin
      5     select trc.vc
      6     into lv_vc
      7      from t_read_consistency trc
      8     where trc.id = 70 ;
      9    return lv_vc;
    10  end f_read_consistency;
    11  /
    Function created.
    mohamed@mhouri> insert into
      2    t_read_consistency (id, vc)
      3  select
      4     1001
      5    ,f_read_consistency
      6  from dual;
      ,f_read_consistency
    ERROR at line 5:
    ORA-04091: table MOHAMED.T_READ_CONSISTENCY is mutating, trigger/function may
    not see it
    ORA-06512: at "MOHAMED.F_READ_CONSISTENCY", line 5 So far so good. Same behaviour for both releases. But let's bring a small change to the PL/SQL function to be as close as the example given in the French Forum
    _10g where the select/insert was working without error_:
    mhouri.world > select * from v$version;
    BANNER                                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi               
    PL/SQL Release 10.2.0.4.0 - Production                                         
    CORE     10.2.0.4.0     Production                                                     
    TNS for Solaris: Version 10.2.0.4.0 - Production                               
    NLSRTL Version 10.2.0.4.0 - Production       
    mhouri.world > create type t_read_cs as object (id number,vc varchar2(15));
      2  /
    Type created.
    mhouri.world > create type t_read_cs_tab  as table of t_read_cs;
      2  /
    Type created.
    mhouri.world > create or replace function f_read_consistency_tab
      2  return t_read_cs_tab
      3    as
      4      lc_t_read_cs_tab t_read_cs_tab := t_read_cs_tab();
      5      j  binary_integer := 0;
      6    begin
      7        for x in (select
      8                      id,
      9                      vc
    10                   from  t_read_consistency trs
    11                  where trs.id <= 10
    12       ) loop
    13 
    14          j := j +1;
    15          lc_t_read_cs_tab.extend;
    16          lc_t_read_cs_tab(j) := t_read_cs(x.id, x.vc);
    17     end loop;
    18     RETURN lc_t_read_cs_tab;
    19   end f_read_consistency_tab;
    20  /
    Function created.
    mhouri.world > select count(1) from t_read_consistency;
      COUNT(1)                                                                                                             
          1000                                                                                                             
    mhouri.world > select count(1)
      2  from (select * from table(f_read_consistency_tab));
      COUNT(1)                                                                                                             
            10                                                                                                             
    mhouri.world > insert into t_read_consistency
      2         (id,vc)
      3      select id,vc
      4   from table(f_read_consistency_tab)
      5  ;
    10 rows created.
    mhouri.world > select count(1) from t_read_consistency;
      COUNT(1)                                                                                                             
          1010            
    _11g where the same insert/select is throwing an error:_
    mohamed@mhouri> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    mohamed@mhouri> create type t_read_cs as object (id number,vc varchar2(15));
      2  /
    Type created.
    mohamed@mhouri> create type t_read_cs_tab  as table of t_read_cs;
      2  /
    Type created.
    mohamed@mhouri> create or replace function f_read_consistency_tab
      2      return t_read_cs_tab
      3        as
      4          lc_t_read_cs_tab t_read_cs_tab := t_read_cs_tab();
      5          j  binary_integer := 0;
      6        begin
      7            for x in (select
      8                          id,
      9                          vc
    10                      from  t_read_consistency trs
    11                     where trs.id <= 10
    12          ) loop
    13 
    14            j := j +1;
    15             lc_t_read_cs_tab.extend;
    16             lc_t_read_cs_tab(j) := t_read_cs(x.id, x.vc);
    17        end loop;
    18        RETURN lc_t_read_cs_tab;
    19      end f_read_consistency_tab;
    20    /
    Function created.
    mohamed@mhouri> select count(1) from t_read_consistency;
      COUNT(1)                                                                     
          1000                                                                     
    mohamed@mhouri> select count(1) from (select * from table(f_read_consistency_tab));
      COUNT(1)                                                                     
            10                                                                     
    mohamed@mhouri> insert into t_read_consistency
      2            (id,vc)
      3          select id,vc
      4      from table(f_read_consistency_tab)
      5     ;
        from table(f_read_consistency_tab)
    ERROR at line 4:
    ORA-04091: table MOHAMED.T_READ_CONSISTENCY is mutating, trigger/function may
    not see it
    ORA-06512: at "MOHAMED.F_READ_CONSISTENCY_TAB", line 7 In addition, one of the posters spotted out very judiciously that if we slightly change the definition of the table t_read_consistency in 11g, strangely the insert/select will work correctly in this data base as shown below:
    ohamed@mhouri> drop table tr_read_consistency;
    Table dropped.
    mohamed@mhouri> create table tr_read_consistency
      2      as select rownum rn,
      3                trs.*
      4      from
      5         t_read_consistency trs;
    Table created.
    mohamed@mhouri> insert into tr_read_consistency
      2                 (rn, id,vc)
      3              select rownum, id,vc
      4           from table(f_read_consistency_tab);
    10 rows created.So is this a regression? or a corrected bug during upgrade?
    Thanks in advance
    Mohamed Houri

    I just followed the doc links provided by Tubby, which have 100% Correct answer. See below :
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> show user;
    USER is "SCOTT"
    SQL> create type t_read_cs as object (id number,vc varchar2(15));
      2  /
    Type created.
    SQL> create type t_read_cs_tab  as table of t_read_cs;
      2  /
    Type created.
    SQL> create table t_read_consistency (id number, vc varchar2(15), primary key (id));
    Table created.
    SQL> create or replace function f_read_consistency_tab
      2  return t_read_cs_tab
      3  as
      4  lc_t_read_cs_tab t_read_cs_tab := t_read_cs_tab();
      5  j  binary_integer := 0;
      6  begin
      7  for x in (select
      8  id,
      9  vc
    10  from  t_read_consistency trs
    11  where trs.id <= 10
    12  ) loop
    13  j := j +1;
    14  lc_t_read_cs_tab.extend;
    15  lc_t_read_cs_tab(j) := t_read_cs(x.id, x.vc);
    16  end loop;
    17  RETURN lc_t_read_cs_tab;
    18  end f_read_consistency_tab;
    19  /
    Function created.
    SQL> insert into
      2  t_read_consistency
      3  select
      4  rownum id,
      5  rpad('a',15,'a')
      6  from
      7  dual
      8  connect by
      9  level<=1000;
    1000 rows created.
    SQL> select count(1) from t_read_consistency;
      COUNT(1)
          1000
    SQL> select count(1) from (select * from table(f_read_consistency_tab));
      COUNT(1)
            10
    SQL> insert into t_read_consistency
      2  (id,vc)
      3  select id,vc
      4  from table(f_read_consistency_tab);
    from table(f_read_consistency_tab)
    ERROR at line 4:
    ORA-04091: table SCOTT.T_READ_CONSISTENCY is mutating, trigger/function may not see it
    ORA-06512: at "SCOTT.F_READ_CONSISTENCY_TAB", line 7
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function f_read_consistency_tab
      2  return t_read_cs_tab
      3  as
      4  lc_t_read_cs_tab t_read_cs_tab := t_read_cs_tab();
      5  j  binary_integer := 0;
      6  PRAGMA AUTONOMOUS_TRANSACTION; <--- This works as documented in 11.2.0.1
      7  begin
      8  for x in (select
      9  id,
    10  vc
    11  from  t_read_consistency trs
    12  where trs.id <= 10
    13  ) loop
    14  j := j +1;
    15  lc_t_read_cs_tab.extend;
    16  lc_t_read_cs_tab(j) := t_read_cs(x.id, x.vc);
    17  end loop;
    18  RETURN lc_t_read_cs_tab;
    19* end f_read_consistency_tab;
    SQL> /
    Function created.
    SQL> insert into t_read_consistency
      2  (id,vc)
      3  select id,vc
      4  from table(f_read_consistency_tab);
    insert into t_read_consistency
    ERROR at line 1:
    ORA-00001: unique constraint (SCOTT.SYS_C0011307) violated
    SQL> drop table t_read_consistency purge;
    Table dropped.
    SQL> create table t_read_consistency (id number, vc varchar2(15));
    Table created.
    SQL> insert into
      2  t_read_consistency
      3  select
      4  rownum id,
      5  rpad('a',15,'a')
      6  from
      7  dual
      8  connect by
      9  level<=1000;
    1000 rows created.
    SQL> commit;
    Commit complete.
    SQL> insert into t_read_consistency
      2  (id,vc)
      3  select id,vc
      4  from table(f_read_consistency_tab);
    10 rows created.
    SQL> commit;
    Commit complete.
    SQL>So, you have to add only PRAGMA AUTONOMOUS_TRANSACTION; before begin in your function code to avoid ORA-04091 in 11.2.0.1
    But, All thanks to Tubby who pointed us to the correct documentation link.
    Regards
    Girish Sharma

  • SSMS 2012: Import XML File to SQL Table - 'value' is not a recognized built-in function name!!??

    Hi all,
    I have the following xml file (books1.xml):
    <bookstore>
    <book>
    <BookID>1</BookID>
    <title>Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book>
    <BookID>2<BookID>
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    <book>
    <BookID>3<BookID>
    <title>XQuery Kick Start</title>
    <author>James McGovern</author>
    <year>2003</year>
    <price>49.99</price>
    </book>
    <book>
    <BookID>4<BookID>
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
    </book>
    </bookstore>
    In my Microsoft SQL Server 2012 Management Studio, I executed the following SQL Query code:
    --XQuery w3schools example using books1.xml in C:\Temp folder
    ---SQL Query W3books Title
    ---9 March 2015
    USE XML_XQUERY
    GO
    CREATE TABLE W3Books(
    BookID INt Primary Key,
    Title VARCHAR(30));
    INSERT INTO W3Books (BookID, Title)
    SELECT x.book.query('BookID'), value('.', 'INT'),
    x.book.query('title'), value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'C:\Temp\books1.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('W3Books/book') AS x(book);
    SELECT BookID, Title
    FROM W3Books;
    I got the following error messages:
    Msg 195, Level 15, State 10, Line 7
    'value' is not a recognized built-in function name.
    Msg 156, Level 15, State 1, Line 16
    Incorrect syntax near the keyword 'AS'.
    I don't know why I got the error of 'value' is not a recognized built-in function name. Please kindly help and tell me what is wrong in my code and how to correct the error.
    Thanks, Scott Chang
    P. S.
    (1) I mimicked the xml file and SQL Qeury code of Import XML File to SQL Table in
    http://pratchev.blogspot.com/2008/11/import-xml-file-to-sql-table.html. The xml file and the code of this sample worked in my SSMS 2012 program.
    (2) I am learning the "CAST" and "CROSS APPLY" in the Create Instances of XML Data of Microsoft MSDN - it is very abstract to me.

    Hi Stan210, Thanks for your nice response.
    I corrected my xml file as you pointed out.
    I made some changes in some code statements of my SQLQueryW3BookTitle.sql as you instructed:
    --XQuery w3schools example using books1.xml in C:\Temp folder
    ---SQL Query W3books Title
    ---10 March 2015
    USE XML_XQUERY
    GO
    CREATE TABLE W3Books(
    BookID INt Primary Key,
    Title VARCHAR(30));
    INSERT INTO W3Books (BookID, Title)
    SELECT x.book.value('/BookID[1]', 'INT'),
    x.book.value('/title[1]', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'C:\Temp\books1.xml',SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('bookstore/book') AS x(book);
    SELECT BookID, Title
    FROM W3Books;
    I executed my revised sql and I got the following Message and Results:
    Msg 515, Level 16, State 2, Line 6
    Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls. INSERT fails.
    The statement has been terminated.
    (0 row(s) affected)
    Results:
    BookID    Title
    I don't know why I just got the names of columns in Results and the "Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls, insert fails." in Messages.  Please kindly help, advise me
    how to correct the errors and respond again.
    Many Thanks again,
    Scott Chang

  • Queries on pl/sql tables within a function

    hi,
    how can i execute regular sql-queries within a function on a pl/sql table which the function has recieved as a parameter ? i have tried quite a bit and always get type mismatches or internal errors. anybody has a good example on this ?
    thanks in advance,
    stephan

    hi,
    okay, i will not post the actual code i have, because it won't make too much sense out of the context, but here are the relevant parts...
    i have a few object definitions that represent the records of the three tables (two input and one output)...
    create type t1 as object (...);
    create type t2 as object (...);
    create type t3 as object (...);
    and a package with the table definitions
    create or replace package t_defs as
    type tab_t1 is table of t1;
    type tab_t2 is table of t2;
    type tab_t3 is table of t3;
    end t_defs;
    and here is a rough sketch what the function should look like later:
    CREATE OR REPLACE FUNCTION some_function (
    tab1 IN t_defs.tab_t1, tab2 IN t_def.tab_t2)
    RETURN t_defs.tab_t3 PIPELINED IS
    TYPE refcur IS REF CURSOR;
    cur0 refcur;
    curr_rec t3 := t3(NULL, ....);
    BEGIN
    open cur0 for 'here is the statement i could not do';
    LOOP
    FETCH cur0 INTO curr_rec.....;
    EXIT WHEN cur0%NOTFOUND;
    . -- (manipulate the record) --
    PIPE ROW(curr_rec);
    END LOOP;
    RETURN;
    END;

  • Is there a custom function available which can be used for logging errors captured in a sp in a sql table

    Is there a custom function  available which can be used for logging errors captured in a sp during and after execution in a sql table?
    Basically we  would like to utilize such function  in every sp and log errors of each sp in a error log table
    Mudassar

    Thanks .
    I was able to write this however I am thinking I am missing something
    CREATE FUNCTION testfunction1()
    RETURNS @temp_error TABLE (
    id int identity(1,1),
    procedure_name varchar(255),
    line_number int,
    error_number int,
    error_message varchar(max),
    error_state int,
    error_severity int,
    occurence_datetime datetime default current_timestamp,
    user_name sysname default suser_name(),
    login_name sysname default suser_name()
    AS
    BEGIN
    insert @temp_error(procedure_name,line_number,error_number,error_message,error_state,error_severity)
    select error_procedure(),error_line(),error_number(),error_message(),error_state(),error_severity()
    RETURN;
    END;
    CREATE TYPE test_type AS TABLE(
    id int identity(1,1),
    procedure_name varchar(255),
    line_number int,
    error_number int,
    error_message varchar(max),
    error_state int,
    error_severity int,
    occurence_datetime datetime default current_timestamp,
    user_name sysname default suser_name(),
    login_name sysname default suser_name()
    GO
    create proc usp_error_test
    @test_type AS test_type READONLY
    as
    begin
    begin try
    select 1/0
    end try
    begin catch
    select * from testfunction1(@test_type)
    end catch
    end
    Mudassar

  • VO query with SQL table function (MS SQL) and update of parameter value

    Hello All,
    I use VO where Query is the SQL function that returns a table (MS SQL Server):
    select * from getData('XXXX')
    where ‘ХХХХ’ should be binded to the specific ID (e.g. selected row in the tree view on the another facet).
    More details: I have two facets. Left facet contains a tree view that displays the list of the projects grouped by industry. Right facet contains a pivot table (source query is a ‘table function’ from above).
    I want to have the pivot table (right facet) to be updated with the data specific to the project (selected row in the tree).
    I know about the possibility to dynamically update the where clause (setNamedWhereClauseParam method), but in my case there is no ‘where’ clause. Is there any kind of ‘bind variable’ to be used to refresh the data?
    Any guidance, ideas, examples are greatly welcome.
    With best wishes,
    Anatol

    Are the columns that are being selected different each time or the same?
    If they are the same then you don't need to do any additional binding - the pivot table is connected to the VO at design time and it wouldn't care if the underlying from/where have changed.
    If on the other hand your columns change (but the number of them stay the same) then use aliases for the initial definition (select ename a, id b, salary c) and then when you change the VO change the mapping but keep the names (select dname a, moo b, foo c).
    If the whole query is changing and you don't know in advance the structure - then there is no out of the box solution with a pivot table - you'll need to code a backing bean that will provide the data model to the pivot table based on your query.

  • SAP Business One Ver. 9.0 SQL Table Name

    Dear All,
    This is useful SQL Table Name for SAP Business One Ver.9.0 in details
    Name     Description
    AAC1    Asset Classes - Depreciation Areas - History
    AACP    Periods Category-Log
    AACS    Asset Classes - History
    AACT    G/L Account - History
    AAD1    Administration Extension-Log
    AADM    Administration - Log
    AADT    Fixed Assets Account Determination - History
    ABAT    Attribute - History
    ABFC    Bin Field Configuration - History
    ABIN    Bin Location - History
    ABO1    External Bank Operation Code - Rows - Log
    ABOC    External Bank Operation Code - Log
    ABOE    Bill of Exchange for Payment - History
    ABP1    Business Place Tax IDs
    ABP2    Branch Tributary Info. Log
    ABPL    Business Place
    ABSL    Warehouse Sublevel - History
    ABT1    Internal Bank Operation Codes - Accounts - Log
    ABTC    Internal Bank Operation Codes -  Log
    ABTN    Batch Numbers Master Data
    ABTW    Batch Attributes in Location
    ACD1    Credit Memo - Rows
    ACD2    Credit Memo - Area Journal Transactions
    ACD3    Credit Memo - Item Areas
    ACFP    CFOP for Nota Fiscal
    ACH1    Checks for Payment - Rows - History
    ACHO    Checks for Payment - History
    ACP1    Campaign - BPs
    ACP2    Campaign - Items
    ACP3    Campaign - Partners
    ACPN    Campaign
    ACPR    Contact Persons - History
    ACQ1    Capitalization - Rows
    ACQ2    Capitalization - Area Journal Transactions
    ACQ3    Capitalization - Item Areas
    ACR1    Business Partner Addresses - History
    ACR2    Bussiness Partners - Payment Methods-History
    ACR3    Business Partner Control Accounts - History
    ACR4    Allowed WTax Codes for BP - History
    ACR5    BP Payment Dates
    ACR7    Fiscal IDs for BP Master Data
    ACRB    Business Partner Bank Accounts - History
    ACRC    Credit Cards
    ACRD    Business Partners - History
    ACS1    Asset Classes - Depreciation Areas
    ADG1    Discount Groups Rows
    ADM1    Administration Extension
    ADM2    Administration Electronic Report
    ADMC    GL Account Determination - Criteria - History
    ADNF    DNF Code
    ADO1    A/R Invoice (Rows) - History
    ADO10    A/R Invoice - Row Structure - History
    ADO11    A/R Inv (Drawn Dpm Det) - Hist
    ADO12    A/R Invoice - Tax Extension - History
    ADO13    A/R Invoice Rows - Distributed Expenses
    ADO14    Invoice - Assembly - Rows - History
    ADO15    A/R Inv (Drawn Dpm Applied) - Hist
    ADO16    Draft - SnB properties
    ADO17    A/R Invoice - Import Process - History
    ADO18    A/R Invoice - Export Process - History
    ADO19    Bin Allocation Data - History
    ADO2    A/R Invoice - Freight - Rows
    ADO20    Intrastat Expenses
    ADO3    A/R Invoice - Freight - History
    ADO4    Documents - Tax - History
    ADO5    Withholding Tax - History
    ADO6    Documents History - Installments
    ADO7    Delivery Packages - History
    ADO8    Items in Package - History
    ADO9    A/R Invoice (Rows) - History
    ADOC    Invoice - History
    ADPA    Fixed Asset Depreciation Areas - History
    ADS1    House Bank Accounts
    ADT1    Depreciation Types - Rows - History
    ADTP    Fixed Assets Depreciation Types - History
    AEC1    Parameters for Various Types of Electronic Communication
    AEC2    Messages Processed via Electronic Communication
    AEC3    Statuses and Logs for Actions in Electronic Communication
    AECM    Electronic Communication Types or Protocols
    AEDG    Discount Groups
    AEXD    Freight Setup
    AFA1    Asset Document - Rows
    AFA2    Asset Document - Area Journal Transactions
    AFAD    Asset Document - History
    AFM1    Tax Formula Parameter Declaration
    AFML    Tax Formula Master Table
    AFPR    Posting Period-Log
    AGAR    G/L Account Advanced Rules - History
    AHE1    Absence Information
    AHE2    Education
    AHE3    Employee Reviews
    AHE4    Previous Employment
    AHE6    Employee Roles
    AHE7    Savings Payments
    AHEM    Employees
    AIGW    Item Group - Warehouse - History
    AIN1    Inventory Counting - Rows
    AIN2    Inventory Counting - UoM
    AIN3    Inventory Count - SnB
    AINC    Inventory Stock Counting
    AINS    Customer Equipment Card - History
    AIQI    Inventory Initial Quantity
    AIQR    Inventory Stock Posting (Reconcile)
    AIT1    Item - Prices - History
    AIT11    Asset Item Period Control
    AIT13    Asset Attributes
    AIT2    Items - Multiple Preferred Vendors - History
    AIT3    Items - Localization Fields - History
    AIT5    Asset Item Projects - History
    AIT6    Asset Item Distribution Rules
    AIT7    Asset Item Depreciation Params - History
    AIT8    Asset Item Balances - History
    AIT9    Item - UoM Prices
    AITB    Item Groups - History
    AITM    Items - History
    AITT    Product Tree - History
    AITW    Items - Warehouse - History
    AJD1    Journal Entry - History - Rows
    AJD2    Withholding Tax - History
    AJDT    Journal Entry - History
    AKL1    Pick List - Rows - History
    AKL2    Pick List for SnB and Bin Details
    ALR2    Dynamic message data row
    ALR3    Dynamic message data cells
    AMD1    Amout Differences Report Lines
    AMDR    Manual Distribution Rule
    AMDR1    Manual Distribution Rule - Rows
    AMGP    Material Group
    AMR1    Inventory Revaluation - History - Rows
    AMR2    Inventory Revaluation FIFO Rows (Archive)
    AMR3    Inventory Revaluation SNB
    AMRV    Inventory Revaluation - History
    ANCM    NCM Code
    AOA1    Blanket Agreement - Rows
    AOA2    Blanket Agreement - Details
    AOA3    Item Details: Activity
    AOA4    Blanket Agreement - Recurring Transactions
    AOAT    Blanket Agreement
    AOC1    Distribution Rule - Rows
    AOCR    Distribution Rule
    AOPR    Sales Opportunity
    APJ1    Project Plan Steps
    APJ2    Project Plan Steps Time Record
    APJT    Project Plan
    APKL    Pick List - History
    APLN    Price Lists
    APRC    Cost Center
    APRJ    Project Codes
    AQI1    Inventory Initial Qty Rows
    AQI2    Inventory Count - SnB
    AQR1    Inventory Stock Posting (Reconcile) Lines
    AQR2    Inventory Counting - UoM
    AQR3    Inventory Count - SnB
    ARC1    Incoming Payment - Checks - History
    ARC2    Incoming Payment - Invoices - History
    ARC3    Credit Vouchers History
    ARC4    Incoming Payment - Account List - History
    ARC5    Reciept log  vat adjustment-History
    ARC6    Incoming Payments - WTax Rows - History
    ARC7    Incoming Payments - Tax Amount per Document - History
    ARC8    Incoming Payment - TDS Entries - History
    ARCT    Incoming Payment - History
    ARI1    Add-On
    ASC1    Service Call Solutions - History
    ASC2    Service Call Inventory Expenses - History
    ASC3    Service Call Travel/Labor Expenses - History
    ASC4    Service Call Travel/Labor Expenses - History
    ASC5    Service Call Activities - History
    ASCL    History
    ASGP    Service Group for Brazil
    ASP1    Special Prices - Data Areas
    ASP2    Special Prices - Quantity Areas
    ASPP    Special Prices
    ASRN    Serial Numbers Master Data
    AST1    Sales Tax Codes - Rows
    ASTC    Sales Tax Codes
    ASTT    Sales Tax Authorities Type
    ATC1    Attachments - Rows
    ATHL    Thresholds
    ATSC    CST Code for Nota Fiscal
    ATT1    Bill of Materials - Component Items - History
    ATX1    Tax Invoice - History - Rows
    ATX2    Tax Invoice Operation Codes
    ATXI    Tax Invoice - History
    AUG1    UoM Group Detail
    AUGP    UoM Group
    AUOM    UoM Master Data
    AUSR    Archive Users - History
    AVT1    Tax Definition
    AVTG    Tax Definition
    AWEX    Workflow Engine Execution Entity
    AWFQ    SWFQ History Table
    AWH1    Tax Definition
    AWH2    WTax Definition - Rows2
    AWH3    Value Range
    AWHS    Warehouses - History
    AWHT    Withholding Tax
    AWL1    Potential Processor of Tasks
    AWL2    Input data for tasks
    AWL3    Task Notes
    AWL4    Task Output Data
    AWL5    Task Field Mapping Information
    AWLS    Workflow - Task Details
    AWMG    Workflow Manager
    AWO1    Production Order (Rows) - History
    AWO2    Production Order - Base
    AWOR    Production Order - History
    AWTS    Workflow Engine Task Table
    BGT1    Budget - Rows
    BGT2    Budget - Cost Accounting
    BGT3    Budget - Cost Accounting Rows
    BNK1    Bank Statement - Documents List
    BNK2    Bank Statement - Recommendation List
    BOC1    External Bank Operation Code - Rows
    BOE1    Bill of Exchange for Payment - Rows
    BOT1    Bill of Exchange Transactions
    BOX1    Box Definition - Rows
    BOX2    Box Definition - Accounts
    BOX3    Box Definition - Choice
    BOX4    Box Definition - Contra Accounts of Accounts
    BPL1    Branch I.E. Numbers
    BPL2    Branch Tributary Info.
    BTC1    Internal Bank Operation Codes - Accounts
    BTF1    Journal Voucher  - Rows
    BTF2    Journal Voucher Withholding Tax - History
    CASE    Internal Recon. Upgrade 2007A
    CASE1    Internal Recon. Upgrade 2007A
    CCAL    Chinese Chart of Account Level Definition
    CCFG    Company Configuration
    CCPD    Period-End Closing
    CCS1    Cycle Count Determination- Subtable
    CDC1    Cash Discount - Rows
    CDIC    Dictionary
    CFH1    Cash Flow Statement Report - History - Rows
    CFUS    Functionality Usage Statistics
    CHD1    Checks for Payment Drafts - Rows
    CHO1    Checks for Payment - Rows
    CHO2    Checks for Payment - Print Status
    CIF1    Country Specific Information
    CIN1    Correction Invoice - Rows
    CIN10    Correction Invoice - Row Structure
    CIN12    Correction Invoice - Tax Extension
    CIN13    Correction Invoice Rows - Distributed Expenses
    CIN17    Correction Invoice - Bin Allocation Data
    CIN18    Correction Invoice - Export Process
    CIN19    Correction Invoice - Bin Allocation Data
    CIN2    A/R Correction Invoice - Freight - Rows
    CIN20    Intrastat Expenses
    CIN3    A/R Correction Invoice - Freight
    CIN4    Correction Invoice - Tax Amount per Document
    CIN5    A\R Correction Invoice - Withholding Tax
    CIN6    Correction Invoice - Installments
    CIN7    Delivery Packages - Correction Invoice
    CIN8    Items in Package - Correction Invoice
    CIN9    Correction Invoice - Drawn Dpm
    CPI1    A/P Correction Invoice - Rows
    CPI10    A/P Correction Invoice - Row Structure
    CPI12    A/P Correction Invoice - Tax Extension
    CPI13    A/P Correction Invoice Rows - Distributed Expenses
    CPI14    A/P Correction Invoice - Assembly - Rows
    CPI15    A/P Corr Inv - Drawn Dpm Appld
    CPI16    A/P Corr. Inv - SnB properties
    CPI17    A/P Correction Invoice - Import Process
    CPI18    A/P Correction Invoice - Export Process
    CPI19    A/P Correction Invoice - Bin Allocation Data
    CPI2    A/P Correction Invoice - Freight - Rows
    CPI20    Intrastat Expenses
    CPI3    A/P Correction Invoice - Freight
    CPI4    A/P Correction Invoice - Tax Amount per Document
    CPI5    Withholding Tax Data
    CPI6    Documents History - Installments
    CPI7    A/P Correction Invoice - Delivery Packages
    CPI8    A/P Correction Invoice - Items in Package
    CPI9    A/P Corr. Invoice - Drawn Dpm
    CPL1    Quick Copy - Instance Log
    CPN1    Campaign - BPs
    CPN2    Campaign - Items
    CPN3    Campaign - Partners
    CPT1    Cockpit Subtable
    CPV1    A/P Correction Invoice Reversal - Rows
    CPV10    A/P CrIn Rev - Row Structure
    CPV12    A/P Correction Invoice Reversal - Tax Extension
    CPV13    A/P Correction Invoice Reversal Rows - Distributed Expenses
    CPV14    A/P Correction Invoice Reversal - Assembly - Rows
    CPV15    A/P CrIn Rev - Drawn Dpm Appld
    CPV16    A/P Correction Invoice Reversal - SnB properties
    CPV17    A/P Correction Invoice Reversal - Import Process
    CPV18    A/P Correction Invoice Reversal - Export Process
    CPV19    A/P Correction Invoice Reversal - Bin Allocation Data
    CPV2    A/P Correction Invoice Reversal - Freight - Rows
    CPV20    Intrastat Expenses
    CPV3    A/P Correction Invoice Reversal - Freight
    CPV4    A/P Correction Invoice Reversal - Tax Amt per Doc.
    CPV5    A/P Correction Invoice Reversal - WTax
    CPV6    A/P Correction Invoice Reversal - Installments
    CPV7    A/P Corr Inv Rvsl - Deliv Pkgs
    CPV8    A/P Correction Invoice Reversal - Items in Package
    CPV9    A/P Corr Inv Rvrsl - Drawn Dpm
    CRD1    Business Partners - Addresses
    CRD2    Bussiness Partners - Payment Methods
    CRD3    BP Control Account
    CRD4    Allowed WTax Codes for BP
    CRD5    BP Payment Dates
    CRD6    BP's Payer Name
    CRD7    Fiscal IDs for BP Master Data
    CRD8    BP Branch Assignment
    CRD9    OCRD Extension
    CSI1    A/R Correction Invoice - Rows
    CSI10    A/R Correction Invoice - Row Structure
    CSI12    A/R Correction Invoice - Tax Extension
    CSI13    A/R Correction Invoice Rows - Distributed Expenses
    CSI14    A/R Correction Invoice - Assembly - Rows
    CSI15    A/R Corr Inv - Drawn Dpm Appld
    CSI16    A/R Corr. Inv. - SnB properties
    CSI17    A/R Correction Invoice - Import Process
    CSI18    A/R Correction Invoice - Export Process
    CSI19    A/R Correction Invoice - Bin Allocation Data
    CSI2    A/R Corr Inv - Freight - Rows
    CSI20    Intrastat Expenses
    CSI3    A/R Correction Invoice - Freight
    CSI4    A/R Correction Invoice - Tax Amount Per Document
    CSI5    A/R Correction Invoice - Withholding Tax
    CSI6    A/R Corr. Inv. - Installments
    CSI7    A/R Corr. Inv. Deliv. Pkgs
    CSI8    A/R Corr. Inv. - Items in Pkg
    CSI9    A/R Corr. Inv. - Drawn Dpm
    CSN1    Certificate Series - Series
    CSPI    Solution Packager Information
    CSTN    Workstation ID
    CSV1    A/R Correction Invoice Reversal - Rows
    CSV10    A/R Correction Invoice Reversal - Row Structure
    CSV12    A/R Correction Invoice Reversal - Tax Extension
    CSV13    A/R Correction Invoice Reversal Rows - Distributed Expenses
    CSV14    A/R Correction Invoice Reversal - Assembly - Rows
    CSV15    A/R CrIn Rev - Drawn Dpm Appld
    CSV16    A/R Correction Invoice Reversal - SnB properties
    CSV17    A/R Correction Invoice Reversal - Bin Allocation Data
    CSV18    A/R Correction Invoice Reversal - Export Process
    CSV19    A/R Correction Invoice Reversal - Bin Allocation Data
    CSV2    A/R Correction Invoice Reversal - Freight - Rows
    CSV20    Intrastat Expenses
    CSV3    A/R Correction Invoice Reversal - Freight
    CSV4    A/R Correction Invoice Reversal - Tax Amount Per Document
    CSV5    A/R Correction Invoice Reversal - WTax
    CSV6    A/R Correction Invoice Reversal - Installments
    CSV7    A/R Correction Invoice Reversal - Delivery Packages
    CSV8    A/R Correction Invoice Reversal - Items in Package
    CSV9    A/R CrIn Rev - Drawn Dpm
    CTG1    Installment Layout
    CTNS    Transaction Notification Setting
    CTR1    Service Contract - Items
    CTR2    Service Contract - Recurring Transactions
    CUL1    Customer Usage Statistics Log
    CUMF    Folder
    CUMI    My Menu Items
    DAB1    Dashboard Queries
    DADB    Data Archive DSA Balance
    DAR1    Data Archive - Transaction Log
    DAR2    Data Archive - Transaction Log
    DAR3    Data Archive - Handwritten Documents
    DATB    Data Archive Tax Balance
    DBADM    Read-Only DB User
    DDT1    Withholding Tax Deduction Hierarchy - Rows
    DGP1    Customer List
    DGP2    Expanded Selection Criteria
    DGP3    Expanded Consolidation Options
    DGP4    Business Place List
    DGP5    Sort By List
    DLN1    Delivery - Rows
    DLN10    Delivery - Row Structure
    DLN12    Delivery - Tax Extension
    DLN13    Delivery Rows - Distributed Expenses
    DLN14    Delivery Notes - Assembly - Rows
    DLN15    Delivery - Drawn Dpm Applied
    DLN16    Delivery - SnB properties
    DLN17    Delivery - Import Process
    DLN18    Delivery - Export Process
    DLN19    Delivery - Bin Allocation Data
    DLN2    Delivery Notes - Freight - Rows
    DLN20    Intrastat Expenses
    DLN3    Delivery Notes - Freight
    DLN4    Delivery - Tax Amount per Document
    DLN5    Delivery - Withholding Tax
    DLN6    Delivery - Installments
    DLN7    Delivery Packages
    DLN8    Items in Package - Delivery
    DLN9    Delivery - Drawn Dpm
    DMW1    Query List
    DOC20    Intrastat Expenses
    DPI1    A/R Down Payment - Rows
    DPI10    A/R Down Payment - Row Structure
    DPI11    A/R DP - Drawn Dpm Detail
    DPI12    Down Payment In - Tax Extension
    DPI13    A/R Down Payment Rows - Distributed Expenses
    DPI14    A/R Down Payment - Assembly - Rows
    DPI15    A/R DP - Drawn Dpm Applied
    DPI16    A/R Down Payment - SnB properties
    DPI17    A/R Down Payment - Import Process
    DPI18    A/R Down Payment - Export Process
    DPI19    A/R Down Payment - Bin Allocation Data
    DPI2    A/R Down Payment - Freight - Rows
    DPI20    Intrastat Expenses
    DPI3    A/R Down Payment - Freight
    DPI4    A/R Down Payment - Tax Amount per Document
    DPI5    A/R Down Payment - Withholding Tax
    DPI6    A/R Down Payment - Installments
    DPI7    Delivery Packages - A/R Down Pymt
    DPI8    Items in Package - A/R Down Pmt.
    DPI9    Down Payment Incoming - Drawn Dpm
    DPO1    A/P Down Payment - Rows
    DPO10    A/P Down Payment - Row Structure
    DPO12    Down Payment - Tax Extension
    DPO13    A/P Down Payment Rows - Distributed Expenses
    DPO14    A/P Down Payment - Assembly - Rows
    DPO15    A/P DP - Drawn Dpm Applied
    DPO16    A/P Down Payment - SnB properties
    DPO17    A/P Down Payment - Import Process
    DPO18    A/P Down Payment - Export Process
    DPO19    A/P Down Payment - Bin Allocation Data
    DPO2    A/P Down Payment - Freight - Rows
    DPO20    Intrastat Expenses
    DPO3    A/P Down Payment - Freight
    DPO4    A/P Down Payment - Tax Amount per Document
    DPO5    A/P Down Payment - Withholding Tax
    DPO6    Down Payment Out - Installments
    DPO7    Delivery Packages - A/P Down Pymt
    DPO8    Items in Package - A/P Down Pmt.
    DPO9    Down Payment Outgoing - Drawn Dpm
    DPS1    Deposit - Rows
    DRF1    Draft - Rows
    DRF10    Draft - Row Structure
    DRF12    Draft - Tax Extension
    DRF13    Draft Rows - Distributed Expenses
    DRF14    Draft - Assembly - Rows
    DRF15    Draft - Drawn Dpm Applied
    DRF16    Draft - SnB - Rows
    DRF17    Draft - Import Process
    DRF18    Draft - Export Process
    DRF19    Draft - Bin Allocation Data
    DRF2    Draft - Freight - Rows
    DRF20    Intrastat Expenses
    DRF3    Draft - Freight
    DRF4    Draft Documents - Tax
    DRF5    Draft Documents - Withholding Tax
    DRF6    Document Drafts - Installments
    DRF7    Delivery Packages - Drafts
    DRF8    Items in Package - Draft
    DRF9    Document Draft - Drawn Dpm
    DRN1    Depreciation Run - Posting
    DRN2    Depreciation Run - Posting - Asset
    DSC1    House Bank Accounts
    DTP1    Depreciation Types - Rows
    DUT1    Dunning Term Array1
    DWZ1    Dunning Wizard Array1 - BP Filter
    DWZ2    Dunning Wizard Array 2-Invoice Filter
    DWZ3    Dunning Wizard Array 3 - Recommended Service Invoice
    ECM1    Parameters for Various Types of Electronic Communication
    ECM2    Messages Processed via Electronic Communication
    ECM3    Statuses and Logs for Actions in Electronic Communication
    EDG1    Discount Groups Rows
    EJB1    ERV-JAb Wizard Signing Persons
    EJB2    Docs List for ERV-JAb Wizard
    EJD1    ERV-JAb Signing Persons List
    EOY1    End of Year UDOs
    ERX1    Excise Registering Number-Rows
    FAA1    Asset Attributes - Rows
    FAC1    Fixed Asset Parameter Change - Rows
    FAC2    Fixed Asset Parameter Change - Period Control Change
    FAM1    Fixed Asset Data Migration - Rows
    FAR1    Fixed Asset Revaluation - Rows
    FCT1    Sales Forecast - Rows
    FIX1    Fixed Asset Transaction - Rows
    FLT1    856 Report - Selection Criteria
    FML1    Tax Formula Parameter Declaration
    FRC1    Extend Cat. f. Financial Rep.
    FTR1    Transfer - Rows
    FTR2    Transfer - Area Journal Transactions
    FTR3    Transfer - Item Areas
    GBI1    GBI Row 1 - Electronic Account Book
    GBI10    GBI Row 10 - Enterprise's Cash Flow Statement
    GBI11    GBI Row 11 - Devalue Provision of Enterprise Assets
    GBI12    GBI Row 12 - Shareholder's Rights and Interests Changing Report
    GBI13    GBI Row 13 - Enterprise's Profit Distribution Report
    GBI14    GBI Row 14 - Small Enterprise's Cash Flow Statement
    GBI15    GBI Row 15 - Enterprise's VAT Payable Detail Report
    GBI16    GBI Row 16 - Employees
    GBI2    GBI Row 2 - G/L Account Master Records
    GBI3    GBI Row 3 - Departments
    GBI4    GBI Row 4 - Business Partners
    GBI5    GBI Row 5 - Projects
    GBI6    GBI Row 6 - G/L Account Balance
    GBI7    GBI Row 7 - Accounting Vouchers
    GBI8    GBI Row 8 - Enterprise's Balance Sheet
    GBI9    GBI Row 9 - Enterprise's Profit and Loss Statement
    GFL1    Grid Filter Rules
    GFL2    Grid Filter Name
    GPA1    Gross Profit Adjustment - Log
    GPA2    Gross Profit Adjustments - Parameters
    GTI1    GTS Invoice Details
    GTM1    GTS Mapping Object Details
    HEM1    Absence Information
    HEM2    Education
    HEM3    Employee Reviews
    HEM4    Previous Employment
    HEM5    Employee Data Ownership Authorization
    HEM6    Employee Roles
    HEM7    Savings Payments
    HET1    Employee Transfer Details
    HLD1    Holiday Dates
    HMM1    Child Table of OHMM
    HMM2    Child Table of OHHM
    HTM1    Team Members
    IBT1    Batch Number Transactions
    ICD1    Inventory Counting Draft - Rows
    ICD2    Inventory Counting Draft - UoM
    ICD3    Inventory Count Draft - SnB
    IEI1    Incoming Excise Invoice - Rows
    IEI10    Incoming Excise Invoice - Row Structure
    IEI11    IEI - Drawn Dpm Detail
    IEI12    Incoming Excise Invoice - Tax Extension
    IEI13    Incoming Excise Invoice Rows - Distributed Expenses
    IEI14    Incoming Excise Invoice - Assembly - Rows
    IEI15    IEI - Drawn Dpm Applied
    IEI16    Incoming Excise Invoice - SnB properties
    IEI17    Incoming Excise Invoice - Import Process
    IEI18    Incoming Excise Invoice - Export Process
    IEI19    Incoming Excise Invoice - Bin Allocation Data
    IEI2    Incoming Excise Invoice - Freight - History - Rows
    IEI20    Intrastat Expenses
    IEI3    IEI - Freight
    IEI4    Incoming Excise Invoice - Tax Amount per Document
    IEI5    Incoming Excise Invoice - Withholding Tax
    IEI6    IEI - Installments
    IEI7    Delivery Packages - Incoming Excise Invoice
    IEI8    Incoming Excise Invoice - Items in Package
    IEI9    IEI - Drawn Dpm
    IGE1    Goods Issue - Rows
    IGE10    Goods Issue - Row Structure
    IGE12    Goods Issue - Tax Extension
    IGE13    Goods Issue Rows - Distributed Expenses
    IGE14    Goods Issue - Assembly - Rows
    IGE15    Gds Issue - Drawn Dpm Applied
    IGE16    Goods Issue - SnB properties
    IGE17    Goods Issue - Import Process
    IGE18    Goods Issue - Export Process
    IGE19    Goods Issue - Bin Allocation Data
    IGE2    Goods Issue - Freight - Rows
    IGE20    Intrastat Expenses
    IGE3    Goods Issue - Freight
    IGE4    Goods Issue - Tax Amount per Document
    IGE5    Goods Issue - Withholding Tax
    IGE6    Goods Issue - Installments
    IGE7    Delivery Packages - Goods Issue
    IGE8    Items in Package - Goods Issue
    IGE9    Goods Issue - Drawn Dpm
    IGN1    Goods Receipt - Rows
    IGN10    Goods Receipt - Row Structure
    IGN12    Goods Receipt - Tax Extension
    IGN13    Goods Receipt Rows - Distributed Expenses
    IGN14    Goods Receipt - Assembly - Rows
    IGN15    Gds Rcpt - Drawn Dpm Applied
    IGN16    Goods Receipt - SnB properties
    IGN17    Goods Receipt - Import Process
    IGN18    Goods Receipt - Export Process
    IGN19    Goods Receipt - Bin Allocation Data
    IGN2    Goods Receipt - Freight - Rows
    IGN20    Intrastat Expenses
    IGN3    Goods Receipt - Freight
    IGN4    Goods Receipt - Tax Amount per Document
    IGN5    Goods Receipt - Withholding Tax
    IGN6    Goods Receipt- Installments
    IGN7    Goods Receipt - Delivery Packages
    IGN8    Goods Receipt - Items in Package
    IGN9    Goods Receipt - Drawn Dpm
    ILM1    Srl & Batch Det of Inv Log Msg
    ILM2    Inventory Account Substitute
    IMT1    Acct data in selected template
    IMT11    Calculated expression's constituent with sign for specifying account in specific template
    INC1    Inventory Counting - Rows
    INC2    Inventory Counting - UoM
    INC3    Inventory Count - SnB
    INV1    A/R Invoice - Rows
    INV10    A/R Invoice - Row Structure
    INV11    A/R Invoice - Drawn Dpm Detail
    INV12    A/R Invoice - Tax Extension
    INV13    A/R Invoice Rows - Distributed Freights
    INV14    A/R Invoice - Assembly - Rows
    INV15    A/R Inv. - Drawn Dpm Applied
    INV16    A/R Invoice - SnB properties
    INV17    A/R Invoice - Import Process
    INV18    A/R Invoice - Export Process
    INV19    A/R Invoice - Bin Allocation Data
    INV2    A/R Invoice - Freight - Rows
    INV20    Intrastat Expenses
    INV3    A/R Invoice - Freight
    INV4    A/R Invoice - Tax Amount per Document
    INV5    A/R Invoice - Withholding Tax
    INV6    A/R Invoice - Installments
    INV7    A/R Invoice - Delivery Packages
    INV8    A/R Invoice - Items in Package
    INV9    A/R Invoice - Drawn Dpm
    IOD1    Inventory Initial Qty Draft Rows
    IOD2    Inventory Count Draft - SnB
    IPD1    Inventory Stock Posting Draft (Reconcile) Lines
    IPD2    Inventory Posting Draft - UoM
    IPD3    Inventory Posting Draft - SnB
    IPF1    Landed Costs - Rows
    IPF2    Landed Costs - Costs
    IPF3    Landed Costs - Customs Summary
    IQI1    Inventory Initial Qty Rows
    IQI2    Inventory Count - SnB
    IQR1    Inventory Stock Posting (Reconcile) Lines
    IQR2    Inventory Posting - UoM
    IQR3    Inventory Posting - SnB
    ISW1    Reported Business Partners
    ISW2    Intrastat Reported Items
    ISW3    Declaration Rows
    ITL1    Srl & Batch Details in Transac
    ITM1    Items - Prices
    ITM10    OITM Extension
    ITM11    Asset Item Period Control
    ITM12    UoM in Item
    ITM13    Asset Attributes
    ITM2    Items - Multiple Preferred Vendors
    ITM3    Items - Localization Fields
    ITM4    Package in Items
    ITM5    Asset Item Projects
    ITM6    Asset Item Distribution Rules
    ITM7    Asset Item Depreciation Params
    ITM8    Asset Item Balances
    ITM9    Item - UoM Prices
    ITR1    Internal Reconciliation - Rows
    ITT1    Bill of Materials - Component Items
    ITW1    Item Count Alert
    IVL1    IVL Layer Level
    IVM1    Invoice Mapping Object Details
    IVRU    Inventory Valuation Utility
    IWB1    Batch No. Quantities Backup
    IWB2    Serial No. Quantities Backup
    IWZ1    Accounts Revaluation History
    IWZ2    Inflation Warehouse Filter
    IWZ3    Items Last Revaluation Data
    JDT1    Journal Entry - Rows
    JDT2    Withholding Tax - History
    JST1    TDS Adjustment - Rows
    KPS1    KPI Set Array 1
    LGL1    Legal Data - Rows
    LLR1    Electronic Report Generation Result - Reports
    MAP1    Input and Output of Mapping
    MAP2    Mapping Input and Output Relation
    MDC1    Master Data Cleanup - Log
    MDC2    Master Data Cleanup - MD Log
    MDP1    Manual Depreciation - Rows
    MDP2    Manual Depreciation - Area Journal Transactions
    MDP3    Manual Depreciation - Item Areas
    MDR1    Manual Distribution Rule - Rows
    MIN1    Monthly Invoice Report Document Information
    MIN2    Item Imformation of MI
    MIV1    A/P Monthly Invoice - Document
    MIV2    A/P Monthly Invoice - Item
    MLS1    Distribution Lists - Recipients
    MLT1    Translations in user language
    MRV1    Inventory Revaluation Information Array
    MRV2    Inventory Revaluation FIFO Rows
    MRV3    Inventory Revaluation SNB
    MSN1    MRP Scenarios - Warehouses Array
    MSN2    MRP Run Results
    MSN3    MRP Pegging Information
    MSN4    MRP Scenarios - Items Array
    MSN5    MRP-Specific Document
    NFN1    Not a Fiscal Sequence
    NNM1    Documents Numbering - Series
    NNM4    Electronic Series
    NNM5    Document Numbering - Removed Serial Numbers
    OACD    Credit Memo
    OACG    Account Category
    OACK    Acknowledge Number
    OACM    Accumulation
    OACP    Periods Category
    OACQ    Capitalization
    OACR    Accrual Type
    OACS    Asset Classes
    OACT    G/L Accounts
    OADF    Address Formats
    OADG    Depreciation Groups
    OADM    Administration
    OADT    Fixed Assets Account Determination
    OAGM    Arguments for B1i
    OAGP    Agent Name
    OAGS    Asset Groups
    OAIM    Archive Inventory Message
    OALC    Loading Expenses
    OALI    Alternative Items 2
    OAMD    Amount Differences Report
    OARG    Customs Groups
    OARI    Add-On - Company Definitions
    OASC    Account Segmentation Categories
    OASG    Account Segmentation
    OAT1    Blanket Agreement - Rows
    OAT2    Blanket Agreement - Details
    OAT3    Item Details: Activity
    OAT4    Blanket Agreement - Recurring Transactions
    OATC    Attachments
    OBAT    Bin Location Attribute
    OBBI    Brazil Beverage Indexer
    OBBQ    Item - Serial/Batch - Bin Accumulator
    OBCA    Bank Charges Allocation Codes
    OBCD    Bar Code Master Data
    OBCG    Bank Charge for Bank Transfers
    OBDC    B1i DI Configuration
    OBFC    Bin Field Configuration
    OBFI    Brazil Fuel Indexer
    OBGD    Budget Cost Assess. Mthd
    OBGS    Budget Scenario
    OBGT    Budget
    OBIN    Bin Location
    OBMI    Brazilian Multi-Indexer
    OBNH    Bank Statement Header
    OBNI    Brazil Numeric Indexer
    OBNK    External Bank Statement Received
    OBOC    External Bank Operation Code Category
    OBOD    BIOD Master Data
    OBOE    Bill of Exchange for Payment
    OBOS    Box Set Definition
    OBOT    Bill Of Exchang Transaction
    OBOX    Box Definition
    OBPL    Business Place
    OBPP    BP Priorities
    OBSI    Brazil String Indexer
    OBSL    Warehouse Sublevel
    OBST    BoE Stamp Tax
    OBTC    Internal Bank Operation Codes
    OBTD    Journal Vouchers List
    OBTF    Journal Voucher Entry
    OBTL    Bin Transaction Log
    OBTN    Batch Numbers Master Data
    OBTQ    Batch No. Quantities
    OBTW    Batch Attributes in Location
    OBVL    Serial Numbers and Batch Valuation Log
    OCBI    Central Bank Ind.
    OCCD    Cargo Customs Declaration Numbers
    OCCS    Cycle Count Determination
    OCCT    Cost Center Type
    OCDC    Cash Discount
    OCDP    Closing Date Procedure
    OCDT    Credit Card Payment
    OCFH    Cash Flow Statement History
    OCFP    CFOP for Nota Fiscal
    OCFT    Cash Flow Transactions - Rows
    OCFW    Cash Flow Line Item
    OCHD    Checks for Payment Drafts
    OCHF    312
    OCHH    Check Register
    OCHO    Checks for Payment
    OCHP    India Chapter ID
    OCIF    Configuration of Intrastat Fields
    OCIG    CIG Codes
    OCIN    A/R Correction Invoice
    OCIP    Configuration of Integration Packages
    OCLA    Activity Status
    OCLG    Activities
    OCLO    Meetings Location
    OCLS    Activity Subjects
    OCLT    Activity Types
    OCMN    Customized Menu
    OCMT    Competitors
    OCNA    CNAE Code
    OCNT    Counties
    OCOG    Commission Groups
    OCPC    Quick Copy Config.
    OCPI    A/P Correction Invoice
    OCPL    Quick Copy Log Manager
    OCPN    Campaign
    OCPR    Contact Persons
    OCPT    Cockpit Main Table
    OCPV    A/P Correction Invoice Reversal
    OCQG    Card Properties
    OCR1    Distribution Rule - Rows
    OCRB    BP - Bank Account
    OCRC    Credit Cards
    OCRD    Business Partner
    OCRG    Card Groups
    OCRH    Credit Card Management
    OCRN    Currency Codes
    OCRP    Payment Methods
    OCRT    CRDB Tables Tree List
    OCRV    Credit Payments
    OCRY    Countries
    OCSC    Crystal Server Configuration
    OCSI    A/R Correction Invoice
    OCSN    Certificate Series
    OCSQ    Column Sequences
    OCST    States
    OCSV    A/R Correction Invoice Reversal
    OCTG    Payment Terms
    OCTR    Service Contracts
    OCTT    Contract Template
    OCUC    CUS Configuration
    OCUL    Customer Usage Statistics Log
    OCUP    CUP Codes
    OCYC    Cycle
    ODAB    Dashboard
    ODAR    Data Archiving
    ODBN    Bat. Nos - Draft - Master Data
    ODBW    Batch Draft Attribs in Locat.
    ODCC    Dashboard Cache Configuration
    ODCI    Intrastat Configuration
    ODDG    Withholding Tax Deduction Groups
    ODDT    Withholding Tax Deduction Hierarchy
    ODGL    Deduction Group List
    ODGP    Document Generation Parameter Sets
    ODIM    Cost Accounting Dimension
    ODLL    Bar Code Algorithm File
    ODLN    Delivery
    ODMC    GL Account Determination - Criteria
    ODMW    Data Migration
    ODNF    DNF Code
    ODOR    Doubtful Debts
    ODOW    Data Ownership - Objects
    ODOX    Data Ownership - Exceptions
    ODPA    Fixed Asset Depreciation Areas
    ODPI    A/R Down Payment
    ODPO    A/P Down Payment
    ODPP    Depreciation Type Pools
    ODPS    Deposit
    ODPT    Postdated Deposit
    ODPV    Fixed Assets Depreciation Value
    ODRF    Drafts
    ODRN    Depreciation Run
    ODSC    Bank Codes
    ODSN    SNs - Draft - Master Data
    ODSW    SN Draft Attribs in Location
    ODTP    Fixed Assets Depreciation Types
    ODTY    BoE Document Type
    ODUN    Dunning Letters
    ODUT    Dunning Terms
    ODWZ    Dunning Wizard
    OECDW    ECD Wizard
    OECM    Electronic Communication Types or Protocols
    OEDG    Discount Groups
    OEI1    Outgoing Excise Invoice - Rows
    OEI10    Outgoing Excise Invoice - Row Structure
    OEI11    OEI - Drawn Dpm Detail
    OEI12    Outgoing Excise Invoice - Tax Extension
    OEI13    Outgoing Excise Invoice Rows - Distributed Expenses
    OEI14    Outgoing Excise Invoice - Assembly - Rows
    OEI15    OEI - Drawn Dpm Applied
    OEI16    Outgoing Excise Invoice - SnB properties
    OEI17    Outgoing Excise Invoice - Import Process
    OEI18    Outgoing Excise Invoice - Export Process
    OEI19    Outgoing Excise Invoice - Bin Allocation Data
    OEI2    OEI - Freight Rows
    OEI20    Intrastat Expenses
    OEI3    OEI - Freight
    OEI4    Outgoing Excise Invoice - Tax Amount per Document
    OEI5    Outgoing Excise Invoice - Withholding Tax
    OEI6    Outgoing Excise Invoice - Installments
    OEI7    Delivery Packages - Outgoing Excise Invoice
    OEI8    Outgoing Ex

    Hi,
    You should post as "Write document" or "Write a blog post" option not as discussion.
    Thanks & Regards,
    Nagarajan

  • PL/SQL tables

    Hi,
    I've created some code that uses PL/SQL type of OBJECT. I used an
    example I found. The code works fine, but I am trying to understand
    exactly 'how' it works. Please see this:
    create TYPE article_record_type AS OBJECT
    (username VARCHAR2(30),
    user_id NUMBER,
    article_id NUMBER,
    teaser_subject VARCHAR2(2000),
    teaser_message CLOB,
    total_articles NUMBER);
    create TYPE article_table_type IS TABLE OF article_record_type;
    FOR v_rec IN commentary_data(v_author_id, v_num_articles) LOOP
    v_article_record.EXTEND(1);
    v_sub := v_sub + 1;
    v_article_record(v_sub) := article_record_type(v_rec.username,
    v_rec.user_id, v_rec.article_id,
    v_rec.teaser_subject, v_rec.teaser_message,
    v_rec.total_articles);
    END LOOP;
    OPEN p_data FOR SELECT * FROM TABLE (CAST (v_article_record AS
    article_table_type));
    My confusion this this: I understand the CREATE TYPE commands. I
    understand v_article_record being a table of article_table_type which
    is in itself a record of article_record_type.
    But where I assign values to v_article_record(v_sub), I do not
    understand how the values in article_record_type get there?
    v_article_record(v_sub) := article_record_type(v_rec.username,
    v_rec.user_id, v_rec.article_id,
    v_rec.teaser_subject, v_rec.teaser_message,
    v_rec.total_articles);
    article_record_type(v_rec.username.........
    If v_article_record is of type article_table_type which is a table of
    article_record_type, then why can't I use say:
    articlerecord(v_sub).username := v_rec.username. Why does it have
    to be inside article_record_type.
    I'm just trying to see how Oracle is relating all of this and how it
    works and how the values relate to the OBJECT and such.
    Thanks!
    Sandeep

    First off, there is no such thing as a PL/SQL "+table+". It is a pet peeve of mine - as the correct term for that structure is either an array or a collection. It is nothing at all like a table, and gives the misguided perception that it can be used as, and instead of, a real table. It cannot.
    User defined types in Oracle is very much the same as object class definitions in o-o languages like Java, Delphi and C#.
    When you create an object type like article_record_type - a bad choice for a name by the way as this in not a record type that you define, but an object type...
    Anyway, when you define the object type, it is in fact like defining an object class. A class has a constructor. This constructor is used to instantiate (create) objects of that class.
    There is a default constructor for an Oracle object type. This is the name of the object type (or class), followed by the properties defined for that. E.g.
    Default constructor:
       <name_of_type> ( <property1> [, <property-n> ] )
    Example:
      article_record_type( username, user_id, article_id, teaser_subject,  teaser_message, total_articles )To use this constructor to instantiate an object, you define an object variable and assign the constructor to it. E.g.
    declare
      myArticle article_record_type;
    begin
      myArticle := new article_record_type( 'John', 1, 10, 'Some subject',  null, 0 );
    end;You can also store a bunch of objects in an array - or more correctly termed a collection. For this you need to define a "+table type+" class - or more correctly termed, a collection class.
    This class can collect/contain multiple objects. It also has a constructor. It also has class methods called Count(), Extend() and so on.
    You can also define your own class methods, functions and custom constructors for your Oracle object types.
    Last comment. Review your standards for naming classes and class properties. Do not fall in the trap of twisted and warped standards so many use for Oracle. Objects should be defined using pascal case. Properties should be defined using camel case. Methods and constructors should be defined using pascal case. Underscores are not used (and this makes for a better scope resolution when dealing with SQL data columns that do use underscores as different standards are used for SQL).
    Please do yourself a huge favour and look at the de-facto programming standards for the vast majority of modern programming languages used today - and how and where and when to use lowercase, pascal case and camel case. And apply these to the PL language and object type definitions in Oracle.

  • Select in PL/SQL tables ?

    Hi,
    I have create PL/SQL Table , i want to know how can i remove the redundancy of data as
    in SQL query when i used UNION ALL or DISTINCT Operators.
    The second Question is How can show(Retrieve query) only one element in SQL
    SUCH AS
    SELECT ID from PL/SQL Table Name;
    Create or replace PACKAGE Test1 IS
    type REC_DB is RECORD
    (id number(9), name varchar2(50));
    type TB_DATA IS table of REC_DB;
    function get_coll return TB_DATA pipelined;
    temp_TB_DATA TB_DATA := TB_DATA();
    type CV_TEST is REF CURSOR return REC_DB ;
    end;
    Package created.
    Create or replace PACKAGE body TEST1 IS
    function get_coll return TB_DATA pipelined
    is
    begin
    for i in 1..temp_TB_DATA.count loop
    pipe row(temp_TB_DATA (i));
    end loop;
    return;
    end;
    end;
    Package body created.
    declare
    temp_cv TEST1.CV_TEST ;
    rc TEST1.REC_DB ;
    a number(9);
    begin
    TEST1.temp_TB_DATA.delete;
    TEST1.temp_TB_DATA.extend;
    TEST1.temp_TB_DATA(1).id:=1;
    TEST1.temp_TB_DATA(1).name:='SITI';
    TEST1.temp_TB_DATA(1).id:=2;
    TEST1.temp_TB_DATA(1).name:='OMAR';
    TEST1.temp_TB_DATA(1).id:=3;
    TEST1.temp_TB_DATA(1).name:='ALI';
    TEST1.temp_TB_DATA(1).id:=4;
    TEST1.temp_TB_DATA(1).name:='DAID';
    TEST1.temp_TB_DATA(1).id:=1;
    TEST1.temp_TB_DATA(1).name:='SITI';
    TEST1.temp_TB_DATA(1).id:=2;
    TEST1.temp_TB_DATA(1).name:='OMAR';
    -- erroring out
    open temp_cv for select * from table(TEST1.get_coll);
    fetch temp_cv into rc;
    dbms_output.put_line('Deptno is ' || rc.id);
    dbms_output.put_line('ename is ' || rc.name);
    end;
    regards

    Ayham wrote:
    I have create PL/SQL Table , i want to know how can i remove the redundancy of data as
    in SQL query when i used UNION ALL or DISTINCT Operators.Repeat. There is no such thing as a PL/SQL "table". There is no such thing as a PL/SQL "table". There is no such thing as a PL/SQL "table".
    The data structure is called an array. A table in Oracle has a very specific meaning. It is a hash or index table. Can be partitioned. Clustered. Indexed. Etc.
    A PL/SQL array is NOTHING at all like a table.
    The second Question is How can show(Retrieve query) only one element in SQL
    SUCH AS
    SELECT ID from PL/SQL Table Name;And this is almost always WRONG. As you are sending (a potentially large) array that resides in PL/SQL memory as a bind variable to the SQL engine, in order for the array's contents to be processed. Why?
    Why not simply use a (proper SQL) table and not array? A table that can be indexed. That was made for running SQL against? That can take billions of rows without exhausting server memory.
    If you are using SQL against a PL/SQL array, you are basically saying "+I have made the wrong choice for processing this data+". Yes, there are exceptions to this. But exceptions are just that - exceptions.
    So why are you using a PL/SQL array? Why do you need to use SQL against it and duplicate the array's contents as bind values? Why does SET operations in PL/SQL not suffice?

  • Pl/sql table

    How do i add rows to a pl/sql table and then use the table to open a ref cursor.

    There are several types of PL/SQL tables: Nested Table, Associative Array (pka Index By table) and VARRAY. I am assuming that you refer to the first type. In that case, this is code to declare the Collection and add some values:
    declare
    type num_tbl is table of number;
    l_num_tbl num_tbl;
    l_idx integer;
    begin
    l_num_tbl:= num_tbl(10,20);
    l_num_tbl.extend(5);
    l_num_tbl(l_num_tbl.last):= 30;
    l_num_tbl.extend;
    l_num_tbl(l_num_tbl.last):= 40;
    l_idx:= l_num_tbl.first;
    loop
    dbms_output.put_line(l_num_tbl(l_idx));
    l_idx:= l_num_tbl.next(l_idx);
    exit when l_idx is null;
    end loop;
    l_num_tbl.delete(2,3);
    dbms_output.put_line('Count after Delete:'||l_num_tbl.count);
    end;
    What you mean by your second question: "use the table to open a ref cursor" I am not entirely sure. What you can do is something like this:
    create type num_tbl is table of number
    create or replace
    function get_num_cursor
    return sys_refcursor
    is
    l_num_tbl num_tbl;
    l_idx integer;
    l_refcursor sys_refcursor;
    begin
    l_num_tbl:= num_tbl(10,20);
    l_num_tbl.extend(5);
    l_num_tbl(l_num_tbl.last):= 30;
    l_num_tbl.extend;
    l_num_tbl(l_num_tbl.last):= 40;
    open l_refcursor for select * from table(cast (l_num_tbl as num_tbl));
    return l_refcursor;
    end;
    In SQL*Plus you can then select this ref cursor:
    SQL> select get_num_cursor from d
    2 /
    GET_NUM_CURSOR
    CURSOR STATEMENT : 1
    CURSOR STATEMENT : 1
    COLUMN_VALUE
    10
    20
    30
    40
    8 rows selected.
    I hope this is what you were looking for.
    betst regards
    Lucas

  • Accessing PL/SQL table in SQL query

    Hello,
    Is it possible to use plain SQL to query PL/SQL table? In my case this table is returned by UTL_HTTP.REQUEST_PIECES function, which is defined as:
    create or replace package utl_http is
    type html_pieces is table of varchar2(2000) index by binary_integer;
    function request_pieces (url in varchar2,
    max_pieces natural default 32767)
    return html_pieces;
    pragma restrict_references (request_pieces, wnds, rnds, wnps, rnps);
    Generally, I want to access chunks of external data for comparison without using PL/SQL. Thanks ahead for ideas. Ideally, I need working example because my attempts to use TABLE & CAST failed.

    I was going to suggest you could try and create your own wrapper around utl_http and use a database type, but then I remembered this excellent thread which covers it better than I ever could - Billy, hope you don't mind passing on your good work!
    Re: Error using UTL_HTTP over HTTPS

  • How to read excel file in document library and store excel content in sql table

    Hello,
    Can anyone help me how to read the excel file present in document library and store the content inside excel into sql table?
    Please let me know the ways to acheive this. Feel free to give your suggestions.
    Thanks,
    Cool Developer

    Hi!
    this code i have written becuase i donot find any soltions on net for this , u can try with this . :)
    System.Data.OleDb.
    OleDbConnection ExcelConnection = null;
    FileMode fileMode;
    string filePath = ConfigurationManager.AppSettings["TempLoaction"] + "\\" + fileName;
    using (SPSite _site = new SPSite(SPContext.Current.Web.Url))
    using (SPWeb _web = _site.OpenWeb())
    string docLibrary = ConfigurationManager.AppSettings["DocumentLibrary"];
    SPFile _file = _web.GetFile("/" + docLibrary + "/" + fileName);
    fileMode =
    FileMode.Create;
    byte[] byteArray = _file.OpenBinary();
    MemoryStream dataStream = new MemoryStream(byteArray);
    Stream stream = dataStream;
    using (FileStream fs = File.Open(filePath, fileMode))
    byte[] buffer = new byte[4096];
    int bytesRead;
    while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) != 0)
    fs.Write(buffer, 0, bytesRead);
    fs.Close();
    //Create the Connection String
    try
    string ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;
    Data Source ='"
    + filePath + "'; Extended Properties=Excel 5.0";
    //Create the connection
    ExcelConnection =
    new System.Data.OleDb.OleDbConnection(ConnectionString);
    //create a string for the query
    string ExcelQuery;
    //Sheet1 is the sheet name
    //create the query:
    //read columns from the Excel file
    ExcelQuery =
    "Select * from [Sheet1$]"; // from Sheet1";
    //use "Select * ... " to select the entire sheet
    //create the command
    System.Data.OleDb.
    OleDbCommand ExcelCommand = new System.Data.OleDb.OleDbCommand(ExcelQuery, ExcelConnection);
    //Open the connection
    ExcelConnection.Open();
    //Create a reader
    System.Data.OleDb.
    OleDbDataReader ExcelReader;
    ExcelReader = ExcelCommand.ExecuteReader();
    //For each row after the first
    while (ExcelReader.Read())
    thanks,
    kshitij

  • Can't update a sql-table with a space

    Hello,
    In a transaktion I'm getting some Values from a SAP-ERP System via JCO.
    I update a sql-table with this values with a sql-query command.
    But sometimes the values I get from SAP-ERP are empty (space) and I'm not able to update the sql-table because of a null-value exception. (The column doesn't allow null-values). It seems that MII thinks null and space are the same.
    I tried to something like this when passing the value to the sql-query parameter but it didn't work:
    stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", " ")
    stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", " ")
    this works but I don't want to have a "_"
    stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", "_")
    Any suggestions?
    thank you.
    Matthias

    The problem is Oracle doesn't know the space function. But it knows a similar function: NVL --> replaces a null value with something else. So this statement works fine for me:
    update marc set
    LGort = '[Param.3]',
    dispo = '[Param.4]',
    schgt = NVL('[Param.5]', ' '),
    dismm = '[Param.6]',
    sobsl = NVL('[Param.7]',' '),
    fevor = '[Param.8]'
    where matnr = '[Param.1]' and werks = '[Param.2]'
    If Param.5 or Param.7 is null Oracle replaces it with a space in every other case it is the parameter itself.
    Christian, thank you for your hint with the space function. So I remembered the NVL-function.
    Regards
    Matthias

Maybe you are looking for