optimize a stored procedure to insert data

Hello

I followed table structures,

Client:

ID number pk,

name varchar2 (100),

number of autooption);

CustItem:

The ItemId number,

Number of CustomerId

CustItemAdd:

(ItemId number,

Number of assets)

CustItemAddLog:)

The ItemId number,

Number of CustomerId,

LogDate date,

autooption)

I wrote after a stored procedure to load the elements of CustItemAdd to CustItem. My query select fetch 18000000, so finally I insert these many records in

2Tables, as in stored proc.

Loading of the required data, it takes about 7 hours to complete. I used addition of suspicion, he worked a little faster in sql directly, but in sp for the two statements,

It is throwing error that I can't use it in parallel.

Can I use a way to insert quickly data?

create or replace procedure SPCUSTITEMNEWSAVE

(sFlag out varchar2)

is

Start

-Boot flag

sFlag: = '0';

--===============================================================

-Insert new elements to save the table.

--=================================================================

INSERT INTO CustItemAddLog

SELECT

ca.itemId,

Cust,

SYSDATE,

Cust.autooption

OF CustItemAdd CA,.

Customer Cust

WHERE THERE IS NO

(SELECT 1 FROM custitem WHERE customer = Cust AND item = ca.itemid)

)

AND cust.autooption in (1,2)

AND (ca.active = 0

GOLD ca.active IS NULL);

--===============================================================

-Insert new elements.

--===============================================================

INSERT INTO CustItem

(

Customer,

Agenda

)

SELECT

Cust,

CA. Item,

100

OF CustItemAdd CA,.

Customer Cust

WHERE THERE IS NO

(SELECT 1 FROM custitem WHERE customer = Cust AND item = ca.itemid)

)

AND cust.autooption in (1,2)

AND (ca.active = 0

GOLD ca.active IS NULL);

--===============================================================

-Remove the downloaded items.

--===============================================================

DELETE CustItemAdd

WHERE THERE ARE

(SELECT point above CustItem WHERE, .itemid = CustItemAdd.itemid

);

COMMIT;

sFlag: = '100';

--================================================================

-Exception handling

--================================================================

EXCEPTION

WHILE OTHERS THEN

sFlag: = '300'-| SQLERRM;

ROLLBACK;

end;

Little does not return the error code in a parameter out. Next EXCEPTION WHILE OTHERS without STIMULUS is completely false. Never do this.

Now in regards to performance try using the INSERT all statement.

create or replace procedure spcustitemnewsave
is
Start
Insert / * + APPEND * /.
all the
in custitemaddlog
(
ItemId
CustomerId
LogDate
autooption
)
values)
ItemId
id
dt
autooption
)
in custitem
(
customer
element
)
values)
ID
element
)
Select ca.itemid
Cust
sysdate dt


cust.autooption
from custitemadd ca
customer cust
where there is no
(
Select 1
of custitem
where customer = Cust
and item = ca.itemid
)
and cust.autooption in (1,2)
and)
CA.active = 0 or
CA.active is null
);

delete custitemadd
where there are
(
Select the item
the custitem this
where ci.itemid = custitemadd.itemid
);

commit;
end;

Tags: Database

Similar Questions

  • Simple procedure to insert data into a table

    Hello

    I am trying to create a simple procedure to insert the data into the emp table.

    He throws after WARNING:

    The procedure that is created with compilation errors.

    CREATE or REPLACE procedure ins_emp (empno emp.empno%type,ename emp.ename%type,deptno emp.deptno%type)

    IS

    Emp.empno%type,P_ename emp.ename%type,P_deptno emp.deptno%type P_empno;

    BEGIN

    Insert into emp values (empno, ename, deptno);

    Ins_emp END;

    And when I try to run it

    execute ins_emp(1111,'abcd',20);

    He is to launch another error:

    PLSQL - 00905:OBJECT SCOTT. INS_EMP is not valid.

    can someone help me with this procedure?

    Thank you

    Hi Frank,.

    I thank very you much for your comments.

    I have a question:

    unless the procedure or function created with compilation errors, we cannot run them right.

  • Write a stored procedure to insert records in a database to a different database


    I have two databases A and B and I have to insert some data in the table of A database to the database of B. So I (TWO TABLE NAMES SHOULD BE TABLE1 (A) AND table 2 (B))

    PROCEDURE XYZ

    BEGIN

    INSERT SCHEMA_NAME. TABLE2

    SELECT (COLUMN1

    COLUMN2,...)                               OF A.TABLE1;

    COMMIT;

    END XYZ;

    BUT I GET ERRORS LIKE TABLE OR VIEW DOES NOT EXIST, BUT IN REALITY THERE ARE.

    HERE'S A CODE EXAMPLE

    PROCEDURE sp_readrecords ()in_run_iIN NUMBER( )

    IS


    err_i
    NUMBER : = NULL;


    err_x  
    VARCHAR2 (500) := NULL;

    BEGIN

    SAVEPOINT read_records ;

    INSERT IN OTS_OWN . CSXT_RAIL_PROFILE_FILE

    SELECT header_g DE TMS . OTC_RAIL_PROFILE_FILE -TABLE OR VIEW does NOT EXIST

    INSERT IN OTS_OWN . CSXT_RAIL_PROFILE_MEASURE

    SELECT track_segment_prefix_i

    , reference_milepost_i

    , location_offset_feet_q

    , track_type_c

    , rail_left_right_c

    , height_wear_q

    , ctog_wear_q

    , rail_weight_q

    , latitude_m

    , error_s

    , error_x

    , last_update_d

    DE TMS . OTC_RAIL_PROFILE_MEASUREMENT ;

    1. TMS . PKG_TRUNCATE_OTC . TMS . PKG_TRUNCATE_OTC ;------------ TMS. PKG_TRUNCATE_OTC MUST BE DECLARED

    COMMIT;

    EXCEPTION

    WHEN Others

    THEN

    err_i: = SQLCODE;

    err_x: = SQLERRM;

    ROLLBACK TO SAVEPOINT read_records ;

    csxp_refresh_tabs . sp_csxt_log

    (


    in_run_i

    , "Error reading
    Accounts CSXT_RAIL_PROFILE_OR_MEASURE

    , err_i

    , err_x

    );       

    END sp_readrecords ;

    WHERE THE MSDS IS A DATABASE AND OTS_OWN IS A DIAGRAM OF DATABASE OF OTC

    Hello 8dd...

    The problem that you have not given the link of database for the remote table:

    INSERT INTO OTS_OWN. CSXT_RAIL_PROFILE_FILE

    SELECT header_g TMS. OTC_RAIL_PROFILE_FILE; - TABLE OR VIEW does NOT EXIST

    In this case this table looks like because it would be in the local database.

    If this table is in a remote database, you must extend this object with the database link.

    You can find links to db: SELECT * FROM DBA_DB_LINKS;

    After that, you already know what db connection you want to use (there could be several), then you must extend each reference object with this link:

    For example:

    INSERT INTO OTS_OWN. CSXT_RAIL_PROFILE_FILE

    SELECT header_g TMS. OTC_RAIL_PROFILE_FILE@your_db_link; - TABLE OR VIEW does NOT EXIST

    I hope it helps.

    Kind regards

    David

  • C# Oracle.DataAccess calling a stored procedure with a date parameter throws formatexception

    C# Oracle.DataAccess CommandType.StoredProcedure is OracleDbType. Date

    I can't get my code to call an oracle procedure that has an order date.

    I receive a System.FormatException occurred in Oracle.DataAccess.dll

    I tried to assign the param. Value = DateTime and also tried assigning as a string formatted with no luck.

    What is the magic formula, I need to call this function?

    Here is a code snippet:

    OracleCommand cmd = new OracleCommand();

    cmd connection group appConn;.

    cmd.CommandText = "mypackage.myprocedure";

    cmd.CommandType = CommandType.StoredProcedure;

    Param = new OracleParameter ("iDateParamter", OracleDbType.Date, ParameterDirection.Input);

    Param. Value = "August 31, 2015."

    Here are other formats I' tried... ved param. Value = myDateValue.ToString ("dd - MMM-yyyy"). ToUpper(); (/ / "MM/dd/yyyy"); 'YYYY-MM-dd'); "MM-dd-yyyy");

    cmd. Parameters.Add (param);

                BindByName. cmd = true;

                cmd ExecuteNonQuery());

    Shame on me..., you can close this message

    It was not for the error on my date field, I had another parameter that has been attributed to a string instead of an integer.

    For the record, this has worked well for me:

    Param = new OracleParameter ("iActvyPerDate", OracleDbType.Date, ParameterDirection.Input);

    Param. Value = li. ActvyPerDate.ToString ("dd-MMM-yyyy"). ToUpper();

  • Problem to INSERT INTO using the stored procedure in 10g

    I use a 10g R2 database.

    I created two tables as follows:
    SQL > create table t1 (c1 varchar2 (1), number (1) c2, c3 number (1);)
    SQL > create table t2 (deptid varchar2 (4), empid varchar (4), varchar2 (1) c1, c2 number (1) c3 number (1);)

    insert into t1 values ('A', 3, 5);
    insert into t1 values ('B', 5, 5);
    insert into t1 values ('C', 5, 5);

    I want to create a stored procedure to insert data into table t1 t2 and certain parameters of the procedure.
    Is this possible?
    As an example:
    SQL > execute test (1,2)

    This procedure will be insert these two parameters in table t2 AND select rows in table t1 and insert into table t2 at the same time.
    How can I write the procedure?
    Tip:
    SQL > create or replace procedure
    (v_deptid, v_empid number)
    is
    BEGIN
    Insert into t2 (deptid, empid, c1, c2, c3)
    ... Select c1, c2, c3 from t1;
    end;

    My question is: How can I insert the v_deptid and v_empid parameters at the same time?

    Try

    SQL > create or replace procedure
    (v_deptid, v_empid number)
    is
    BEGIN
    Insert into t2 (deptid, empid, c1, c2, c3)
    Select v_deptid, v_empid, c1, c2, c3 to t1;
    end;

  • Insert data into the same table based on certain conditions

    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.

    How to achieve that?

    Thank you.

    978184 wrote:
    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & CurrentInstallment

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).

    You can do this way:

    This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.

    insert into your_table
    (col1, col2, col3...current_installment, month_field)
    select col1, col2, col3..,
           current_installment +
           case when paidamount > 0 and current_installment < total_installment then
            row_number() over (
                                partition by column1, column2,.. columnn      -->You may choose partition if you want the
                                                                              --Increment of Current_installment to reset after particular combination ends
                                order by primary_key        -->Order the Increment, you may choose to add more columns to order by
                              )
          else
            0                                               --> if condition is not met, then Add 0
          end curr_installment,
          add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month
      from your_table;
    
  • stored procedure - insert clob obj - msg error: ORA-01460: unimplemented

    Hi all

    I have a situation where I want to insert an object, clob to my local table using a stored procedure. The clob object stores the large amount of text. The clob data are met to retrieve the content in an external text file. When you run an insert statement in the c# code, the information was inserted successfully. When you run the stored procedure to insert the information, I always "ORA-01460: letter dead or unreasonable conversion requested". I use the StreamReader class ReadToEnd() to extract the context of the external text file. Does anyone know why Oracle is behaving in this way? Thanks for help in advance.



    TABLE DEFINITION FOR CLOB_TEST
    Name       Type         Nullable Default Comments 
    ---------- ------------ -------- ------- -------- 
    PKG_NAME   VARCHAR2(50) Y                         
    PKG_DESC   CLOB         Y                         
    PKG_FAM_ID NUMBER       Y                         
    STORED PROCEDURE
    procedure InsertTempReleaseTable(p_name        in varchar2,
                                       p_description in clob,
                                       p_fam_id      number) is
      begin
        insert into clob_test
          (pkg_name, pkg_desc, pkg_fam_id)
        values
          (p_name, p_description, p_fam_id);
      end InsertTempReleaseTable;
    EXTRACT THE CONTENTS OF A TEXT FILE
    public string GetTextFileContents(string path)
            {
                using (StreamReader sr = new StreamReader(path))
                {                
                      return (sr.ReadToEnd());
                }
            }
    C# CALL THE INSERT STORED PROCEDURE
    using (OracleCommand cmd = (OracleCommand)database.GetStoredProcCommand("pkg_sptbuildstatus.InsertTempReleaseTable"))
                {
                    cmd.Parameters.Add("p_name", OracleType.VarChar, 255).Value = obj.PackageName;  // string   
                    cmd.Parameters.Add("p_description", OracleType.Clob).Value = obj.ChangeDescription; // string
                    cmd.Parameters.Add("p_fam_id", OracleType.Number).Value = obj.FamilyId; // int
    
                    database.ExecuteNonQuery(cmd);
                }
    Published by: user8976335 on January 11, 2010 16:28

    Published by: user8976335 on January 11, 2010 16:59

    Published by: user8976335 on January 11, 2010 16:59

    Published by: user8976335 on January 12, 2010 10:48

    Well, that may (or may not) be useful to you.

    Can you test your routine with CLOB less than 32K in size (and see if this attempt is successful)?

    IF Yes, then it is possible, that's your problem...

    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:122012348063]

    "
    they are so NOT to cross a clob, they pass a string.

    In Java or ProC or OIC you can create a clob customer, fill it and pass it.

    My guess is that they use a string and a string is not a clob and a string will be limited
    for 32 k as a variable binding, or 4000 bytes as a literal in a sql statement.
    "

  • Problem with stored procedure and validation

    I have the following stored procedure:

    create or replace PROCEDURE SOME_PROC)

    /*

    Some settings

    */

    ) AS

    NUMBER of errors

    BEGIN

    errors: = FN_CHECK_BUSINESS_RULE_1 (/ * some args * /);

    if(Errors > 0) then

    raise_application_error (ERR_CONSTANTS. SOME_ERROR_NUMBER, ERR_CONSTANTS. SOME_ERROR_MESSAGE);

    end if;

    INSERT INTO une_table (/ * columns * /) VALUES (/ * values * /);

    END SOME_PROC;

    Because the business rule 1 is placed inside the stored procedure I can't check it out without calling the stored procedure.

    I need to call the stored procedure 10 times with a different set of parameters and validation of the changes only after all calls to the stored procedure

    are successful. I want to show the user all the errors that occurred during the stored procedure calls. If for a first example of stored procedure call

    succeeds and a second failure no data has to be stored in a database.

    How to prevent the stored procedure for insert lines until I call the method commit of ApplicationModule?

    Thanks in advance.

    No, other users only see the lines until you commit. The search term is the transaction isolation level. Tom Kite write a paper on this here ask Tom: on transaction isolation levels. This article gives some samples, according to theory, and you should read it.

    Timo

  • Transaction in stored procedure not treated as Atomic?

    Hello

    I have a stored procedure that inserts a line in a table called reservations and also decrement the places available for an event.

    For example: at an event, there are 100 places available. After you add a reservation, it will be left only 99 seats.

    I also have a Java program that sends 100 concurrent transactions to the database.

    After 100 transactions, there are 100 reservations, but there are still about 60 free places.

    So, I guess that the transaction he has not treated as atomic. I don't know why some transactions fail?

    The code of the stored procedure:

    create or replace PROCEDURE procedureOne (s_price, NUMBER, NUMBER, of s_customer)

    s_event NUMBER, DATE, s_movie NUMBER of s_dat)

    IS

    s_ev NUMBER;

    s_free NUMBER: = 0;

    BEGIN

    commit;

    Set transaction read write;

    Start

    SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

    Select Event_ID, Free_seats EN s_ev, s_free

    events

    where ID_Movie = s_movie;

    If s_free > 0 then

    Start

    update events set Free_seats = s_free-1;

    insert into values of reservations (seqa_seq. NEXTVAL, s_dat, s_customer, s_event, s_price);

    commit;

    end;

    on the other

    Start

    Rollback;

    end;

    end if;

    end;

    commit;

    end procedureOne;

    invatacelul wrote:

    So, I guess that the transaction he has not treated as atomic. I don't know why some transactions fail?

    You said: "I also have a Java program that sends 100 concurrent transactions to the database. Atomicity applies to a single transaction - it says transaction executes all or nothing. Is what you run in isolation. If you want isolation unless you serialize, transaction 2 sees no uncommitted transaction 1 results because the READ COMMITTED isolation level indicates that a transaction can read only the data that has been committed to the database. And since you wrote your code as SELECT + UPDATE you get results you never expected. Use:

    UPDATE OF EVENTS

    SET FREE_SEATS = FREE_SEATS - 1

    WHERE ID_Movie = s_movie

    AND FREE_SEATS > 0;

    SY.

  • Appellant DB stored procedures before committing changes.

    Hello

    I use JDeveloper 11.1.1.6.0.

    I have a use case that requires me to do the following:

    When you create a new transaction in master-detail, I have to call a stored procedure that selects the transaction full master/detail and insert it into a table to archive. To resolve this problem, I have substituted the beforeCommit method in the implementation of AM class and call the stored procedure from the pharmacokinetics of the current line in my header VO. I found this solution after reading [http://www.oracle.com/technetwork/developer-tools/jdev/index-092937.html] written by Steve Meunch. More specifically the following, that I needed the whole transaction in the database before calling the stored procedure.

    + POST-FORMULAIRES-COMMIT

    Run the code after the "posted" all the lines necessary for the database, but before issuing the VALIDATION data at the end of the transaction. If you want a single block of code for the entire transaction, you can override the doCommit() method in a custom DBTransactionImpl object and write code before calling super. To run the code specific to the entity before validation for each entity affected under the operation, override the method beforeCommit() on your entity object and write the code it. +

    The second part of the use case allows a deletion on the header only. This action should also call the stored procedure and insert the transaction full master/detail in the table of archive. To do this, my previous solution does not work. The current line is not the line that has been deleted. In the article referenced above, I assumed that the following could offer me the solution,

    + PRE DELETE

    Run the code before the line removed the datablock is REMOVED from the database during the processing of "post". Method doDML() override in your entity class and if the operation is equal to DML_DELETE, then write the code before you call the super. +

    Actually it works, but the overridden beforeCommit also runs, so I have the deleted record and the next record in the VO inserted in my table of archives.

    I tried a few options by exposing the method that calls that the stored procedure for my UI project, but it has also some problems, as my PK is filled with DBSequences and at the point of my workflow when I run the sequence method is not yet filled.

    Ideally, I'd like that some entries in how I might solve this problem to my business services layer.

    Concerning

    Leon.

    To be honest I would always fix this to the database layer, copy the following code is negligible in the PLSQL triggers, why clutter up the average level by additional detours?

    CM.

  • To proceed if a condition is fulfilled in a stored procedure

    Hello Experts,

    I have a fairly simple requirement and I was not able to solve, I hope someone could help me with this.

    I have an existing stored procedure that captures data in a cursor and writes it to a file using the UTL utilities. It works very well. I want to add a condition before the cursor, if this condition is met, it must proceed to the cursor and write the file, otherwise it's just not the procedure with an error message saying the unmet condition. I'm doing something wrong here, can someone please fix the part of the State. I think I could use 'IF EXISTS'. Please notify. Thank you in advance.

    This is the model,

    CREATE OR REPLACE PROCEDURE < PROC >

    as

    Define variables

    n_cnt number: = 0;

    ...

    ...

    ..

    -Here is the condition I want to go far from other I want to fail the procedure-

    BEGIN

    SELECT COUNT (TABLE_NAME) made a MISTAKE in n_cnt

    EXTRACT

    WHERE

    AND STATE = 'error ';

    IF n_cnt <>0 THEN go - continue the procedure -

    END else fail PROCEDURE - the procedure-

    -Creates a cursor/temp table that contains the data to be processed at line by line, which is used to write to a file

    <>SLIDER

    IS

    -Home select query starts here.

    SELECT DISTINCT FIRSTNAME

    LASTNAME

    NAMES

    ;

    BEGIN

    UTL_FILE. PUTF (v_FILE_HANDLE, '% s%s\n',

    'FIRST NAME' |' | ',

    "LASTNAME");

    CURSOR OPEN.

    -Get the cursor in the temporary folder

    CURSOR FETCH IN REC.

    CURSOR % WHILE

    -Using the loop to load data

    LOOP

    -Using the UTL package to write to a file

    UTL_FILE. PUTF (v_FILE_HANDLE, '% s%s\n',

    RECOMM. FIRSTNAME |' | ',

    RECOMM. LASTNAME );

    end loop;

    END '

    Hello

    You can do the following.

    IF n_cnt = 0 THEN

    RAISE_APPLICATION_ERROR (-20001, 'condition not met');

    END IF;

    See more info on PL/SQL Error Handling http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm#LNPLS007

  • Execution of the stored procedure Oracle EF6 error.

    Hello

    Need help with the oracle error

    {"ORA-06550: line 1, column 8:"}

    PLS-00306: wrong number or types of arguments in the call to "sp_name".

    ORA-06550: line 1, column 8:

    {"PL/SQL: statement ignored '}

    This error occurs when the code runs the line in Vb.net application in Model Designer

    MyBase.ExecuteFunction ("sp_name" para1, para2, para3, dOBpara4, para5)

    I create the SSDL and CSDL, MSL files for oracle to MS SQL connection by the method mentioned in the link JasonShort - professional profile - CodeProject it worked perfectly fine without the stored procedures. I managed to insert, update, and delete records. Then, I created stored procedures for Insert, Update, Delete. It worked fine with MS SQL. I copied and updated oracle files respectively. I gives me the error mentioned above.

    I executed stored procedures in Oracle SQL Developer, and it works without error. But when it is executed via the model there is light of the error. Can anyone let me know the solution for this error. I'm using VS2010, EF6, Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Thank you

    Prachin Soparkar

    Hello

    Sorry for the inconvenience. After I posted this question I took a break and saw that the error was nothing, but I had given FNAME as parameter name in MS SQL. In oracle when I created the sp I created the parameter with p_FNAME. Where the schema defined in the language SSDL and CSDL, MSL had to be changed to MS, but since I want to that it would be same in different databases, I choose to have changed it in oracle stored procedure. The error msg is confusing, it should be something not found parameter or incompatibility etc.

    Thank you

    Prachin Soparkar

  • How to identify the name of the procedure that inserts into a table in the TRIGGER

    Hello
    There are several procedures in my DB that perform the INSERT operation on a main table - MYTAB say.

    I created a trigger on the table MYTAB, to follow closely, what procedure is insert data in there. Is there a function that captures the name of this object?

    For example: PROC_A, PROC_B, PROC_C insert into the table MYTAB. And my query is - the trigger on table MYTAB should document these object names where the lines fit.
    Please let me know your suggestions...

    SQL> create table t (no integer, dt timestamp, who_inserted varchar2(4000));
    
    Table created.
    
    SQL> create or replace procedure p
      2  as
      3  begin
      4    insert into t (no, dt) values (1, systimestamp);
      5  end;
      6  /
    
    Procedure created.
    
    SQL> show err
    No errors.
    
    SQL> create or replace trigger t_trig before insert on t for each row
      2  begin
      3     :new.who_inserted := dbms_utility.format_call_stack;
      4  end;
      5  /
    
    Trigger created.
    
    SQL> show err
    No errors.
    
    SQL> begin
      2    p;
      3  end;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from t;
    
            NO DT                             WHO_INSERTED
    ---------- ------------------------------ ----------------------------------------
             1 31-OCT-14 04.58.53.668465 AM   ----- PL/SQL Call Stack -----
                                                object      line  object
                                                handle    number  name
                                              3a7ddbea0         2  KARTHICK.T_TRIG
                                              3ac979f30         4  procedure KARTHICK.P
                                              3a822deb8         2  anonymous block
    
  • The call PLSQL stored procedure from the HTML form Submit button

    Hello

    I'm having a little difficulty with the appellant a stored procedure using a html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');
    Here's the question - I need to find a way to pass variables to this stored procedure, so he knows what data to operate on. This stored procedure removes the data in a specific database record and I have to pass three variables to this procedure to run.

    Allows to call class_number, term, conf will impact these three variables and the data will be deleted and the person will see a confirmation screen once the deletion request completed.

    So ideally I would want: ZWGKERCF. P_confdelete (class_number, term, conf), then the stored procedure would deal with the rest!

    Seems simple enough, but I don't know how to make this happen... My thoughts were:

    Transmit data to this (the three areas that I need) html form in hidden variables. Then somehow pass them using the POST method to the procedure and read using GET?

    Can someone clarify what the best way to do it? I feel that its little something miss me you - but I would really like an idea expertise :-)

    Thank you very much in advance!

    -Jeff

    >
    ...

    I would like to assign a variable, the duration, the conf crn all variables in this procedure and then act on them accordingly.

    But you already have it in a variable. If you want you can assign the value again to another variable.

    example of

    PROCEDURE P_confdelete(CRN NUMBER,TERM NUMBER, CONF VARCHAR2)
       IS
          v_crn number(38);
          v_term number(38);
          v_conf varchar2(1000);
    
      BEGIN
           HTP.PRINT('test1 '||crn||'/'||term||'/'||conf); 
    
          v_crn := crn;
          v_term := term;
          v_conf := conf;
    
          HTP.PRINT('test2 '||v_crn||'/'||v_term||'/'||v_conf); 
    
    END P_confdelete;
    
  • Insert a record, call a stored procedure and execute a shell script

    Hello

    I am trying to build a page APEX do these three things in order.

    #1. Insert a new record in a database table (pk, donnees_xml, attr1 and attr2, etc.) and download the XML file to the donnees_xml column

    #2. Save this XML file on a file system

    #3. Parse the XML file on a file system and update the database with the parsed data table

    I can do #1 with a regular shape based on the database table. I can do #2 with a stored procedure.

    I can do #3 with a shell script.

    I wonder how these tasks can be combined into a single action in APEX.

    do #1;

    If successful, do #2;

    If successful, do #3;

    I'd appreciate comments on this.

    Thank you

    Define a process of PL/SQL page submit that runs after the record is inserted, if P1_FILE is not null.

Maybe you are looking for

  • Apple TV only sometimes work with receiver

    I recently moved and had to reconnect the mess of wires behind my TV. I guess I hooked everything up in the same way, but it is possible to do something is wrong. I have a new Apple TV, smart TV Vizio, a receiver Denon AVR-E300 and two bookshelf spea

  • Satellite P200 randomly turns off by itself

    Do not know what is happening, every now and then it shuts it self without reason. I used recovery disks several times and it keeps doing. Very frustrating. Any help would be appreciated!

  • Construction of a waveform in a bit array and and noise sometida

    Hello world I have a binary table 1 & 0 and I want to build a wave of her form, each pulse with an interval of 500ms, adding little noise, how can I get it? LabVIEW version 2010 Thank you

  • loop path Conference

    Hello I'm stuck on my program and it bother me enough pour forward in my project: when I want to read the ways of an Almemo (newspaper) of the Conference is OK the treatment etc is OK but changing lanes is a problem. Indeed, if I enter as a condition

  • Nightmare of update, how to go back and open a project?

    Long story short, a music promo I'm edition relies heavily on using a stylized overall threshold effect. I just finish the project tonight and I have a large amount of RAW 4 k images thought that I would update to 2015.3 and make use of the new featu