How to store select statements in a procedure and use it as a parameter

I need to enter below the select statements in a stored procedure with an input parameter, business_dt_num. This parameter must be the result under the statement select and placed inside the procedure...
select max(business_dt_num)
from invent.dp_ca 
If a select statement fails he must get out of the execution of the procedure and is not engaged in the next select statement. How can I cancel the execution of the procedure, if a select statement fails?
select max(business_dt_num)
from invent.dp_ca 
/
Select count (1)
of invent.dp_ca
where BUSINESS_DT_NUM = YYYYMMDD
and product_id! = 0 ;
-above and below sql account must match
Select count (1)
invent.dp_ca d, e invent.dp_ca_proof
where d.BUSINESS_DT_NUM = YYYYMMDD
and d.KEY_ID = e.KEY_ID;
/
exec pk_proof.pr_PopulateTaggingWorkTable_CA (yyyymmdd);
/
SELECT count (distinct univ_key_id) of invent.dp_ca_proof
where business_dt_num = YYYYMMDD and proof_status! = « A » ;
-above and below sql account must match
Select count (0) in the invent.dp_ca_work where business_dt_num = YYYYMMDD.
Thanks,
Steve

Edited by: steve2312 on Dec 22, 2011 12:32 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
declare
   dp_ca_count1 number;
   dp_ca_count2 number;
begin
   select count(1) into dp_ca_count1
   from invent.dp_ca
   where BUSINESS_DT_NUM = trunc(sysdate)
   and product_id != 0;

   select count(1) into dp_ca_count2
   from invent.dp_ca d, invent.dp_ca_proof e
   where d.BUSINESS_DT_NUM = trunc(sysdate)
   and d.KEY_ID = e.KEY_ID;

   if dp_ca_count1 != dp_ca_count2 then
           raise_application_error (-20001, 'Counts do not match.');
   end if;
end;
/

Tags: Database

Similar Questions

  • How to store images in the oracle database and get back on a jsff page in ADF?

    Mr President.

    How to store images in the oracle database and get back on a jsff page in ADF?

    I have students and employees in my database and want to store their pictures against their ID.

    How to do this?

    Concerning

    Tender,

    You can check the links that explain this below.

    https://tompeez.WordPress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-ADF-part-2/

    Johny tips: ADF: display image files from database as a popup in Application Web ADF

    See you soon

    AJ

  • Call stored procedures and using its output parameters in a report

    Hello

    I have a procedure defined in a package on the database. This procedure returns a number of output parameters. How to call this procedure and use the output parameters in my report?

    Thank you, Mark

    Depends on the level at which the procedure should be called. If its at the State level, call the form in the trigger-REPORT-BEFORE (or AFTER-PARAMFORM) and store the off-values space reserved columns. These you can use anywhere in your report.

  • How to create a shared library of Qt and use it on App without a head?

    Hi all

    I'm experimenting with some waterfalls headless basic application development, and I just hit another problem of blocking.

    I want to create a Qt library with some shared code between the head and user interface elements.

    That's what I did:

    1. created a new application without head the wizard project
    2. created a new library shared by using the wizard project. Adds a simple C++ (Qt not) class
    3. Set up the two parts of the Headless App to use the shared library ("Library in the workspace project" option from the "Add library...) (' Assistant).   Everything compiles and works very well so far.
    4. Now, I want to use the shared library Qt. I choose 'Library of the Standard BlackBerry platform' and ' platform > Qt Core "from the «add library...» "Wizard. Now, I had this error on the shared library project: C:\dev\bbndk\host_10_2_0_15\win32\x86\usr\bin\ntoarm-ld: could not find lQtCore.

    How to create a shared library of Qt and use it on App without a head?

    In fact, I would also use other NDK libraries on library shared as lbbdata and libbbdevice.

    I expect that workers would deal with all the problems for me. As an improvement, I suggest you add the selection screen platform library of the Wizard "Add library...". «the wizard «Shared Library Project»

    There is a model of library project

    https://github.com/BlackBerry/Cascades-community-samples/tree/master/Cascades-library-template

    Unfortunately, the library create Assistant isn't really useful #t

    There is also a great series on using headless headless library and user interface:

    http://devBlog.BlackBerry.com/2014/02/a-flexible-architecture-for-enterprise-mobile-applications-par...

  • How to disable the built-in PDF Viewer and use another Viewer at all times?

    How to disable the built-in PDF Viewer and use Adobe Reader to view the PDF files, without having to set this preference, whenever I open Firefox? The default setting to "Use Adobe Acrobat (in Firefox)". Thank you.

    It's strange. The integrated Viewer - Viewer by default - is described by the expression 'Preview in Firefox' and you will have changed to "Use Adobe Acrobat (in Firefox)".

    Well... you or an add-on or another program on your system must be changed.

    What happens if you disable the Adobe Acrobat plugin (not the extension to create a PDF file, leave it active). Here's how you can try this:

    Open the page modules using either:

    • CTRL + SHIFT + a
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click on Plugins. On the right side, find "Adobe Acrobat" and change the permission 'never enable '.

    Then in the Options page, Applications Panel, change your preference for "Portable Document Format (PDF)" to "Always ask" so you get the dialog box to download instead of the PDF, open in a tab.

    It sticks?

  • Try to make a loop on a select statement in a procedure

    Ok
    I'm writing a procedure that will make an operation on every table in a select statement.
    Example: I want to add a column in each table that starts with "XX_" (XX_01, XX_BD, etc.)
    I have new procedures.
    I guess I have to use a cursor that is defined as:
    cursor xbtable is select * from user_tables where table_name like 'XX_%';
    begin
    open xbtables;
    loop
    Then what?
    How to make this work.
    Also, I have to use substr() on xbtable to extract parts of the name of the table...

    Can anyone help?

    THX

    I'm sorry, I made a mistake

    cursor xbtable is select * from user_tables where table_name like 'XX_ % ';
    String VARCHAR2 (200);
    Start
    for everything in the loop of xbtable
    string: = 'ALTER TABLE ' | Everything.table_name | "ADD column_name column-definition."

    immediately run a string;

    end loop;

    end;

  • passing multiple values from the query in the select statement of the procedure

    I am collecting IDS to select education agreement from the date of rental values and then I would pass the result of the query in the statement select to get the result.
    data type for the contract id is of type varchar and date of rental there is more than one id to contract for most of the time. Help, please. Thank you

    CREATE OR REPLACE PROCEDURE abstract_menu (p_letting   IN     VARCHAR2,
                                               p_results      OUT SYS_REFCURSOR)
    IS
       v_contractId   VARCHAR2 (40);
    
    SELECT lcontid
      INTO v_contractId
      FROM letprop
     WHERE datestat IS NOT NULL AND letting = p_letting AND letstat <> 'R';
    
    
    BEGIN
       OPEN p_results FOR
            SELECT DISTINCT
                      SUBSTR (l.letting, 3, 2)
                   || '-'
                   || SUBSTR (l.letting, 5, 2)
                   || '-'
                   || SUBSTR (l.letting, 1, 2)
                      lettingdate,
                   l.lcontid contractid,
                   SUBSTR (q.cprojnum, 1, 10) projectnumber,
                   DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route)))
                      routenumber,
                   L.DATESTAT statusdate,
                   L.LETSTAT lettingstatus,
                   (q.cdescr) jobdescription,
                   INITCAP (q.clocat1 || q.clocat2) LOCATION
              FROM vendor v,
                   vendaddr r,
                   letprop l,
                   planhold p,
                   proposal q,
                   project j,
                   propproj k,
                   bidlet bd
             WHERE     v.vendor = r.vendor
                   AND k.contid = q.contid
                   AND k.pcn = j.pcn
                   AND l.lcontid = k.contid
                   AND p.vendor = v.vendor
                   AND l.letting = p.letting
                   AND l.lcontid IN v_contactid  "**************This is where I would like to pass the contract id from the above select statement***********'"
                   AND l.CALL = p.CALL
                   AND r.addrnum = p.billto
                   AND bd.letting = l.letting
          GROUP BY q.cdescr,
                   q.clocat1,
                   q.clocat2,
                   bd.letting,
                   l.letting,
                   l.lcontid,
                   q.cprojnum,
                   L.LETSTAT,
                   L.DATESTAT
          ORDER BY lettingdate;
    
    end;

    user9196150 wrote:
    AND l.lcontid IN v_contactid ' * this is where I would like to pass the id of the select statement above contract * ""»

    CREATE OR REPLACE PROCEDURE abstract_menu (p_letting   IN     VARCHAR2,
                                               p_results      OUT SYS_REFCURSOR)
    IS
    BEGIN
       OPEN p_results FOR
            SELECT DISTINCT
                      SUBSTR (l.letting, 3, 2)
                   || '-'
                   || SUBSTR (l.letting, 5, 2)
                   || '-'
                   || SUBSTR (l.letting, 1, 2)
                      lettingdate,
                   l.lcontid contractid,
                   SUBSTR (q.cprojnum, 1, 10) projectnumber,
                   DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route)))
                      routenumber,
                   L.DATESTAT statusdate,
                   L.LETSTAT lettingstatus,
                   (q.cdescr) jobdescription,
                   INITCAP (q.clocat1 || q.clocat2) LOCATION
              FROM vendor v,
                   vendaddr r,
                   letprop l,
                   planhold p,
                   proposal q,
                   project j,
                   propproj k,
                   bidlet bd
             WHERE     v.vendor = r.vendor
                   AND k.contid = q.contid
                   AND k.pcn = j.pcn
                   AND l.lcontid = k.contid
                   AND p.vendor = v.vendor
                   AND l.letting = p.letting
                   AND l.lcontid IN (
                                     SELECT  ll.lcontid
                                       FROM  letprop ll
                                       WHERE ll.datestat IS NOT NULL AND ll.letting = p_letting AND ll.letstat  'R'
                                    )
                   AND l.CALL = p.CALL
                   AND r.addrnum = p.billto
                   AND bd.letting = l.letting
          GROUP BY q.cdescr,
                   q.clocat1,
                   q.clocat2,
                   bd.letting,
                   l.letting,
                   l.lcontid,
                   q.cprojnum,
                   L.LETSTAT,
                   L.DATESTAT
          ORDER BY lettingdate;
    
    end;
    /
    

    SY.

  • How to move from records in a procedure with Table Type as a parameter block

    Hello

    How can I move all records in a block of PL/SQL procedure with argument of Type Table or Refcursor.

    I created a procedure in the backend with a parameter of Type table. Of the form, I want to call this procedure with the argument that ALL of the records in BULK.

    Y at - it a simple method for it.


    Thanks in advance

    Rizly

    Rizly,
    I recently put in place a level of forms audit process that uses this method very - package of database, which takes an array of Records as a parameter. Forms 10 G supports this nicely. We have sought to implement this through a set of database triggers (update, insert, delete) but due to our requirements, it was not the best place to do so that we have implemented this in forms.

    Brief history on my form. The main block was based on a table, and the block has been marked NOT can, Insert and Delete. If the user wants to insert, update, or delete a record they clicked on Insert, Update, or Delete button that opens a popup form where they seized a reason Code and a Description of the transaction and then clicked a button Save.

    Here's what I did.
    Database side *.
    1 package database with a Record of PL/SQL and PL/SQL records in the Table variable declared in the Package specification.
    2. create INSERT_?, warning? and DELETE_? package procedures to manage integration, updates and deletions.
    Secondary forms *.
    1 create a table (control) Non-Base with all fields block
    2. create a button that performs a loop on the block and all values assigns to the variable of records in the Table (ToR) forms (typed off the DB package)
    3. pass the ToR to the appropriate database package procedure.

    Here is an example of the code I wrote:
    Database side *.
    Package specifications * (Note: replace with your database schema name) also note, I use PL/SQL Developer with the PLDoc plug-in so I documentation tags in my code.

    CREATE OR REPLACE PACKAGE .Transaction_Log_pkg IS
    -- Package Global Variables
    -- ------------------------
    TYPE rec_T_Log IS RECORD (
        table_name          .transaction_log.table_name%TYPE
       ,trans_type          .transaction_log.trans_type%TYPE
       ,trans_key           .transaction_log.trans_key%TYPE
       ,action              .transaction_log.action%TYPE
       ,column_name         .transaction_log.column_name%TYPE
       ,old_value           .transaction_log.old_value%TYPE
       ,new_value           .transaction_log.new_value%TYPE
       ,trans_date          .transaction_log.trans_date%TYPE
       ,user_id             .transaction_log.user_id%TYPE
       ,reason_code         .transaction_log.reason_code%TYPE
       ,comments            .transaction_log.comments%TYPE
       );
    
    TYPE tbl_T_Log IS TABLE OF rec_T_Log INDEX BY BINARY_INTEGER;
    
       -- Insert_Record --------------------------------------------------------------------------------
       /** Procedure adds "INSERT" audting records in to the CIR.TRANSACTION_LOG table
       %param      p_t_log      TABLE_OF_RECORDS
       %desc       You can pass a single record or a group of records.  Allows you to package up all of
                   the values inserted in a table and send them to the Insert_Record procedure as a
                   group rather than as individual transactions.
       -- ---------------------------------------------------------------------------------------------- */
       PROCEDURE Insert_Record (p_t_log tbl_T_Log );
    
       -- Update_Record --------------------------------------------------------------------------------
       /** Procedure adds a "UPDATE" record(s) in the CIR.TRANSACTION_LOG table
       %param      p_t_log      TABLE_OF_RECORDS
       %desc       You can pass a single record or a group of records if more than one value in a row is updated.
       -- ---------------------------------------------------------------------------------------------- */
       PROCEDURE Update_Record (p_t_log tbl_T_Log );
    
       -- Delete_Record --------------------------------------------------------------------------------
       /** Procedure adds "DELETE" records in to the CIR.TRANSACTION_LOG table
       %param      p_t_log      TABLE_OF_RECORDS
       %desc       You can pass a single record or a group of records.  Allows you to package up all of
                   the values inserted in a table and send them to the Delete_Record procedure as a
                   group rather than as individual transactions.
       -- ---------------------------------------------------------------------------------------------- */
       PROCEDURE Delete_Record (p_t_log tbl_T_Log );
    
    END Transaction_Log_pkg;
    

    Package body *.

    -- Beginning of Package Body -------------------------------------------------------------------------
    -- ---------------------------------------------------------------------------------------------------
    CREATE OR REPLACE PACKAGE BODY .Transaction_Log_pkg AS
       -- Package EXCEPTIONS
       -- ------------------
       null_table              EXCEPTION;
       null_table_name         EXCEPTION;
       null_trans_type         EXCEPTION;
       null_trans_key          EXCEPTION;
       null_action             EXCEPTION;
       null_column_name        EXCEPTION;
       null_value              EXCEPTION;
       null_user_Id            EXCEPTION;
       null_reason_code        EXCEPTION;
       null_comments           EXCEPTION;
    
       -- Package Variables
       -- -----------------
       vErrMsg                 VARCHAR2(1000);
       vSQL                    VARCHAR2(2000);
    
       -- ----------------------------------------------------------------------------------------------
       PROCEDURE Insert_Record (p_t_log tbl_T_Log ) IS
    
       BEGIN
          IF ( NVL(p_t_log.COUNT,0) = 0 ) THEN
             RAISE null_table;
          ELSE
    
             FOR i IN p_t_log.first .. p_t_log.last LOOP
                vSQL := 'INSERT INTO .transaction_log (seq_no,table_name,trans_type,trans_key,action'
                            ||',column_name,old_value,new_value,trans_date,user_id,reason_code,comments)'
                            ||' VALUES (.TRANSACTION_NO_SEQ.nextval';
    
                -- Build Insert Statement
                IF ( p_t_log(i).table_name IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).table_name||'''';
                ELSE
                   RAISE null_table_name;
                END IF;
                IF ( p_t_log(i).trans_type IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).trans_type||'''';
                ELSE
                   RAISE null_trans_type;
                END IF;
                IF ( p_t_log(i).trans_key IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).trans_key||'''';
                ELSE
                   RAISE null_trans_key;
                END IF;
                IF ( p_t_log(i).action IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).action||'''';
                ELSE
                   RAISE null_action;
                END IF;
                IF ( p_t_log(i).column_name IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).column_name||'''';
                ELSE
                   RAISE null_column_name;
                END IF;
                IF ( p_t_log(i).old_value IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).old_value||'''';
                ELSE
                   vSQL := vSQL||',NULL';
                END IF;
                IF ( p_t_log(i).new_value IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).new_value||'''';
                ELSE
                   RAISE null_value;
                END IF;
    
                --transaction_date
                vSQL := vSQL||',sysdate';
    
                IF ( p_t_log(i).user_id IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).user_id||'''';
                ELSE
                   RAISE null_user_id;
                END IF;
                IF ( p_t_log(i).reason_code IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).reason_code||'''';
                ELSE
                   RAISE null_reason_code;
                END IF;
                IF ( p_t_log(i).comments IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).comments||'''';
                ELSE
                   RAISE null_comments;
                END IF;
    
                vSQL := vSQL||')';
    
                dbms_output.put_line('vSQL = '||vSQL);
    
                EXECUTE IMMEDIATE vSQL;
    
                vSQL := NULL;
    
             END LOOP;
    
             -- The COMMIT is intentionally left out to force the calling
             -- application to perform the commit and complies with the
             -- basics of encapsulation.
             -- ---------------------------------------------------------
    
          END IF;
    
       EXCEPTION
          WHEN null_table THEN
             vErrMSg := 'The p_t_log Collection cannot be null!';
             RAISE_APPLICATION_ERROR(-20990,vErrMsg);
          WHEN null_table_name THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20991,vErrMsg);
          WHEN null_trans_type THEN
             vErrMSg := 'Transaction Type cannot be null!';
             RAISE_APPLICATION_ERROR(-20992,vErrMsg);
          WHEN null_trans_key THEN
             vErrMSg := 'Transaction Key cannot be null!';
             RAISE_APPLICATION_ERROR(-20993,vErrMsg);
          WHEN null_action THEN
             vErrMSg := 'Action cannot be null!';
             RAISE_APPLICATION_ERROR(-20994,vErrMsg);
          WHEN null_column_name THEN
             vErrMSg := 'Column Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20995,vErrMsg);
          WHEN null_value THEN
             vErrMSg := 'Value cannot be null!';
             RAISE_APPLICATION_ERROR(-20996,vErrMsg);
          WHEN null_user_Id THEN
             vErrMSg := 'User ID cannot be null!';
             RAISE_APPLICATION_ERROR(-20997,vErrMsg);
          WHEN null_reason_code THEN
             vErrMSg := 'Reason Code cannot be null!';
             RAISE_APPLICATION_ERROR(-20998,vErrMsg);
          WHEN null_comments THEN
             vErrMSg := 'Comments cannot be null!';
             RAISE_APPLICATION_ERROR(-20999,vErrMsg);
       END Insert_Record;
       -- ------------------------------------------------------------------------------------------------
    
       PROCEDURE Update_Record (p_t_log tbl_T_Log ) IS
    
       BEGIN
          IF ( NVL(p_t_log.COUNT,0) = 0 ) THEN
             RAISE null_table;
          ELSE
    
             FOR i IN p_t_log.first .. p_t_log.last LOOP
                vSQL := 'INSERT INTO .transaction_log (seq_no,table_name,trans_type,trans_key,action'
                            ||',column_name,old_value,new_value,trans_date,user_id,reason_code,comments)'
                            ||' VALUES (.TRANSACTION_NO_SEQ.nextval';
    
                -- Build Insert Statement
                IF ( p_t_log(i).table_name IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).table_name||'''';
                ELSE
                   RAISE null_table_name;
                END IF;
                IF ( p_t_log(i).trans_type IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).trans_type||'''';
                ELSE
                   RAISE null_trans_type;
                END IF;
                IF ( p_t_log(i).trans_key IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).trans_key||'''';
                ELSE
                   RAISE null_trans_key;
                END IF;
                IF ( p_t_log(i).action IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).action||'''';
                ELSE
                   RAISE null_action;
                END IF;
                IF ( p_t_log(i).column_name IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).column_name||'''';
                ELSE
                   RAISE null_column_name;
                END IF;
                IF ( p_t_log(i).old_value IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).old_value||'''';
                ELSE
                   vSQL := vSQL||',NULL';
                END IF;
                IF ( p_t_log(i).new_value IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).new_value||'''';
                ELSE
                   RAISE null_value;
                END IF;
    
                --transaction_date
                vSQL := vSQL||',sysdate';
    
                IF ( p_t_log(i).user_id IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).user_id||'''';
                ELSE
                   RAISE null_user_id;
                END IF;
                IF ( p_t_log(i).reason_code IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).reason_code||'''';
                ELSE
                   RAISE null_reason_code;
                END IF;
                IF ( p_t_log(i).comments IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).comments||'''';
                ELSE
                   RAISE null_comments;
                END IF;
    
                vSQL := vSQL||')';
    
                dbms_output.put_line('vSQL = '||vSQL);
    
                EXECUTE IMMEDIATE vSQL;
    
                vSQL := NULL;
    
             END LOOP;
    
             -- The COMMIT is intentionally left out to force the calling
             -- application to perform the commit and complies with the
             -- basics of encapsulation.
             -- ---------------------------------------------------------
    
          END IF;
    
       EXCEPTION
          WHEN null_table THEN
             vErrMSg := 'The p_t_log Collection cannot be null!';
             RAISE_APPLICATION_ERROR(-20990,vErrMsg);
          WHEN null_table_name THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20991,vErrMsg);
          WHEN null_trans_type THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20992,vErrMsg);
          WHEN null_trans_key THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20993,vErrMsg);
          WHEN null_action THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20994,vErrMsg);
          WHEN null_column_name THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20995,vErrMsg);
          WHEN null_value THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20996,vErrMsg);
          WHEN null_user_Id THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20997,vErrMsg);
          WHEN null_reason_code THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20998,vErrMsg);
          WHEN null_comments THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20999,vErrMsg);
       END Update_Record;
       -- ------------------------------------------------------------------------------------------------
    
       PROCEDURE Delete_Record (p_t_log tbl_T_Log ) IS
    
       BEGIN
          IF ( NVL(p_t_log.COUNT,0) = 0 ) THEN
             RAISE null_table;
          ELSE
    
             FOR i IN p_t_log.first .. p_t_log.last LOOP
                vSQL := 'INSERT INTO .transaction_log (seq_no,table_name,trans_type,trans_key,action'
                            ||',column_name,old_value,new_value,trans_date,user_id,reason_code,comments)'
                            ||' VALUES (.TRANSACTION_NO_SEQ.nextval';
    
                -- Build Insert Statement
                IF ( p_t_log(i).table_name IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).table_name||'''';
                ELSE
                   RAISE null_table_name;
                END IF;
                IF ( p_t_log(i).trans_type IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).trans_type||'''';
                ELSE
                   RAISE null_trans_type;
                END IF;
                IF ( p_t_log(i).trans_key IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).trans_key||'''';
                ELSE
                   RAISE null_trans_key;
                END IF;
                IF ( p_t_log(i).action IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).action||'''';
                ELSE
                   RAISE null_action;
                END IF;
                IF ( p_t_log(i).column_name IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).column_name||'''';
                ELSE
                   RAISE null_column_name;
                END IF;
                IF ( p_t_log(i).old_value IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).old_value||'''';
                ELSE
                   vSQL := vSQL||',NULL';
                END IF;
                IF ( p_t_log(i).new_value IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).new_value||'''';
                ELSE
                   RAISE null_value;
                END IF;
    
                --transaction_date
                vSQL := vSQL||',sysdate';
    
                IF ( p_t_log(i).user_id IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).user_id||'''';
                ELSE
                   RAISE null_user_id;
                END IF;
                IF ( p_t_log(i).reason_code IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).reason_code||'''';
                ELSE
                   RAISE null_reason_code;
                END IF;
                IF ( p_t_log(i).comments IS NOT NULL ) THEN
                   vSQL := vSQL||','''||p_t_log(i).comments||'''';
                ELSE
                   RAISE null_comments;
                END IF;
    
                vSQL := vSQL||')';
    
                dbms_output.put_line('vSQL = '||vSQL);
    
                EXECUTE IMMEDIATE vSQL;
    
                vSQL := NULL;
    
             END LOOP;
    
             -- The COMMIT is intentionally left out to force the calling
             -- application to perform the commit and complies with the
             -- basics of encapsulation.
             -- ---------------------------------------------------------
    
          END IF;
    
       EXCEPTION
          WHEN null_table THEN
             vErrMSg := 'The p_t_log Collection cannot be null!';
             RAISE_APPLICATION_ERROR(-20990,vErrMsg);
          WHEN null_table_name THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20991,vErrMsg);
          WHEN null_trans_type THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20992,vErrMsg);
          WHEN null_trans_key THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20993,vErrMsg);
          WHEN null_action THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20994,vErrMsg);
          WHEN null_column_name THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20995,vErrMsg);
          WHEN null_value THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20996,vErrMsg);
          WHEN null_user_Id THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20997,vErrMsg);
          WHEN null_reason_code THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20998,vErrMsg);
          WHEN null_comments THEN
             vErrMSg := 'Table Name cannot be null!';
             RAISE_APPLICATION_ERROR(-20999,vErrMsg);
       END Delete_Record;
       -- ------------------------------------------------------------------------------------------------
    
    END Transaction_Log_pkg; -----------------------------------------------------------------------------
    -- ---------------------------------------------------------------------------------------------------
    

    Secondary forms * (all this coding was limited to the Insert, update or delete buttons.) The following example is the Insert button)

    /* When-Button-Pressed Trigger */
    DECLARE
         vBlockName     VARCHAR2(20) := 'REPORT_CATEGORIES';
         vBlockItem     VARCHAR2(61);
         vCurrItem      VARCHAR2(61);
         nRecCnt        NUMBER := 1;
    
         /* Here is where you create your Forms Variable TYPEd off the Package Table of Records (ToR) */
         /* Since it is a table of records, you could easily add multiple rows to the ToR if your form uses a multi-record block */
         p_tlog         cir.transaction_log_pkg.tbl_t_log;    
    
    BEGIN
         vCurrItem := vBlockName||'.'||Get_Block_Property(vBlockName,FIRST_ITEM);
    
         Go_Item(vCurrItem);
    
         -- 1. Endure each field if populated.
            -- 2. Check for Duplicates (Handled in W-V-I)
    
         IF ( Name_In(:system.Cursor_Item) IS NULL ) THEN
              --Fail the form at the field that is NULL
              send_alert.msg('s','All fields are required.  Please enter a unique value.');
              RAISE Form_Trigger_Failure;
         END IF;
    
         WHILE ( vCurrItem IS NOT NULL ) LOOP
              vBlockItem := :system.cursor_item;
    
              -- Loop through the block and CALL Insert_Record for each Block Item.
              /* 1 */ p_tlog(nRecCnt).table_name := vBlockName;
              /* 2 */ p_tlog(nRecCnt).trans_type := Name_In(vBlockName||'.CAT_TYPE');
              /* 3 */ p_tlog(nRecCnt).trans_key := Name_In(vBlockName||'.ID');
              /* 4 */ p_tlog(nRecCnt).action := 'INSERT';
              /* 5 */ p_tlog(nRecCnt).column_name := substr(vBlockItem,instr(vBlockItem,'.')+1,length(vBlockItem));
              /* 6 */ p_tlog(nRecCnt).old_value := NULL;
              /* 7 */ p_tlog(nRecCnt).new_value := Name_In(vBlockItem);
              /* 8 */ p_tlog(nRecCnt).trans_date := sysdate;
              /* 9 */ p_tlog(nRecCnt).user_id := :Global.userid;
              /*10 */ p_tlog(nRecCnt).reason_code := Name_In(vBlockName||'.REASON_CODE');
              /*11 */ p_tlog(nRecCnt).comments := Name_In(vBlockName||'.COMMENTS');
    
              vCurrItem := Get_Item_Property(vBlockItem,NEXTITEM);
              next_item;
              nRecCnt := nRecCnt + 1;
         END LOOP;
    
         -- 3. Insert
      -- Call TRANSACTION_LOG_PKG.Insert_Record
      -- --------------------------------------
      .transaction_log_pkg.insert_record(p_t_log => p_tlog);
    
         -- 4. Commit
         Commit;  
    
         -- 5. Clear Block
         Clear_Block(Ask_Commit);
    
         -- 6. Close Form
         Hide_Window('REPORT_CATEGORIES');
         -- 7. ReQuery RC_DISP Block
         Go_Block('REPORT_CATEGORIES_DISP');
         Clear_Block(No_Validate);
         Execute_Query;
         -- 8. Done
    END;
    

    I knew not when I started this process of forms if she was going to work because I tried to do something similar to this when I was working with Forms 6i and Oracle Enterprise Business Suite and Forms 6i supported not Ref Cursor and Table of documents very well so I didn't know at first if it would work. Search in forms documentation, I found that Forms 10 g has supported this type of functionality and this process works very well and it was surprisingly fast - at least in my usage, it is very fast. :)

    I hope this helps.
    Craig...

    If I or someone elses answer was useful, please mark accordingly

  • How does one select type or drag a window using the magic trackpad?

    How does one select type or drag a finder window by using the magic trackpad? I can't find the finger combinations to do either. Thanks in advance

    Do you use the old Apple Magic Trackpad or the new Apple Magic Trackpad 2?

    The Trackpad 2 is only compatible with OS X 10.11 El Capitan and NOT earlier versions of Mac OS X.

    Use on your Mac - Apple Support multi-touch gestures

  • How to restore from an array of information and use it?

    Hello

    I need help with this animation of Christmas.

    1 - the user selects a language (btn_Esp, btn_Eng, btn_Ita,...)

    2 - the movie starts and displays a message of welcome in the middle of the animation. The animation is the same for all languages, change the language of the greeting text (I have a symbol for each welcome message in my library). In the example, they are: esp, eng, symbols of the ITA.

    The problem:

    I need to store the language selected in a variable (lang) and then retrieve it to display the appropriate greeting text.

    My animated film is a chronology of symbol all call "navidad" where I included a call for the "message" label (I need to display the symbol of the text to the same point).

    I use sym.createChildSymbol but doesn´t work. Any ideas?

    Sample file WeTransfer: http://we.TL/MDGHWBk1wK

    Thank you very much!

    Alejandro

    Here is an example:

    Choose language.zip - Box

  • How to pack graphicsc in resource only lib and use it in another project?

    Hello world

    I'm developing a game and my resources folder exceeds somehow limit available, hough, I have about 6 MB of graphics while the official limit is approximately 8 MB.

    So I wonder - how to pack my graphics in a resource library and use it in my game project?

    Create a library project and add only the images and a single class that allows you to create an object graph/image among images and transmit them to the calling application.

  • How to back up statement pl/sql varchar and call EXEC on that?

    So this statement works:

    SELECT BULK COLLECT INTO table_column_list FROM all_tab_columns WHERE table_name column_name is conv_tablename AND OWNER IN (SELECT USER FROM DUAL);.

    However, I want to add conditions such as 'AND column_name <>'abc' ' at the end I tried so save this varchar type and call EXEC on that:

    select_column_value_sql_stmt: = ' SELECT column_name BULK COLLECT INTO table_column_list FROM user_tab_columns WHERE table_name = "' | conv_tablename | '''' || inexclude_column;
    EXECUTE IMMEDIATE select_column_value_sql_stmt;

    No matter how I concatenate the conv_tablename part, I get an error. invalid identifier or function not implemented.

    so is it possible to do at all?

    Thanks in advance.

    Welcome to the forum!

    Wheneve validation to provide your Oracle version 4-digit (result of SELECT * FROM V$ VERSION).
    >
    So this statement works:

    SELECT BULK COLLECT INTO table_column_list FROM all_tab_columns WHERE table_name column_name is conv_tablename AND OWNER IN (SELECT USER FROM DUAL);.

    However, I want to add conditions such as 'AND 'abc' column_name' so at the end I tried save this varchar type and call EXEC on that:

    select_column_value_sql_stmt: = ' SELECT column_name BULK COLLECT INTO table_column_list FROM user_tab_columns WHERE table_name = "' | conv_tablename | '''' || inexclude_column;
    EXECUTE IMMEDIATE select_column_value_sql_stmt;

    No matter how I concatenate the conv_tablename part, I get an error. invalid identifier or function not implemented.

    so is it possible to do at all?
    >
    Yes - you can do it, but the syntax is different for BULK COLLECT when you use EXECUTE IMMEDIATE. It is after having RECEIVED the request, not in it.

    See the example code at this link
    http://UNIX-Oracle-11g.blogspot.com/2011/03/dynamic-SQL-Execute-immediate-bulk.html

      -- example of dynamic sql with bull collect
      v_sql_stmt := 'SELECT sal FROM emp_t';
      EXECUTE IMMEDIATE v_sql_stmt BULK COLLECT INTO vc_sal;
    

    If you are not able to use a common set of queries for vs normal run immediately.

  • How can I select a complete document [8pp] and create text in vectorised text?

    I'm working on a booklet of page 8 [document] and I want to select all the pages at once and make one "vectorize" to convert the text to print.

    Any help appreciated...

    Kevin.

    Altogether. Return the file in PDF format with embedded fonts. Describing fonts is VERY old workflow, and if your printer insists you should seriously look for a printer with a workflow to update.  The only way that a script I can think that would allow you to convert text outlines on more than one broadcast at a time would be if the text is a unique story, and you have used all select to select this option.  BUT there are always better ways to make the edges if you are absolutely, positively no other choice. Create the contours during the flattening of transparency will preserve the things such as bulleted and numbered lists and stresses applied, which will otherwise be lost. For a discussion of this, see http://forums.adobe.com/message/2897983#2897983

  • Select sentence from a message and use, delete key, message is deleted

    Thunderbird open a received message, select for example the first sentence or a few words, tap on delete and any message is removed and put it in the trash.

    Well, Yes. You cannot change a received message. If the delete key means delete the selected message.

    Why you try to edit a received message? Maybe what you want can be done otherwise.

    If you use answer, forward or Edit Message As New then the selected message opens in the editor and you can change to your heart's content. But of course Thunderbird assumes that you intend to send it to someone else. It won't let you save the changes without your shipment.

  • Pavilion p7-1254: I have added a second hard drive then how closely I put it to the top and use it?

    A year or two ago the original HD died and I took it to a shop and they replaced and now I did know they put in a Western digital 320 GB which is full now. so, I got a seagate 2 TB and have it instaled in the case and now I need to know how to set up? should I move or clone all the info on the new drive, or use both at the same time?

    Hello

    Now, you have two drives, C: and another new letter (e.g. D on your computer.) All new file you save on D:, not C:. After a week or two to settle down, if you want, you can start to move old data/files in C: D:, especially videos, music or old files.

    Kind regards.

Maybe you are looking for

  • Satellite click 10: Impossible to apply Windows Update to version 1511

    Hey all,. Despite having clean temporary files, files of previous windows installation and whatever other useless, I could only about 7-8 GB of free space, which proved to be insufficient for Windows Update to version 1511. He suggested to use an ext

  • Pavilion touchsmart 14-b109wm: Hp pavilion 14-b109wm I forgot the administrator password system off 73875331 code

    I forgot the administrator password after trying 3 times now says system disabled code 73875331 please help need laptop for work thank you

  • Cannot open or save a file

    Win 7 Enterprise, CVI 2015. Just recently, I can no longer save a file, save a file, or open any file in CVI. The CVI stops immediately, with the popup of the message below.  Don't think, just instantly. I uninstalled all the software, reinstalled CV

  • External monitor problem

    Let me start by saying that I had this work once.  Here is what happened.  I was watching Netflix on my laptop using my flat screen tv as a monitor. The monitor of the laptop was also.  When the video started to freeze intermittently, I thought that

  • Search for files by using the Start button

    I've lost the ability to search for files by using the Start button.  I can enter a file name, but always get a response "nothing found".  I know I did something back a couple of weeks, but don't know what I did to turn it off. Help! Thank you!