PDK pl/sql add_item function and documents table

When we use the add_item function to add an item and upload its content, does the add_item function uploads document content to the document table in the repository?(like the upload_blob() function)
If yes, can I remove the uploaded document from the filesystem after having uploaded it in the documents table?
The PDK API says that there is no supported view for querying the document table. Is there any other way to query the documents in the document table? Or any additional information about how the documents are stored in the document table or how the documents table works?

Duplicate thread ->
PL/SQL add procedure with nested table
Please remove it & marked it as duplicate.
Regards.
Satyaki De.

Similar Messages

  • Master and Document Tables ...

    What relation do Master and Document tables have to parent and child tables?
    Should I declare all my created tables master and master details ? 
    how can I establish my relationships, foreign keys and primary keys with all these fields created by SAP ?

    Hi Neftali,
    You can create UDOs by using DI API, you have many threads talking about it in this forum.
    If you don't want to use UDOs (which are very useful) then you should not use MasterData,... tables because this tables shouldn't be modified by using SQL queries. These kind of tables are designed for use with UDOs to avoid the whole management of the Forms for the Add/Update/Find/Delete,... actions.
    Have you had a look to B1DE? You can download it from main B1 page in SDN for free and it generates for you the code of your addon for managing many of the aspects of the B1 SDK. You can maybe give it a try!
    You can block users from viewing/using specific menus in B1 by using the UI API.
    Regards
    Trinidad.

  • Calling functions and inserting tables based on values entered

    Hello Everyone,
    I am creating a function as below:
    create or replace function func(flags in number,Ctry in varchar2) return number
    is
    maxv number;
    flagv number;
    begin
    flagv:=1;
    select max(num) into maxv from A;
    if flags =1 then
    insert into A(num,nam) values(maxv+1,Upper(Ctry));
    else
    flagv:=0;
    end if;
    return flagv;
    end;
    The function takes two parameters-The first one will be either 0 or 1.The second one will be name of a country.
    If the first parameter is 1 then we would insert the country name passed, to the table name A.If its 0 then no insertion occurs and the function would return a value 0.
    On compiling the function I get a success!.
    When I do a
    SQL>select distinct func(0,'UK') from B;
    it works well and returns 0
    However when I do
    SQL>select distinct func(1,'UK') from B;
    I expect an output of 1 & also expect UK to be inserted as anew row in the table A.However It throws an error saying "ORA-14551: cannot perform a DML operation inside a query .."
    It is very important for me to use select to call the function, as my application would fire a select with that function and based on the value entered would insert or not insert at the back end.
    Is there any way out to do this??
    variable temps number
    exec :number :=func(1,'UK');
    does work but I cant use this in my application.
    Hope you can help! Thanks!

    create or replace function func(flags in number,Ctry in varchar2) return number
    is
    PRAGMA AUTONOMOUS_TRANSACTION;
    maxv number;
    flagv number;
    begin
    flagv:=1;
    select max(num) into maxv from A;
    if flags =1 then
    insert into A(num,nam) values(maxv+1,Upper(Ctry));
    COMMIT;
    else
    flagv:=0;
    end if;
    return flagv;
    end;
    Is the above changes in BOLD enough or I need to do something else too in order to incorporate the autonomous transaction??
    I am not too familiar with autonomous transaction.Could you please suggest the changes I need if any more required??
    Thanks a ton for your suggestions!
    Message was edited by:
    user579245
    Message was edited by:
    user579245

  • Running SQL Server Function and Procedures from Oracle

    I am trying to run SQL Server 2005 functions and/or procedures from a SQL statement in Oracle. I have gone throught the hetergeneous services and have connected to the SQL Server database successfully. I can also do a query to a table in SQL Server successfully; but I have not been able to execute a procedure or a function.

    Have you tried Oracle syntax? It seems to me that you have only tried T-SQL syntax, e.g. execute proc.
    Wrap it in a begin..end tag like you would a normal PL/SQL function or proc call. Assumption is that as Oracle makes the remote database (via the dblink) look like an Oracle database, you should also play along and pretend it is one and treat it as such.
    E.g.declare
      r integer;
    begin
      -- execute remote proc
      procFoo@dblink( 'ABC' );
      -- call a remote function
      r := funcFoo@dblink( 123 );
    end;

  • SQL Aggregate function and Subquery issues

    Hello,
    I'm trying to create an SQL statement that gives the rate of all Urgent surgeries Grouped by sector (i.e Surgery, Radiology), and Fiscal year
    To do this I need to divide the sum of surgeries with a state "Urgent" by the total surgeries
    In order to pull all the Total surgeries I would need to exclude the surgeries with the state "Cancelled", AND make sure to get rid of duplicates a single surgery may have.
    So this is what I came up with, but I'm not able to apply the following formula in SQL for the rate of Urgent surgeries:
    TOTAL OF URGENT SURGERIES / TOTAL SURGERIES
    Note that the Select statement within the WITH CLAUSE runs successfully when running it separately
    With T1 As(
    SELECT                          
    b."etat",                         
    c."secteur",                    
    d.annee_fiscale_full,                         
    d.periode,
    SUM(Count(distinct b."Cle_requete")) OVER (PARTITION BY b."etat", c."secteur", d.annee_fiscale_full, d.periode) AS TOTAL_SURGERIES
    FROM vsRequete a,                         
    vsEtats b,                         
    vsOperation c,                         
    periode_financiere d,                         
    vstemps_operatoires e                         
    WHERE b."etat" <> 'Cancelled'
    AND (b."Cle_requete" = a."Cle_vsRequete")                         
    AND (c."Cle_requete" = a."Cle_vsRequete")                         
    AND (b."Cle_requete" = c."Cle_requete")                         
    AND (a."Cle_vsRequete" = e."Cle_requete")                         
    AND c."date_operation" = d.per_fina_date                         
    GROUP BY                          
    b."etat",                         
    c."secteur",
    --a."type_visite",
    d.annee_fiscale_full,                         
    d.periode )
    SELECT
    ---- ***NOTE***: SHOULD I BE USING THE FOLLOWING ANALYTIC FUNCTION FOR THE RATE OF URGENT SURGERIES
    ---- RATIO_TO_REPORT(T1.TOTAL_SURGERIES) OVER () As URGENT_SURGERY_RATE,
    T1."secteur",                    
    --a."type_visite",
    T1.annee_fiscale_full,                         
    T1.periode
    FROM T1
    Where T1."etat" = 'Urgent'
    ORDER BY
    T1.annee_fiscale_full,                         
    T1.periode,                    
    T1."secteur";
    Thanks for your help
    Edited by: Ruben_920841 on Dec 21, 2012 1:40 PM
    Edited by: Ruben_920841 on Dec 21, 2012 1:41 PM

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    Ruben_920841 wrote:
    Hello,
    I'm trying to create an SQL statement that gives the rate of all Urgent surgeries Grouped by sector (i.e Surgery, Radiology), and Fiscal year
    To do this I need to divide the sum of surgeries with a state "Urgent" by the total surgeries
    In order to pull all the Total surgeries I would need to exclude the surgeries with the state "Cancelled", AND make sure to get rid of duplicates a single surgery may have.
    So this is what I came up with, but I'm not able to apply the following formula in SQL for the rate of Urgent surgeries:
    TOTAL OF URGENT SURGERIES / TOTAL SURGERIES
    Note that the Select statement within the WITH CLAUSE runs successfully when running it separately
    With T1 As(
    SELECT                          
    b."etat",                         
    c."secteur",                    
    d.annee_fiscale_full,                         
    d.periode,
    SUM(Count(distinct b."Cle_requete")) OVER (PARTITION BY b."etat", c."secteur", d.annee_fiscale_full, d.periode) AS TOTAL_SURGERIES Is it possible, in a group of rows with the same "Cle_requete", for some rows to have "etate"='Urgent' and other rows to have some other value besides 'Cancelled'? If so, how is that counted? Include an example or two in your sample data and results.
    FROM vsRequete a,                         
    vsEtats b,                         
    vsOperation c,                         
    periode_financiere d,                         
    vstemps_operatoires e                         
    WHERE b."etat" <> 'Cancelled'This site doesn't like to display the &lt;&gt; inequality operator. Always use the other (equivalent) inequality operator, !=, when posting here.
    AND (b."Cle_requete" = a."Cle_vsRequete")                         
    AND (c."Cle_requete" = a."Cle_vsRequete")                         
    AND (b."Cle_requete" = c."Cle_requete")                         
    AND (a."Cle_vsRequete" = e."Cle_requete")                         
    AND c."date_operation" = d.per_fina_date                         
    GROUP BY                          
    b."etat",                         
    c."secteur",
    --a."type_visite",
    d.annee_fiscale_full,                         
    d.periode )
    Select
    ----- ***NOTE***: SHOULD I BE USING THE FOLLOWING ANALYTIC FUNCTION FOR THE RATE OF URGENT SURGERIES
    ------ RATIO_TO_REPORT(T1.TOTAL_SURGERIES) OVER () As URGENT_SURGERY_RATE,That depends on your data, and your desired results. Based on what you've said so far, I think not. It's more likely that you'll want to use a CASE expression to get a count of the 'Urgent' surgeries.
    T1."secteur",                    
    --a."type_visite",
    T1.annee_fiscale_full,                         
    T1.periode
    FROM T1
    Where T1."etat" = 'Urgent'
    ORDER BY
    T1.annee_fiscale_full,                         
    T1.periode,                    
    T1."secteur";The forum FAQ {message:id=9360002} explains how to use \ tags to preserve spacing when you post formatted text, such as your query.
    It sounds like your problem is similar to this one:
    "What percentage of the employees (not counting SALESMEN)  in each department of the scott.emp table are CLERKS?"
    Here's one way you might answer that:WITH     got_cnts     AS
         SELECT     deptno
         ,     COUNT ( DISTINCT CASE
                             WHEN job = 'CLERK'
                             THEN ename
                        END
                   )               AS clerk_cnt
         ,     COUNT (DISTINCT ename)     AS total_cnt
         FROM     scott.emp
         WHERE     job     != 'SALESMAN'
         GROUP BY deptno
    SELECT     deptno
    ,     clerk_cnt
    ,     total_cnt
    ,     100 * clerk_cnt
         / total_cnt     AS clerk_pct
    FROM     got_cnts
    ORDER BY deptno
    Output:DEPTNO CLERK_CNT TOTAL_CNT CLERK_PCT
    10 1 3 33.33
    20 2 5 40.00
    30 1 2 50.00

  • How to link oracle dba_users table with SQL's sysusers and syslogin tables?

    I need to validate that the username present in the Oracle's dba_users table is the same as SQL's sysusers's isNTUSER and syslogin's name columns. How to achieve this? Someone please help me out. Thanks.

    refer these three link for information.
    http://www.oracleappshub.com/release12/r12-sla-analyzing-subledger-accounting/
    http://www.oracleappshub.com/release12/r12-sla-from-product-accounting-to-subledger-accounting/
    http://www.oracleappshub.com/release12/know-the-changes-because-of-r12-oracle-payment-module-fund-disbursement-in-ebs/

  • Using power shell function and SQL Table

    I have a table holding file path of over 1 million documents. so like column one is documentID and column two is full file path.
    Now, I want to get the file size of each of the documents. I have a function in power shell that gets the size of a file given file path.
    My problem, is I do not know how to use that function and the table to get the size of each of the files(documents).
    Help Much Appreciated!!
    ebro

    I am not clear with your questions sir. Do you mean the category this question belongs too? If so, may be some body could help redirect the question to the appropriate place.
    So what category does this belong too CM12 or Powershell?
    http://www.enhansoft.com/

  • OCI doc says Cursor and Nested table have the same bind type SQLT_RSET but they don't

    5 Binding and Defining in OCI
    PL/SQL REF CURSORs and Nested Tables in OCI
    says SQLT_RSET is passed for the dty parameter.
    If I use SQLT_RSET for the return value of a function that returns a table and pass a statement handle's address for the OCI parameter data pointer, I expected that the statement handle will be instantiated as a result of executing the function on which I can further perform fetch, similar to a cursor. But it throws exception PLS-00382: expression is of wrong type ORA-06550: line 2, column 3. Is the above documentation wrong?
    From the OCI header file I see that for varray and nested table it mentions to use SQLT_NCO. I could find no example in the OCI documentation on how to pass or receive as return value a nested value when using SQLT_NCO.
    Please help before I shoot myself.

    So the Nested table I quoted in the doc is not actually used to mean a table type below?
    create type t_resultsetdata as object (
    i int, d decimal, c varchar(10)
    create type t_nested_resultsetdata as table of t_resultsetdata;
    create function Blah return t_nested_resultsetdata  is . . .
    For this you are saying to use SQL_NTY and not SQL_NCO. Can you tell where this usage is documented, because ocidfn.h says
    #define SQLT_NTY  108                              
    /* named object type */
    #define SQLT_NCO  122 
    /* named collection type (varray or nested table) */
    Another question - Because of the original document I said I followed, I thought I could treat cursor and nested table similarly in the calling application, i.e. I could repeatedly do a fetch on the OCIStmt* which will be bound for nested table. Now from what you say I understand I can't really bind a OCIStmt* for nested table but have an object type. That means it will get all the data of that collection in one go, right? LIke I said, lack of examples is making this tough. I don't want to look into OCI source code, as that will be too much.

  • 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

  • How to identify the SQLs which are using the tables and new columns

    Hi
    I m using oracle 10G Database in windows. Developers have added some columns in some of the database tables and were asking to check whether there is some impact on performance or not. I have not done this performance tuning before. Kindly help me how to proceed further.
    How to obtain the sqls which are touching the tables and the new columns? It would be really great if you can help me with this.
    Thanks

    You can try to use DBA_DEPENDENCIES to get PL/SQL objects using tables: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_1041.htm#i1576452.
    However if SQL code is not stored in database in a trigger, a procedure, a function, a package or a view, it is impossible to retrieve all SQL code referencing some table from database dictionary: for this you would have to analyze application source code.

  • SQL Loader : Trim and Decode functions help please

    Hi,
    I have to load data from a flat file, for some columns i need to use TRIM and DECODE functions.It is a pipe delimited file.
    I get syntax errors (one is below) same error listed for TRIM.
    SQL*Loader-350: Syntax error at line xx.
    Expecting "," or ")", found "DECODE".
    ===========
    ,FINAL_BILL_DATE CHAR(30) "TRIM(:FINAL_BILL_DATE)"
    ,BUSINESS_ID "DECODE(:BUSINESS_ID,'B',1,'C',2,'E',3,'G',4,'O',5,'R',6,'T',7,'U',8,'H',9,-1)"
    Can anyone please help.
    Thanks
    Cherrish

    Hello Cherrish.
    The error you are receiving leads me to believe that at some point prior to the DECODE on the line for BUSINESS_ID, probably some line even before the FINAL_BILL_DATE line, there a syntactical error causing the quotes before the DECODE to actually terminate some other syntax. Without all of the lines that could actually contribute to this, including the header details, this is the best I can advise.
    Hope this helps,
    Luke
    Please mark the answer as helpful or answered if it is so. If not, provide additional details.
    Always try to provide create table and insert table statements to help the forum members help you better.

  • PL/SQL Pipelined Function to Compare *ANY*  2 tables

    I am trying to create a pipelined function in 10g R1 that will take the name of two tables, compare the the tables using dynamic SQL and pipe out the resulting rows using the appropriate row type. The pipelined function will be used in a DML insert statement.
    For example:
    create table a (f1 number, f2, date, f3 varchar2);
    create table b (f1 number, f2, date, f3 varchar2);
    create table c (f1 number, f2, date, f3 varchar2);
    create or replace TYPE AnyCollTyp IS TABLE OF ANYTYPE;
    create or replace TYPE CRowType IS c%ROWTYPE;
    create or replace TYPE CRowTabType IS table of CRowType;
    CREATE OR REPLACE FUNCTION compareTables (p_source IN VARCHAR2, p_dest IN VARCHAR2)
    RETURN AnyCollTyp PIPELINED
    IS
    CURSOR columnCur (p_tableName IN user_tab_columns.table_name%TYPE)
    IS
    SELECT column_name, column_id
    FROM user_tab_columns
    WHERE table_name = p_tableName
         ORDER BY column_id;
    l_cur sys_refcursor;
    l_rec ANYTYPE;
    l_stmt VARCHAR2 (32767);
    BEGIN
    l_stmt := 'select ';
    FOR columnRec IN columnCur (p_dest)
    LOOP
    l_stmt := l_stmt || CASE
    WHEN columnRec.column_id > 1
    THEN ','
    ELSE ''
    END || columnRec.column_name;
    END LOOP;
    l_stmt := l_stmt || ' from ' || p_source;
    l_stmt := l_stmt || ' minus ';
    l_stmt := l_stmt || ' select ';
    FOR columnRec IN columnCur (p_dest)
    LOOP
    l_stmt := l_stmt || CASE
    WHEN columnRec.column_id > 1
    THEN ','
    ELSE ''
    END || columnRec.column_name;
    END LOOP;
    l_stmt := l_stmt || ' from ' || p_dest;
    OPEN l_cur FOR l_stmt;
    LOOP
    FETCH l_cur
    INTO l_rec;
    PIPE ROW (l_rec);
    EXIT WHEN l_cur%NOTFOUND;
    END LOOP;
    CLOSE l_cur;
    RETURN;
    END compareTables;
    The pipelined function gets created without error. However, the testCompare procedure gets an error:
    SQL> create or replace procedure testCompare is
    begin
    insert into c
    select *
    from (TABLE(CAST(compareTables('a','b') as cRowTabType)));
    dbms_output.put_line(SQL%ROWCOUNT || ' rows inserted into c.');
    end;
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE TESTCOMPARE:
    LINE/COL ERROR
    3/4 PL/SQL: SQL Statement ignored
    5/47 PL/SQL: ORA-22800: invalid user-defined type
    Does anyone know what I am doing wrong? Is there a better way to compare any two tables and get the resulting rows?

    904640 wrote:
    Hi All,
    Is it possible to post messages to weblogic JMS queue from pl/sql procedure/function?
    From this Queue, message will be read by OSB interface.
    Any help will be highly appreciated.
    http://www.lmgtfy.com/?q=oracle+pl/sql+weblogic+jms+queue

  • Migrating Functions that return TABLE from SQL Server to Oracle

    I have some functions in SQL Server that return a TABLE datatype. When these functions are moved to Oracle 9i using Migration Workbench, they give compilation errors. In the migrated function it says that the DDL stmt is passed to the ddl file, but the table is not created. I checked the ddl stmt for temporary tables and it is wrong. Its a create table stmt with no size for varchars and we can't even edit these stmts in the workbench.
    Also the migrated function has the table name for return type, which doesn't works in Oracle. Oracle needs a datatype to be returned from Oracle.
    How do we return a table from a function?

    Yes.
    If you do not enclose the object names (table/view/index etc) in double-quotes, they are stored in uppercase format in the data dictionary.
    If you enclose them in quotes, they are stored in the same case ans you entered. As such, while accessing such objects, you need to tell Oracle not to convert the names to uppercase, hence the requirement to supply the names in quotes.

  • Can anybody tell me about SD Functionality and the main tables used in SD

    Hi,
    Can anybody tell me about SD Functionality and the main tables used in SD.
    Thanks,
    bsv.

    Hi
    SD FLOW
    SD Flow Cycle:
    INQUIRY ( VA11)
    |
    QUOTATION (VA21)
    |
    PURCHASE ORDER (ME21)
    |
    ORDER CONFIRMATION (VA01)
    |
    PICKING LIST – (VL36)
    |
    PACKING LIST - (VL02, VL01)
    |
    SHIPPING – (VT01)
    |
    INVOICE – (VF21, VF01)
    |
    AR
    Enquiry - Customer enquires about the Products services that were sold by a company - VA11
    Quotation - Company Gives a Quotation for the products and Services to a Customer
    Sales Order - Customer gives a Purchase order to the company agaionst which a Sales order will be raised to Customer in SAP.
    VBAK: Sales Document(Header Data) (VBELN)
    VBAP: Sales Document(Item Data) (VBELN,POSNR,MATNR,ARKTX,CHARG)
          Enquiry, Quotation, Sales Order are differentiated based on Doc.
          Type(VBTYP field) in VBAK,VBAP Tables( for Enquiry VBTYP = A,
          for Quotation 'B' & for Order it is 'C'.)
    Delivery(Picking, Packing, Post Goods Issue and Shipment)->
    Company sends the material after picking it from Godown and Packing it in a Handling Unit(box) and Issues the goods
    LIKP: Delivery Table (Header Data)(VBELN,LFART,KUNNR,WADAT,INCO1)
    LIPS: Delivery Table (Item Data)(VBELN,POSNR,WERKS,LGORT,MATNR,VGBEL)
          (LIPS-VGBEL = VBAK-VBELN, LIPS-VGPOS = VBAP-POSNR)
    Billing - Also company bills to the customer for those deliveries
    And in FI against this billing  Accounting doc is created.
    VBRK: Billing Table(Header Data)(VBELN,FKART,BELNR)
    VBRP: Billing Table(Item Data)(VBELN,POSNR,FKIMG,NETWR,VGBEL,VGPOS)
          (VBRP-AUBEL = VBAK-VBELN, VBRP-VGBEL = LIKP-VBELN)
          Apart from these tables there are lot of other tables which starts with
          ‘V’, but we use the following tables frequently.
    other tables and imp fields
    VBUK: All Sales Documents status & Admn. Data(Header)(VBELN,VBTYP)
          VBTYP= ‘C’(Sales Order) VBTYP=’J’(Delivery) VBTYP=’M’(Invoice) 
    VBUP: Sales Documents status & Admn. Data(Item)(VBELN,POSNR)
    VBEP: Sales Doc. Schedule Lines Data(VBELN,POSNR,EDATU,WMENG)
    VBKD: To get sales related Business data like Payment terms etc.(VBELN,ZTERM)
    VBFA: sales document flow data(VBELV,VBELN,POSNV,VBTYP)
    VBPA: Partner functions Data(VBELN,PARVW,KUNNR,LIFNR)
    VEDA: Contract Data(VBELN,VPOSN)
    VEDAPO: Contract Data(VBELN,VPOSN)
    KONA:  Rebate Agreements (KNUMA,VKORG,VTWEG,SPART)
    VBRL:  SD Document: Invoice List(VBELN,POSNR,VBELN_VF,NETWR,KUNAG)
    VKDFS: SD Index: Billing Indicator(FKTYP,VBELN,FKART,VKORG)
    VBSK:  Collective Processing for a Sales Document Header(SAMMG,SMART)
    VBSS:  Collective Processing: Sales Documents(SAMMG,VBELN,SORTF)
    VRKPA: Sales Index: Bills by Partner Functions(VBELN,BELNR,KUNDE,PARVW)
    VRPMA: SD Index: Billing Items per Material(MATNR,VBELN,BELNR,KUNNR)
    TVLKT: Delivery Type: Texts(LFART,VTEXT)
    KNA1: Customer Master-General(KUNNR,NAME1,LAND1)
    KNB1: Customer Master(Company Code)(KUNNR,BUKRS,PERNR)
    KNC1: Customer Master Data (Transaction Figures)(KUNNR,BUKRS,GJAHR)
    KNVK: Customer Master Contact Partner(PARNR,KUNNR,NAME1)
    KNVV: Customer Master sales data(KUNNR,VKORG,VTWEG,KDGRP)
    KNBK: Customer Bank Details(KUNNR,BANKS,BANKL,BANKN)
    KNVH: Customer Hierarchy (HITYP,KUNNR,VKORG,VTWEG,SPART)
    KNVP: Customer Master Partner Functions(KUNNR,PARVW,KUNN2)
    KNVS: Customer Shipment data(KUNNR,VSTEL,TRANS)
    KNVI: Customer Tax data(KUNNR,ALAND,TATYP)
    LFA1: Vendor Master-General (LIFNR,NAME1,ORT01)
    LFB1: Vendor Master(Company Code)(LIFNR,BUKRS,PERNR)
    LFC1: Vendor Master (Transaction Figures)(LIFNR,BUKRS,GJAHR)
    MARA: Material Master-General (MATNR,MTART,MATKL)
    MARC: Material Master-Plant data(MATNR,WERKS,EKGRP)
    MARD: Material Master- St.Location Data(MATNR,WERKS,LGORT,LABST)
    EBEW:  Sales Order Stock Valuation(MATNR,VBELN,BWKEY,BWTAR)
    TVKO:  Sales Organizations(VKORG)
    TVTW:  Distribution Channel(VTWEG)
    TSPA:  Divisions(SPART)
    TVKOV: Distribution Channels for S.Orgn(VKORG,VTWEG)
    TVKOS: Divisions for S.Orgn(VKORG,SPART)
    TVTA:  Sales Areas(VKORG,VTWEG,SPART)
    TVBUR: Sales Offices(VKBUR,ADRNR)
    TVKBT: Sales Office Texts(VKBUR,SPRAS,BEZEI)
    TVKBZ: Sales Office Assign.to Sales Area(VKORG,VTWEG,VKBUR)
    TVKGR: Sales Group(VKGRP)
    TVGRT: Sales Group Texts(VKGRP,SPRAS,BEZEI)
    TVBVK: Sales Group to Sales office(VKBUR,VKGRP)
    TVKWZ: Plants Assign.to S.Orgn(WERKS,VKORG)
    T171T: Sales District Texts(BZIRK,BZTXT,SPRAS)
    TVLA:  Loading Points(LSTEL)
    TVST:  Shipping Points (VSTEL)
    TVSWZ: Shipping Point to Plant(VSTEL,WERKS)
    TVPT:  Item Categories (PSTYV)
    TINC:  Customer Incoterms(INCO1)
    T077D: Customer Account Group (KTOKD)
    T001W: Plants (WERKS)
    T001L: Storage Locations (LGORT)
    T499S: Locations(WERKS,STAND,KTEXT)
    TWLAD: To get address of Storage Location and Plant(LGORT,ADRNR)
    TVAK:  Sales Document (Order) Types (AUART)
    TVAU:  Sales Documents: Order Reasons (AUGRU)
    TVFK:  Billing Document Types (FKART)
    TVLK:  Delivery Types(LFART)
    TVSB:  Shipping Conditions (VSBED)
    TTDS:  Transportation Points(TPLST)
    TVKT:  Account Assignment Groups (KTGRD)
    KONV:  Condition Types pricing)(KNUMV,KSCHL,KWETR)
    ADRC:  To get Addresses of Partners(ADDRNUMBER,NAME1)
    VBBE:  Sales Requirements: Individual records(VBELN,POSNR,MATNR)
    VBBS:  Sales Requirement totals Record(MATNR,WERKS,LGORT,CHARG)
    VBKA:  Sales Activities Data(VBELN,KTAAR)
    VBPV:  Sales Document Product Proposal(VTWEG,MATNR,KUNNR,CHARG)
    T682:  Access Sequences (KOZGF)
    T682T: Access Sequence Texts (KOZGF,VTXTM)
    T683:  Pricing Procedures (KALSM)
    T683T: Pricing Procedures Texts(KALSM,KAPPL,SPRAS,VTEXT)
    T685:  Pricing Condition Types (KSCHL)
    T685T: Condition Type Texts(KSCHL,SPRAS,KAPPL,VTEXT)
    KONH:  Conditions (Header)(KNUMH,KAPPL,KSCHL)
    KONP:  Conditions (Item)(KNUMH,KOPOS,KAPPL,KSCHL)
    KONV:  Conditions (Transaction Data)(KNUMV,KSCHL,KBERT,KWERT)
    KOND:  Conditions (KNUMD,ZUSKO,KSCHL)
    for sd go through the links
    http://www.sapgenie.com/abap/tables_sd.htm
    Please check this SD online documents.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAARCSD/CAARCSD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_SD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSD/BCBMTWFMSD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOLISPLN/LOLISPLN.pdf
    Also please check this SD links as well.
    http://help.sap.com/saphelp_47x200/helpdata/en/92/df293581dc1f79e10000009b38f889/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/dd/55f33e545a11d1a7020000e829fd11/frameset.htm
    http://www.sap-basis-abap.com/sapsd.htm
    http://www.sap-img.com/sap-sd.htm
    http://www.sapgenie.com/abap/tables_sd.htm
    http://searchsap.techtarget.com/featuredTopic/0,290042,sid21_gci961718,00.html
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/SD_tutorial.html
    All help ebooks are in PDF format here
    http://www.easymarketplace.de/online-pdfs.php
    Reward points if useful
    Regards
    Anji

  • SRRELROLES and SRGBINREL tables and Document flow in PM notifications

    Hi Folks,
    I was wondering if anyone has run across this before. Currently we are having problems in our 4.6B system when it comes to doing Document flow from a Plant Maintenance Notification. We have found the certain notifications are linked to the SRRELROLES and SRGBINREL tables and others are not. The notifications that are not linked to the tables perform the document flow and we get the correct results. The ones that have entries in the table just hang and no result is ever displayed. They system times out after about 2 1/2 hours or we have to stop the transactions to get out.
    Does anybody know what the relationship is between these two tables and how postings are made to them? Any clue as to how to resolve our hanging problem?
    Any words of wisdom would be greatly appreciated!
    Thanks you in advance.
    Joe

    Hello Joe,
    I am facing a problem regarding the table SRRELROLES . My problem is reverse that due to absense of the document in this table my function module (bbp_pd_objrel_read_via_ref) fails.
    If you had found any information about your issue could you please share with me?
    thanks in advance
    rita

Maybe you are looking for

  • How to get data off a G4 mini with a failing hard drive.

    For the record, here's how I ended up solving the problem - I had to invent this combination of approaches and it's not documented on any Web postings I could Google up during a week of working on this: Situation: Your G4 mini's hard drive dies (unbo

  • Canon IR 3235 -- snow leopard -- problems with network printer

    Hi, since yesterday I've problems to print to the network printer [canon IR 3235-3245] -- updated to snow leopard ca. 14 days ago, then experienced printing problems, search this list for answers, then downloaded new canon drivers, re-configured the

  • Connecting to an Oracle DB

    Anyone have a how-to on connecting to an Oracle database via PHP under OS X Server?

  • Having several buttons = problem

    hi all ! there are multiple buttons on the form and each are for different servlets function, all buttons have the same id and name but not the same value. So what I want is that when I press enter a certain button is pressed or at least I want to si

  • Unable to upgrade nor uninstall due to network resource being unavailable..

    Hi, I'm trying to upgrade iTunes and I received this... http://img505.imageshack.us/img505/3173/itunesbq2.jpg I also receive it when trying to uninstall it. I tried manually removing it too, which proved unsuccessful. How do I fix this? I can't find