Constructor behaviour via INSERT SQL

Interestingly, using an object constructor itself as the insert value seems to have overheads, with the constructor being called multiple times for instantiating the single same object. Cannot recall seeing this documented.
Here's an example (on 11.2.0.2):
// the object type with a custom constructor
SQL> create or replace type TMyRow is object(
  2          id      integer,
  3          day     date,
  4          val     varchar2(10),
  5 
  6          constructor function TMyRow( i integer, d date ) return self as result
  7  );
  8  /
Type created.
// implementation of custom constructor - it uses a dynamic SQL to
// add some "SQL processing noise" for evaluation on how noisy it
// was after a call
SQL> create or replace type body TMyRow as
  2          constructor function TMyRow( i integer, d date ) return self as result is
  3          begin
  4                  DBMS_OUTPUT.put_line( 'constructing TMyRow(): id='||i||' day='||d );
  5                  self.id := i;
  6                  self.day := d;
  7                  self.val := 'TMyRow()';
  8 
  9                  execute immediate 'select '||i||' from dual foo where '||i||'='||i;
10                  return;
11          end;
12  end;
13  /
Type body created.
// table based on object type
SQL> create table mytab of TMyRow(
  2          id primary key,
  3          val default null
  4  ) organization index;
Table created.
// not what I expected - the constructor is actually called 3x and
// not a single time
SQL> insert into mytab values( TMyRow(1, sysdate) );
constructing TMyRow(): id=1 day=2012/04/10 10:21:34
constructing TMyRow(): id=1 day=2012/04/10 10:21:34
constructing TMyRow(): id=1 day=2012/04/10 10:21:34
1 row created.
// from PL/SQL, the constructor is called once only and the
// insert works without "repeating constructor" calls
SQL> declare
  2          myRow TMyRow := new TMyRow(2, sysdate);
  3  begin
  4          insert into mytab values myRow;
  5  end;
  6  /
constructing TMyRow(): id=2 day=2012/04/10 10:21:34
PL/SQL procedure successfully completed.
// as an alternative to the above 2 approaches, one can also
// use a select against DUAL to generate the object to insert -
// however it also shows 3x constructor executions
SQL> insert into mytab select TMyRow(3, sysdate) from dual;
constructing TMyRow(): id=3 day=2012/04/10 10:21:34
constructing TMyRow(): id=3 day=2012/04/10 10:21:34
constructing TMyRow(): id=3 day=2012/04/10 10:21:34
1 row created.
// the rows in the table (no duplicates of course created)
SQL> select * from mytab;
        ID DAY                 VAL
         1 2012/04/10 10:21:34 TMyRow()
         2 2012/04/10 10:21:34 TMyRow()
         3 2012/04/10 10:21:34 TMyRow()
// and here we can see the "noise factor" of the constructor - including
// that it indeed executed 3x for the same object instantiation
SQL> select executions, sql_text from v$sqlarea where upper(sql_text) like 'SELECT%FROM DUAL FOO%' order by 2;
EXECUTIONS SQL_TEXT
         3 select 1 from dual foo where 1=1
         1 select 2 from dual foo where 2=2
         3 select 3 from dual foo where 3=3
         1 select executions, sql_text from v$sqlarea where upper(sql_text) like 'SELECT%FROM DUAL FOO%' order by 2
// if the DUAL select is unbundled from the above SQL insert, the
// constructor is only executed once
SQL> select TMyRow(3, sysdate) from dual;
TMYROW(3,SYSDATE)(ID, DAY, VAL)
TMYROW(3, '2012/04/10 10:21:47', 'TMyRow()')
constructing TMyRow(): id=3 day=2012/04/10 10:21:47Why 3x? The reason seems to be the column count. 3 columns in table (3 properties in object).
4 properties or columns? Constructor is called 4x. 8 properties or columns? Constructor is called 8x.
Ugly, and very much an unexpected, overhead. Is this behaviour documented somewhere? (I could not find anything - but then I was also not sure how express this issue as a meaningful search term)

But it does not occur when calling a PL/SQL function that is not a constructorWith respect yes it does. You did not either explicitly or implicitly reference the result of that function multiple times. Try with a PL/SQL function that returns and object type with multiple attributes...
SQL> CREATE OR REPLACE FUNCTION f_tmyrow (i INTEGER, d DATE)
  2     RETURN tmyrow
  3  AS
  4     rtn tmyrow;
  5  BEGIN
  6     DBMS_OUTPUT.put_line ('returning TMyRow(): id=' || i || ' day=' || d);
  7     RETURN tmyrow (i, d, 'TMyRow()');
  8  END f_tmyrow;
  9  /
SQL> INSERT INTO mytab VALUES (f_tmyrow (1, SYSDATE));
returning TMyRow(): id=1 day=10-APR-12
returning TMyRow(): id=1 day=10-APR-12
returning TMyRow(): id=1 day=10-APR-12
1 row created.
SQL> CREATE OR REPLACE FUNCTION f_tmyrow (i INTEGER, d DATE)
  2     RETURN tmyrow DETERMINISTIC
  3  AS
  4     rtn tmyrow;
  5  BEGIN
  6     DBMS_OUTPUT.put_line ('returning TMyRow(): id=' || i || ' day=' || d);
  7     RETURN tmyrow (i, d, 'TMyRow()');
  8  END f_tmyrow;
  9  /
Function created.
SQL> INSERT INTO mytab VALUES (f_tmyrow (1, SYSDATE));
returning TMyRow(): id=1 day=10-APR-12
1 row created.
SQL>Which also rather interestingly shows that the DETERMINISTIC keyword is observed in SQL (in a within-row context) other than as a requirement for function-based indexes, something which I don't recall noticing before.
When we create a straightforward table of object type (ignoring the matter of substitutable subtypes for the moment) rather than create a single representation of the object Oracle actually creates a relational table with a column for each attribute.
Hence my educated guess would be that an SQL of the form...
INSERT INTO mytab
   SELECT tmyrow (1, SYSDATE)
   FROM   DUAL;...would need to be silently re-written (or at this would be one way of implementing this) to accomodate the above, something like...
INSERT INTO mytab (id, day, val)
   SELECT tmyrow (1, SYSDATE).id,
          tmyrow (1, SYSDATE).day,
          tmyrow (1, SYSDATE).val
   FROM   DUAL d;Note that this is behaviour is similar whether the function being called is a type constructor function, other type method or standalone/packaged PL/SQL function returning object type.
At which point we are tempted to write the above (or question why Oracle does not) to avoid this rather obvious inefficiency.
SELECT d.t.id, d.t.day, d.t.val
   FROM  (SELECT tmyrow (1, SYSDATE) t
          FROM   DUAL) d;Those who have worked with PL/SQL functions in SQL will not be surprised that we do not succeed. Looking at the projection column from explain plan for COUNT (id), COUNT (day), COUNT (val) of this SELECT (the plain SELECT does not yield a value in the projection column), we see we once again have three calls to the function.
COUNT(SYS_OP_ATG("TMYROW"."TMYROW"(1,SYSDATE@!),3,4,2))[22], COUNT(SYS_OP_ATG("TMYROW"."TMYROW"(1,SYSDATE@!),2,3,2))[22], COUNT(SYS_OP_ATG("TMYROW"."TMYROW"(1,SYSDATE@!),1,2,2))[22]If we go a step further and prevent the above view from being merged it forces our projection to be what we want, and we can see from debug that the function is now executed once only.
"ID"[NUMBER,22], "DAY"[DATE,7], "VAL"[VARCHAR2,10]This is all of course identical to how PL/SQL functions behave when queried through in-line views, hence my approach in the previous thread of tuning this as per a normal PL/SQL function call.
What I am unable to explain from the above is that there is an obvious counter-case.
SQL> INSERT INTO mytab (id, day, val)
  2     SELECT d.t.id, d.t.day, d.t.val
  3     FROM   (SELECT tmyrow (1, SYSDATE) t
  4             FROM   DUAL) d;
constructing TMyRow(): id=1 day=10-APR-12
1 row created.
SQL> From what we have seen I would expect this view to be merged and the function to be called three times, as it is with the standalone SQL...
SQL> SELECT d.t.id, d.t.day, d.t.val
  2  FROM   (SELECT tmyrow (1, SYSDATE) t
  3          FROM   DUAL) d;
      T.ID T.DAY     T.VAL
         1 10-APR-12 TMyRow()
SQL> exec null;
constructing TMyRow(): id=1 day=10-APR-12
constructing TMyRow(): id=1 day=10-APR-12
constructing TMyRow(): id=1 day=10-APR-12
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • Insert SQL does not work properly when called using CALL

    I have a stored procedure (TEST_SP) which is used to insert a record in this perticular case. The SQL statement is 2526 characters long. I'm using
    dim Params : Params=chr(1) & "Insert query" & Chr(1) & "=300"
    runsql=&"{call TEST_SP(?,?)}"&Params 
    dim db : db=dbSelect("",0,"","")
    dbExecSQL db,runsqlto execute the stored procedure. I'm facing an issue when the 2000th character on the insert SQL (pUPDSQL) is a single quote, where the SQL is not getting executed (i.e. record is not getting created).
    The same stored procedure and the same SQL when run as below
    runsql=runsql&"DECLARE "
    runsql=runsql&"PUPDSQL VARCHAR2(4000); "
    runsql=runsql&"PRES VARCHAR2(300); "
    runsql=runsql&"BEGIN "
    runsql=runsql&"PUPDSQL := 'INSERT query..."
    runsql=runsql&"PRES:=300; "
    runsql=runsql&"MRT_LKIDFULUP(PUPDSQL => PUPDSQL,PRES => PRES); "
    runsql=runsql&"END; "
    dim db : db=dbSelect("",0,"","")
    dbExecSQL db,runsqlis working fine. Does anyone know if there is a limitaion in ODBC Call function or any explanation to above behaviour? I'm connecting to a Oracle 11g database using Microsoft ODBC for Oracle driver on Window 7
    The stored procedures:
    create or replace procedure TEST_SP(pUPDSQL IN VARCHAR2,pRES OUT VARCHAR2)
    AS
    BEGIN
    DECLARE
      emsg VARCHAR2(100);
    BEGIN
    if pUPDSQL<>'-1' then
      emsg:='Cant exec UPDATE';
      EXECUTE IMMEDIATE pUPDSQL;
        if SQL%RowCount=0 then
        pRES:='ERR:No row updated';
        return;
      end if;
    end if;
    pRES:='OK:';
    EXCEPTION
      WHEN OTHERS THEN
       pRES:='ERR:' || emsg;
    END;
    END;Edited by: BluShadow on 11-Dec-2012 15:47
    added {noformat}{noformat} tags for readability.  Please read {message:id=9360002} and learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    ... I'm facing an issue when the 2000th character on the insert SQL (pUPDSQL) is a single quote, ...Perhaps you need two single quotes? like:
    runsql=runsql&"PUPDSQL := 'INSERT query...Values(..,..,,,''This value in two single quotes'',..,...)' "
    ... I'm connecting to a Oracle 11g database using Microsoft ODBC ...Dump windoze ODBC and better use the Oracle client ODBC.
    :p

  • Attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL

    I'm attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL but can't get it to work.
    I'm able to create a AQ$_JMS_MESSAGE and add it to an AQ (of the correct type) however the AQ$_JMS_MAP_MESSAGE can not be constructed in the same way as it does not have a CONSTRUCT method.
    Is it possible to create this type of JMS message with PL/SQL? The documentation seems to imply that it can be done.
    I have tried the following but get an error; the AQ table is of type SYS.AQ$_JMS_MAP_MESSAGE.
    =====================================================
    procedure addMessageToAQ AS
    --message   SYS.AQ$_JMS_MAP_MESSAGE;
    message SYS.AQ$_JMS_MESSAGE;
    eopt dbms_aq.enqueue_options_t;
    mprop dbms_aq.message_properties_t;
    enq_msgid raw(16);
    BEGIN
    message := SYS.AQ$_JMS_MESSAGE.CONSTRUCT(DBMS_AQ.JMS_MAP_MESSAGE);
    IF ( message.message_type = DBMS_AQ.JMS_MAP_MESSAGE) THEN
    DBMS_OUTPUT.PUT_LINE('The message is a map message');
    END IF;
    message.message_type := DBMS_AQ.JMS_MAP_MESSAGE;
    message.header.set_string_property('header1','hvalue1');
    message.header.set_string_property('header2','hvalue2');
    message.header.set_string_property('header3','hvalue3');
    message.set_string_property('content1', 'cvalue1');
    message.set_string_property('content2', 'cvalue2');
    message.set_string_property('content3', 'cvalue3');
    DBMS_AQ.enqueue(queue_name => 'PROCESS_PASSP_APL_Q',
    enqueue_options => eopt,
    message_properties => mprop,
    payload => message,
    msgid => enq_msgid);
    END;
    =====================================================
    ORA-25215: user_data type and queue type do not match
    ORA-06512: at "SYS.DBMS_AQ", line 204
    ORA-06512: at "BDEV1.PS2032_MVMNTHNDSHKEXTRCT", line 48
    ORA-06512: at "BDEV1.JDEV_TMP_PROC_1", line 3
    The message is a map message
    Process exited.

    As far as I know every object type in database has an implicit construct . It's just that nobody created some nice constructor. Take this example as a "hard way" to create message:
    -- jms_text_message related variables
    tmp_text_message SYS.AQ$_JMS_TEXT_MESSAGE;
    tmp_header SYS.AQ$_JMS_HEADER;
    tmp_array SYS.AQ$_JMS_USERPROPARRAY;
    -- AQ related variables
    enq_msgid RAW(16);
    eopt dbms_aq.enqueue_options_t;
    mprop dbms_aq.message_properties_t;
    -- get current date time, so it doesn't change during run of procedure
    current_datetime := TO_CHAR(SYSDATE,'DDMMYYYYHHMISS');
    -- initialize array
    tmp_array := SYS.AQ$_JMS_USERPROPARRAY(SYS.AQ$_JMS_USERPROPERTY('EVENT_TYPE', 100, 'PL_SQL', NULL, 27));
    -- create header
    tmp_header := SYS.AQ$_JMS_HEADER(SYS.AQ$_AGENT(NULL, NULL, 0), NULL, NULL, NULL, NULL, 0, tmp_array);
    -- create JMS_TEXT_MESSAGE
    tmp_text_message := SYS.AQ$_JMS_TEXT_MESSAGE(tmp_header,4,'AAAA',NULL);
    dbms_aq.enqueue(
    queue_name => 'job_queue',
    enqueue_options => eopt,
    message_properties => mprop,
    payload => tmp_text_message,
    msgid => enq_msgid);
    ...

  • How come the item value does not come thru via PL/SQL anonymous block?

    Hi,
    It's a Form with 3 tables -
    1) ClinicianProfileTb (with about 40 columns, insert/update via DML),
    2) PeopleTb (with about 7 columns, insert/update via PL/SQL anonymous block) and
    3) ClinicianPracticeTb (with about 10 columns, insert/update via PL/SQL anonymous block) for after-submit-processes.
    So I have several After-Submit-Processes. For some reason, it appears that PeopleId which is supposed to come thru via the 2nd After-Submit-Process (ie: Insert/Update PeopleTb) does not do the way it's supposed to. And when I press "Create" button at the bottom, I got the following error msg:
    ORA-01400: cannot insert NULL into ("TEST_0712"."CLINICIANPRACTICETB"."PEOPLEID")
    I tried the "debug" mode (via edit page link), but to no avail. (I'm newbie, trying to learn and deliver at the same time :)).
    I uploaded the app to apex.oracle.com, if someone could kindly take a look and let me know what goes wrong, it'd be greatly appreciated.
    workspace: test_0712
    app: 43408 - TEST
    user: demo
    pswd: demoPswd
    Page#21 -> look at the After-Submit-Processes -> in "Insert/Update PeopleTb" it appears that PeopeId does not come thru; thus it cannot be updated to ClinicianProfileTb.PeopleId (allows null) -> and thus cannot be inserted into ClincianPracticeTb.PeopleId (which does NOT allow null). Basically my logic is that in order to create ANY row in ClinicianPracticeTb, BOTH PracticeId AND PeopleId must be present.
    Acutally I should have used the PeopeTb as DML (as the driving table) to enforce that PeopleId must be present in order to insert ClinicianProfileTb and ClinicianPracticeTb, but it'd be lots of codes to write to insert/update in ClinicianProfileTb (40 columns).
    In addition, does ApEx consider EVERY SINGLE after-submit-process are in ONE transaction for commit/rollback? It appears that it treats all PL/SQL anonymous blocks are in ONE transaction, while Automatic Row Processing (DML) is commited/rolled back on its own?
    Thanks much,
    Helen

    All blocks that do not commit in one of the ways I detailed (and which do not explicitly commit using a commit statement) are part of the transaction started with > the first DML statement issued in any of the page processes and continuing until a commit is issued.Say, there are the following processes in the After-Submit-Processes:
    1. Process1 -> Automatic Row Processing (DML)
    2. Process2 -> PL/SQL anonymous block
    3. Process3 -> PL/SQL anonymous block
    Based on what you describe, in the event that if there is no explicit "commit" issued in any of these processes, then an implicit "commit" will be issued at the end of Process3?
    Thanks, Scott.
    Doreen

  • Implementing First In First Out Behaviour Using PL/SQL object types

    Hi Friends,
    I have a Integer Array of type Varray, I want to implement first in first out behaviour using Pl/SQL object type.Please provide me some idea that i can proceed. If you can provide me any sample code or any documentation,i will be very much thankful to you.Eagerly waiting for your reply.
    Thanks

    basically i have to implement a queue using pl/sql object types to traverse a tree as we can implement stack (LIFO).
    I can give an example of Stack implementation...
    CREATE or replace TYPE IntArray AS VARRAY(50) OF INTEGER;
    CREATE or replace TYPE IntStack_O AS OBJECT (
    maximalSize INTEGER
    ,top INTEGER
    ,position IntArray
    ,MEMBER PROCEDURE initialize
    ,MEMBER FUNCTION full RETURN BOOLEAN
    ,MEMBER FUNCTION empty RETURN BOOLEAN
    ,MEMBER FUNCTION getAnzahl RETURN INTEGER
    ,MEMBER PROCEDURE push (n IN INTEGER)
    ,MEMBER PROCEDURE pop (n OUT INTEGER)
    CREATE or replace TYPE body IntStack_O AS
    MEMBER PROCEDURE initialize IS
    BEGIN
    top := 0;
    -- Call Constructor und set element 1 to NULL
    position := IntArray(NULL);
    maximalSize := position.LIMIT; -- Get Varray Size
    position.EXTEND(maximalSize -1, 1); -- copy elements 1 in 2..50
    END initialize;
    MEMBER FUNCTION full RETURN BOOLEAN IS
    BEGIN
    RETURN (top = maximalSize); — Return TRUE when Stack is full
    END full;
    MEMBER FUNCTION empty RETURN BOOLEAN IS
    BEGIN
    RETURN (top = 0); — Return TRUE when Stack is empty
    END empty;
    MEMBER FUNCTION getAnzahl RETURN integer IS
    BEGIN
    RETURN top;
    END;
    MEMBER PROCEDURE push (n IN INTEGER) IS
    BEGIN
    IF NOT full
    THEN
    top := top + 1; — Push Integer onto the stack
    position(top) := n;
    ELSE
    –Stack ist voll!
    RAISE_APPLICATION_ERROR(-20101, ‘Error! Stack overflow. ‘
    ||’limit for stacksize reached.’);
    END IF;
    END push;
    MEMBER PROCEDURE pop (n OUT INTEGER) IS
    BEGIN
    IF NOT empty
    THEN
    n := position(top);
    top := top -1; — take top element from stack
    ELSE
    –Stack ist leer!
    RAISE_APPLICATION_ERROR(-20102, ‘Error! Stack underflow. ‘
    ||’stack is empty.’);
    END IF;
    END pop;
    END;
    Now if i run this..i will be getting the following output...
    DECLARE
    stack intstack_o := intstack_o(NULL,NULL,NULL);
    a INTEGER;
    BEGIN
    stack.initialize;
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.push(1111);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.push(1112);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.push(1113);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    stack.pop(a);
    dbms_output.put_line('Anzahl: ' || stack.getAnzahl);
    dbms_output.put_line(a);
    END;
    Output...
    Anzahl: 0
    Anzahl: 1
    Anzahl: 2
    Anzahl: 3
    Anzahl: 2
    1113
    Anzahl: 1
    1112
    Anzahl: 0
    1111
    Above is the Stack (Last In First Out) Implementations of integer array.Now my Requirement is Queue(First In First Out) Implementation of Integer array.

  • Creating Report via PL/SQL

    We have an application using HTML DB from which the we need to create reports for which the standard CSV will not work. The report can be created via PL/SQL except that the report needs to be created on the users workstation or a public location and not the server. Since UTL_FILE writes to the server, I am looking for help from the HTML DB and PL/SQL experts on packages/tools that can be used to output reports to local directories.

    not sure of your exact requirements, but consider using utl_file or Oracle Reports to generate your report on the server and then providing your users a "download report" link that lets them pull the file down locally. we talked about using Reports for this at...
    PDF file creation
    ...regards,
    raj

  • Invalid column Index error - While consuming Calculation view via Native SQL

    Hi Experts,
    I am trying to consume a Calculation view (sql script one) , which has input parameters, via Native SQL in a ABAP program .
    Code snippet for the same would be as follows , Upon execution, it throws an error "Invalid Column Index (8) error " . Can anyone help what could be the issue here ?
    Thanks in Advance,
    Suma
    REPORT ZTEST_HANA2.
    *Report to consume Calculation view (script based) from ABAP
    PARAMETERS: ip_docnr type BELNR_D,
                ip_gjahr type GJAHR,
                ip_bukrs type BUKRS,
                ip_blgr type FAGL_RLDNR.
       DATA: LO_SQL_STMT TYPE REF TO CL_SQL_STATEMENT,
              LO_CONN     TYPE REF TO CL_SQL_CONNECTION,
              LO_RESULT   TYPE REF TO CL_SQL_RESULT_SET,
              LV_SQL      TYPE STRING,
              LR_DATA     TYPE REF TO DATA.
        DATA: LX_SQL_EXC           TYPE REF TO CX_SQL_EXCEPTION,
              LT_SEPMAPPS_CLSDINV  TYPE TABLE OF SEPMAPPS_CLSDINV,
              LV_TEXT              TYPE STRING.
        TRY.
    lv_sql = |SELECT * FROM "_SYS_BIC"."DEMO-ABAP/CA_GET_FI_DATA" | &&
                     |WITH PARAMETERS ('placeholder'= ('$$p_DOCNR$$','{ ip_docnr }'),| &&
                      |'placeholder'=('$$p_GJAHR$$','{ ip_gjahr }')| &&
                      |,'placeholder'= ('$$S_BUKRS$$','{ ip_bukrs }')| &&
                      |,'placeholder'= ('$$p_base_ledger$$','{ ip_blgr }') )| .
             LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( ).
             "Create an SQL statement to be executed via the connection
              LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).
             "Execute the native SQL query
             LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL ).
             "Read the result into the internal table lt_sepmapps_clsdinv
             GET REFERENCE OF LT_SEPMAPPS_CLSDINV INTO LR_DATA.
             LO_RESULT->SET_PARAM_TABLE( LR_DATA ).
             LO_RESULT->NEXT_PACKAGE( ).
             LO_RESULT->CLOSE( ).
             LO_CONN->CLOSE( ).
        CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.
             LV_TEXT = LX_SQL_EXC->GET_TEXT( ).
             MESSAGE LV_TEXT TYPE 'E'.
        ENDTRY.

    Hi Suma,
    Post the SQL you success run directly on Studio together with error message (even if is the Invalid column index error).
    Check there if the parameters case is working properly... Is it really this confusing options:
    p_GJAHR
    S_BUKRS
    p_base_ledger
    Why not all lower or all upper? Anyhow you must test and find which option works according your modeling
    Regards, Fernando Da Rós

  • Can do via SQL but not via PL/SQL

    is it possible that a simple; 'create global temporary table..' SQL can run, yet same code being called from an 'execute immediate' within a PL/SQL block throw an; ORA-01031: insufficient privileges exception...(same user)
    is it a role/privilege issue or do I need to de a better job debugging?

    short version, each user will pass unique values to the proc that via dynamic sql will build these tables based on that iterative select criteria, to be used only during their current working session.
    so it's not the 'same' table in structure each time
    would not having 'TEMP grantable' be the issue?
    trying to find a way to communicate this to the DBA

  • Send an email with attacment via PL/SQL

    Hi Guru's,
    First of all thank you some much to help me all the time.
    I need to send an email via pl/sql with attachment. Email is simple but i need to attache the file from the directory on the server. File already created from different process only i need to use that file for attachment and send an email.
    I am using utl_smtp for email.
    Could you please help me out
    Thanks in advance!
    Kind regards

    user590978 wrote:
    I need to send an email via pl/sql with attachment. Email is simple but i need to attache the file from the directory on the server. File already created from different process only i need to use that file for attachment and send an email.
    I am using utl_smtp for email.You need to read the file from the directory - and format an e-mail using MIME (<i>Multipurpose Internet Mail Extensions</i>). As part of this Mime e-mail body, your code needs to add the contents of the file.
    If the file is binary, the file's contents have to base64 encoded before adding it a Mime attachment to the e-mail body.
    The complete e-mail body is then send using the SMTP DATA command.
    You can also use UTL_MAIL - it creates a Mime body for the e-mail and supports a single (small) attachment. However, you still need to read the file from disk using UTL_FILE or DBMS_LOB.LoadFromFile() and pass the file contents to UTL_MAIL for base64 encoding and attachment.
    There is no standard Oracle PL/SQL interface that supports reading the file from disk to attach to the e-mail body - so the file reading part you need to do yourself.
    If the file is large, then UTL_MAIL (a poorly designed and written interface) will be unable to handle it. In which case you also need to write the base64 encode and generation of a Mime e-mail body with attachments.

  • JBO-26041: Failed to post data to database during "Insert": SQL Statement "

    Dear All,
    I am trying to insert the data into custom table,getting the following error. Please help me to resolve the issues.
    I have created one custom table in APPS schema having the primary key and History Columns.
    Created the EO based on the custom table and generate the create method.
    Created the VO based on the EO and generated the VOImpl, RowImpl Java Files.
    I am using the PER_PEOPLE_S sequence to populate the value into Primary key column.
    Calling the below code into create method of EO object to populate the value into Primarykey column.
    setPersPersonid(getOADBTransaction().getSequenceValue("PER_PEOPLE_S"));
    oracle.apps.fnd.framework.OAException: oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement "INSERT INTO XXUTS_PERSON_T(PERS_PERSONID,PERS_FIRSTNAME,PERS_LASTNAME,CREATION_DATE,CREATED_BY,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN) VALUES (?,?,?,?,?,?,?,?)".
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(Unknown Source)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
         at xxuts.oracle.apps.csc.person.webui.XXCreatePersonCO.processFormRequest(XXCreatePersonCO.java:67)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:72)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:597)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:521)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.sql.SQLException: ORA-00911: invalid character
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3074)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:427)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5740)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4539)
         at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(Unknown Source)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2996)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2807)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1971)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2173)
         at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(Unknown Source)
         at xxuts.oracle.apps.csc.person.server.XXPersonMainAMImpl.savePersonToDatabase(XXPersonMainAMImpl.java:39)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
         at xxuts.oracle.apps.csc.person.webui.XXCreatePersonCO.processFormRequest(XXCreatePersonCO.java:67)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:72)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:597)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:521)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    java.sql.SQLException: ORA-00911: invalid character
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1161)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3001)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3074)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:427)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5740)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4539)
         at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(Unknown Source)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2996)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2807)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1971)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2173)
         at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(Unknown Source)
         at xxuts.oracle.apps.csc.person.server.XXPersonMainAMImpl.savePersonToDatabase(XXPersonMainAMImpl.java:39)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(Unknown Source)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(Unknown Source)
         at xxuts.oracle.apps.csc.person.webui.XXCreatePersonCO.processFormRequest(XXCreatePersonCO.java:67)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:72)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:597)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:521)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Thanksm
    Sai Sankilisetty

    Dear Kumar,
    I have checked the datatypes of the table and datatypes of the Pageitems, both the datatypes are same.
    I have created the region using the wizard based on the VO.
    My custom table having only 3 columns and History Columns.Out of 3 columns PersPersonid is Primary key column and I am assigning the sequence value to the column in create method of EO as below
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    setPersPersonid(getOADBTransaction().getSequenceValue("PER_PEOPLE_S"));
    //Here PER_PEOPLE_S is the Sequence
    Thanks,
    Sai

  • How do I delete an LDAP entry and all of its child entries via PL/SQL

    I need to be able to delete (via PL/SQL) an entry and all of its child entries on my OID LDAP Server. None of the the procedures in the provided DBMS_LDAP package seem to bable to do this. For example, the delete_s procedure can only delete entries that are leaf nodes (no children). This will not work for me.
    I realize that I can execute the bulk delete shell script to do this, but this is via the command line, not PL/SQL.
    While I think I could write some PL/SQL code to parse through each entry using the "search_s" procedure and delete them one by one using the "delete_s" procedure, this doesn't seem very efficient. It seems like this should be a fairly common request and Oracle should have already addressed it.

    Sorry, to be clear, it's form fields on a web page that bring up all previously entered information.... I want to deleted some of these individually, but not all

  • Inserting sql scripts in Oracle Warehouse Builder 10g

    Dear all,
    Can anyone please tell me if we can use a process flow to insert scripts in OWB 10g..
    If so, how can i do it??
    I am having a problem to insert sql scripts in OWB 10g r2.
    Infact, i have to write a script and insert it in OWB to populate data from a souce table to a target table.
    I have checked the script in sqlplus and it's working correctly (update being done).
    The problem is that how do i insert the script in OWB?? Can i use a process flow other than OMB PLUS??
    Please help me!!!
    Regards,
    Amrish

    Dear all,
    I have inserted the following script in the sqlplus activity in my process flow.
    INSERT INTO BMADW.TARGET_SALGRADE (GRADE, LOSAL, HISAL) SELECT GRADE, LOSAL, HISAL FROM SCOTT.SALGRADE;
    COMMIT;
    EXIT
    When i run the script in sql*plus, it does the insert and the commit part successfully. I have to press 'ENTER' for SQL*PLUS to exit.
    If i have to end the script, is the word 'EXIT' the right command to use??
    My process flow is deploying successfully but when starting it, still no 'INSERT' has been done. It's taking too much time to run (without giving any error).
    Please help me !!!
    Regards,
    Amrish

  • Process Flow Execution via PL-SQL

    Hi Experts,
    I am trying to execute the Process Flow, however i am unable to execute it via pl-sql method. I followed the method as described in the below link:
    http://docs.oracle.com/cd/B31080_01/doc/owb.102/b28225/api_4sqlforjobs.htm#BABBHEHI
    Example:
    sqlplus scott/tiger@orcl @sqlplus_exec_template OWB_REPO_OWNER.OWB_REPO OWF_MGR PROCESSFLOW PF1 "," ","
    I get below error message.
    SP2-0310: unable to open file "sqlplus_exec_template.sql"
    Details:
    OWB_OWNER: OWB_REPO_OWNER
    OWB_USER: OWB_PROD
    OWB_WORKSPACE: OWB_REPO
    OWF_MGR is the workflow manager.
    PF1 is the Process Flow
    Please tell me where am i going wrong.
    Regards,+
    Ravi R+

    Thanx Sutirtha
    I found the other way round
    BEGIN+
    owbsys.wb_workspace_management.set_workspace('OWB_REPO','OWB_REPO_OWNER');+
    DBMS_OUTPUT.PUT_LINE('Result: ' || TO_CHAR(owbsys.wb_rt_api_exec.run_task('PF_MOD_LOCATION1','PROCESS','PF1', null, null, 1)));+
    END;+
    where
    OWB_REPO is the workspace
    OWB_REPO_OWNER is the OWB Owner.
    PF1 is the name of my process flow

  • Retrieve SQL Agent Process ID via T-SQL below SQL Server 2008 R2 SP1.

    Dear Folks,
    I have to retrieve the process ID of SQL Agent (as shown in Configuration Manager) via T-SQL Script. It can be easily retrieved in SQL Server 2008 R2 SP1 or above using 'sys.dm_server_services'
    DMV. But I have to retrieve it in SQL Server 2008 R2 RTM and above DMV was not introduced in it. Using XP_cmdshell 'tasklist' is useless as well, as it doesn't reflect the instance specific details of SQLAgent process. Please Suggest the solution. Thanks in
    advance. :)   
    Pranshul Gupta

    Dear Folks,
    I have to retrieve the process ID of SQL Agent (as shown in Configuration Manager) via T-SQL Script. It can be easily retrieved in SQL Server 2008 R2 SP1 or above using 'sys.dm_exec_request' DMV.
    But I have to retrieve it in SQL Server 2008 R2 RTM and above DMV was not introduced in it.
    Using XP_cmdshell 'tasklist' is useless as well, as it doesn't reflect the instance specific details of SQLAgent process. Please Suggest the solution. Thanks in advance. :)   
    Pranshul Gupta
    Hello,
    Sys.dm_exec_requests DMV was introduced from sql server 2005.See this link
    http://technet.microsoft.com/en-us/library/ms177648(v=sql.90).aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Getting Session ID via PL/SQL Statement

    Hi,
    I'd like to fill an item in my form with the current session id. Can I query this id via PL/SQL statement?
    Thank you

    i think you misunderstood.....
    i'd like to fill an item on my page with the current session id using a computation. this computation has to query this id.

Maybe you are looking for

  • New OfficeJet Pro 8600 will not print

    I just got a new OfficeJet Pro 8600 a little over a week ago and have it setup on my wireless network. The first few days it worked fine, but as of yesterday I haven't been able to print anything. The computer says it's printing, but the printer isn'

  • Error while creating statspack

    i m practicing to create Statspack report oracle 9.2 on windows i created a database with the name bkp2. listener up and running. i had never run the spcreate.sql in this db before when i did run it i got the below error Creating Package STATSPACK...

  • 3D Render is different in Photoshop CS6 vs CS4 when edited

    Hope you guys can help me, because I'm really clueless on what changed in CS6 that is causing this. We have a 3D file that has a layer where we can change out the labels. The things is this, when I open the file in CS6, and try to edit it, the appear

  • Lacie Lightscribe Labeler Software?

    Does anyone know if this software will work with Lightscribe drives that are made by other companies?

  • MacBook Pro compared to MacBook

    I don't know whether this is the right forum for this question, but I'm trying to decide which Mac laptop to buy. Looks to me like if I buy a MacBook with a 2mhz Intel processor and expand the RAM to 1GB, I'll get the same performance as I would if I