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

Tags: Oracle Development

Similar Questions

  • How to move from window to another screen with keyboard

    Hello

    Using extended display, monitor 2 is a few feet away, making it difficult to manipulate the window with a mouse.  I've seen several shortcuts which supposedly do the following, but none of them worked.  So be as specific as possible when I'm doing something wrong.

    How can I use the keyboard to move the display of Monitor 2 to monitor 1, where I can handle?

    How can I use the keyboard to display on a monitor 2 full screen and way (I do not remember what we call the size between small and larger)?

    Also, sometimes (but not always) monitor programs open on 2 but I want them to open the monitor 1.  How can I make sure that they have always opened on 1 monitor?

    Thank you for any help you can give.

    These options may be available when you use the specific multimonitor software provided by your graphics card manufacturer (or third party), they are not available with built in multi-monitor win driver

    (They are no longer available at multiscreen Nvidia, under win7 drivers, whereas they were available under Windows XP with the same graphic card)

  • How to move from the photo library?

    How to move from the photo library? How to use more than one library?  I would like one on a second partition for work stuff and hand over folder for personal stuff.

    Do the drag to another volume and launch Photos with down necessary option.

    (144134)

  • How to move from x 1 standard x 1 pro and what is the cost?

    How to move from x 1 standard x 1 pro and what is the cost?

    Hi Chris,

    XI STD. Pro XI upgrade path is not currently available.

    I would say that the last DC Acrobat upgrade

    Kind regards

    Rave

  • How to call a stored procedure with a REF CURSOR output parameter

    I'm looking forward to example calling a function/stored procedure with a REF CURSOR output parameter and get the result.
    In other words, I have a stored function/procedure that runs a SELECT statement using the OCI library and then he could get the values of each row and each column.

    I put a code snippet, it have only the main thing to call a simple stored procedure and to print the name of each column of the cursor, but I couldn t to print out values in the table that calls the stored procedure.
    I understand that the next step is to call an OCIStmtFetch.
    How to associate the slider with the OCIStmtFetch?

    If you need more information, just tell me.

    I use ANSI C with HP - UX (HP - UX C) operating system and Oracle 10 g.


    Kind regards.

    Antonio Garcia


    / * callOracleSP * /.

    #include < stdio.h >
    #include < string.h >
    #include < oci.h >
    #include < stdlib.h > to

    char * pConnectChar = "Server";
    char * pUsernameChar = "user";
    char * pPasswordChar = "passwd";
    char * sqlCharArray1 = "BEGIN SP_GETCITIES (:,: c); END; « ;
    int retval;
    UB4 parmcnt = 0;
    UB4 pos2 = 0;
    text * pcoln [20];
    UB4 namelen [20];
    char state_key [5];

    OCIStmt * pOciStatement;
    OCIStmt * pOciStatCursor;
    OCIError * pOciError;
    OCIEnv * pOciEnviron;
    OCIServer * pOciServer;
    OCISession * pOciSession;
    OCISvcCtx * pOciServiceContext;
    OCIBind * pOciBind [500];
    OCIParam * pOciParam;


    int main()
    {
    retval = OCIEnvCreate (& pOciEnviron, OCI_DEFAULT, NULL, NULL, NULL, NULL, 0, NULL);
    retval = OCIEnvInit (& pOciEnviron, OCI_DEFAULT, 0, NULL);
    retval = OCIHandleAlloc (pOciEnviron, (void *) & pOciError, OCI_HTYPE_ERROR, 0, NULL);
    retval = OCIHandleAlloc (pOciEnviron, (void *) & pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
    retval = OCIHandleAlloc (pOciEnviron, (void *) & pOciStatement, OCI_HTYPE_STMT, 0, NULL);

    retval = OCILogon (pOciEnviron, pOciError, & pOciServiceContext,(unsigned char *) pUsernameChar,
    strlen (pUsernameChar), (unsigned char *) pPasswordChar, strlen (pPasswordChar).
    (unsigned char *) pConnectChar, strlen (pConnectChar));
    printf ("retval=%d\n",retval OCILogon);

    retval = OCIStmtPrepare (pOciStatement, pOciError, (unsigned char *) sqlCharArray1, strlen (sqlCharArray1),)
    OCI_NTV_SYNTAX, OCI_DEFAULT);
    printf ("StmtPrepare retval=%d\n",retval);

    retval = OCIHandleAlloc (pOciEnviron, (void *) & pOciStatCursor, OCI_HTYPE_STMT, 0, NULL);
    retval = 1 OCIBindByPos(pOciStatement,&pOciBind[0], pOciError, (ub4), (void *) & state_key,)
    ((sb4) sizeof (state_key), SQLT_STR, (void *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT (ub4));
    printf ("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);

    retval = OCIBindByPos(pOciStatement,&pOciBind[1], pOciError, (ub4) 2, (void *) & pOciStatCursor,)
    ((sb4) 0, SQLT_RSET, (void *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT (ub4));
    printf ("BindByPos OCI_HTYPE_STMT retval=%d\n",retval);

    strcpy (state_key, 'ca');

    retval = OCIStmtExecute (pOciServiceContext, pOciStatement, pOciError, (ub4) 1, (ub4) 0,)
    (OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT (ub4));
    printf ("StmtExecute retval=%d\n",retval);

    / * How to get the values of the cursor? */

    / * Number of parameters of the cursor * /.
    OCIAttrGet ((void *) pOciStatCursor, OCI_HTYPE_STMT (ub4), (void *) & parmcnt,(ub4 *) 0,)
    (ub4) (OCI_ATTR_PARAM_COUNT, pOciError);
    printf ("\nNumber of the slider settings = %d\n",parmcnt);

    for (int pos = 1; pos < = (int) parmcnt; pos ++)
    {
    OCIAttrGet ((void *) pOciStatCursor, OCI_HTYPE_STMT (ub4), (void *) & pos2,(ub4 *) 0,)
    (ub4) (OCI_ATTR_CURRENT_POSITION, pOciError);
    retval = OCIParamGet ((void *) pOciStatCursor, OCI_HTYPE_STMT (ub4), pOciError, (void *) & pOciParam,)
    POS (ub4));
    OCIAttrGet pOciParam, (ub4) ((void*) OCI_DTYPE_PARAM,(void*) & pcoln [pos - 1],(ub4 *) & namelen [pos-1],)
    (ub4) OCI_ATTR_NAME,(OCIError *) pOciError);
    }
    for (int i = 1; i < = (int) parmcnt; i ++)
    printf ("%i\tNAME = % column. ("* s\n", i, namelen [i-1], pcoln [i-1]);

    return 0;
    }


    This is the script that create the table, insert records and create the stored procedure

    CREATE TABLE CITIES)
    STATE_CODE VARCHAR2 (2) NULL,
    CITY_CODE NUMBER (15.5) NULL,
    CITY_NAME VARCHAR2 (30) NULL
    )
    /


    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('CA', 30, 'SAN DIEGO')
    /
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('CA', 40 'SACRAMENTO')
    /
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('FL', 10, 'MIAMI')
    /
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('FL', 20, 'ORLANDO')
    /
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('NEW YORK', 10, 'NEW YORK')
    /
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('NEW YORK', 20, 'ALBANY')
    /
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('CA', 10, 'LOS ANGELES')
    /
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES ('CA', 20, 'SAN FRANCISCO')
    /


    CREATE or REPLACE PACKAGE globalPkg AUTHID CURRENT_USER AS
    / * The following is specific global variables T/SQL. */
    TYPE RCT1 IS REF CURSOR; / * new cursor low definition * /.
    END globalPkg;
    /



    CREATE OR REPLACE PROCEDURE SP_ADDCITY)
    P_STATE_CODE IN VARCHAR,
    P_CITY_CODE NUMBER,
    P_CITY_NAME IN VARCHAR2,
    P_RETURN IN NUMBERS)
    AS
    StoO_error INTEGER;
    StoO_selcnt INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2 (255);

    BEGIN
    StoO_rowcnt: = 0;
    StoO_error: = 0;
    StoO_selcnt: = 0;
    P_RETURN: = 0;
    INSERT INTO CITIES (STATE_CODE, CITY_CODE, CITY_NAME)
    VALUES (P_STATE_CODE, P_CITY_CODE, P_CITY_NAME);
    StoO_rowcnt: = number of LINES SQL %;
    EXCEPTION
    WHEN TOO_MANY_ROWS THEN
    StoO_rowcnt: = 2;
    WHILE OTHERS THEN
    StoO_rowcnt: = 0;
    StoO_selcnt: = 0;
    StoO_error: = SQLCODE;
    StoO_errmsg: = SQLERRM;
    IF StoO_error! = 0 THEN
    BEGIN
    P_RETURN: = 1;
    RETURN;
    END;
    END IF;
    END;
    /

    CREATE OR REPLACE PROCEDURE SP_GETCITIES)
    STATE_KEY IN VARCHAR,
    RC1 IN OUT globalPkg.RCT1)
    AS
    StoO_error INTEGER;
    StoO_selcnt INTEGER;
    StoO_rowcnt INTEGER;
    StoO_errmsg VARCHAR2 (255);
    BEGIN
    StoO_rowcnt: = 0;
    StoO_error: = 0;
    StoO_selcnt: = 0;
    OPEN FOR RC1
    SELECT STATE_CODE, CITY_CODE, FRANCISCO
    CITIES
    WHERE STATE_CODE = STATE_KEY
    ORDER BY CITY_CODE;
    StoO_rowcnt: = number of LINES SQL %;
    EXCEPTION
    WHILE OTHERS THEN
    StoO_rowcnt: = 0;
    StoO_error: = SQLCODE;
    StoO_errmsg: = SQLERRM;
    END;
    /

    Hi Antonio,.

    I see this:

    c_buf=(ub1 **)calloc(sizeof(ub1 *),3);
    
    ...
    
    rc=OCIDefineByPos(pOciStatCursor,&pdef,(OCIError *)pOciError,pos,c_buf[pos-1],size+1,(ub2)type,(dvoid *)c_indp[pos-1],(ub2 *)0,(ub2 *)0,OCI_DEFAULT);
    

    That I don't understand. You allocate space for 3 pointers ub1 but I don't see where these pointers are then initialized to point to where the data is to be stored.

    I do not read correctly?

    Sorry for posting code long, but here is an example of code that I have. It is much more 'code' for your code, but maybe that will be enough...

    NOTE: This is just the code example and not rigorous. For example, I don't check the memory, allocations etc in this code!

    Kind regards

    Mark

    #ifdef WIN32
    #define _CRT_SECURE_NO_DEPRECATE 1
    #endif
    
    #include 
    #include 
    #include 
    #include 
    
    void checkerr(sword status, OCIError *errhp);
    
    int main(int argc, char *argv[]) {
      OCIEnv      *envhp = NULL;  /* OCI Environment handle     */
      OCIError    *errhp = NULL;  /* OCI Error handle           */
      OCISvcCtx   *svchp = NULL;  /* OCI Service Context handle */
      OCIServer   *srvhp = NULL;  /* OCI Server handle          */
      OCISession  *usrhp = NULL;  /* OCI User Session handle    */
    
      OCIStmt     *stmtp = NULL;  /* OCI Statement handle       */
      OCIStmt     *cursr = NULL;  /* OCI Statement handle       */
    
      OCIParam    *prmp1 = NULL;  /* OCI Parameter handle       */
      OCIParam    *prmp2 = NULL;  /* OCI Parameter handle       */
      OCIParam    *prmp3 = NULL;  /* OCI Parameter handle       */
    
      OCIDefine   *defp1 = NULL;  /* OCI Define handle          */
      OCIDefine   *defp2 = NULL;  /* OCI Define handle          */
      OCIDefine   *defp3 = NULL;  /* OCI Define handle          */
    
      OCIBind     *bndp1 = NULL;  /* OCI Bind handle            */
      OCIBind     *bndp2 = NULL;  /* OCI Bind handle            */
      OCIBind     *bndp3 = NULL;  /* OCI Bind handle            */
    
      /* used to hold column width */
      ub2 col_width;
    
      /* used to set the prefetch count */
      ub4 prefetch_count = 32;
    
      /* will hold output from database */
      oratext *pEmpId = NULL;
      oratext *pFirstName = NULL;
      oratext *pLastName = NULL;
    
      /* the anonymous block to execute */
      /* this opens a ref cursor        */
      oratext *sqlstmt = "begin " \
                         "  open :1 for " \
                         "  select   to_char(employee_id), " \
                         "           first_name, " \
                         "           last_name " \
                         "  from     hr.employees " \
                         "  order by last_name, " \
                         "           first_name; " \
                         "end;";
    
      /* used to hold the results of each OCI call */
      sword result = 0;
    
      /* Initialize and create a default environment  */
      result = OCIEnvCreate(&envhp,
                            OCI_DEFAULT,
                            (dvoid *) 0,
                            0,
                            0,
                            0,
                            (size_t) 0,
                            (dvoid **) 0);
    
      /* allocate an error handle */
      result = OCIHandleAlloc((dvoid *) envhp,
                              (dvoid **) &errhp,
                              OCI_HTYPE_ERROR,
                              0,
                              (dvoid **) 0);
    
      /* allocate a service context handle */
      result = OCIHandleAlloc((dvoid *) envhp,
                              (dvoid **) &svchp,
                              OCI_HTYPE_SVCCTX,
                              0,
                              (dvoid **) 0);
    
      /* allocate a server handle */
      result = OCIHandleAlloc((dvoid *) envhp,
                              (dvoid **) &srvhp,
                              OCI_HTYPE_SERVER,
                              0,
                              (dvoid **) 0);
    
      /* allocate a user session handle */
      result = OCIHandleAlloc((dvoid *) envhp,
                              (dvoid **) &usrhp,
                              OCI_HTYPE_SESSION,
                              0,
                              (dvoid **) 0);
    
      /* create a server context using the "ORADEMO" database */
      result = OCIServerAttach(srvhp,
                               errhp,
                               "ORADEMO",
                               (ub4) strlen("ORADEMO"),
                               OCI_DEFAULT);
    
      /* set the server attribute in the service context handle */
      result = OCIAttrSet((dvoid *) svchp,
                          OCI_HTYPE_SVCCTX,
                          (dvoid *) srvhp,
                          (ub4) 0,
                          OCI_ATTR_SERVER,
                          errhp);
    
      /* open the session with the database */
      /* using external authentication      */
      result = OCISessionBegin(svchp,
                               errhp,
                               usrhp,
                               OCI_CRED_EXT,
                               OCI_DEFAULT);
    
      /* set the user session attribute in the service context handle */
      result = OCIAttrSet((dvoid *) svchp,
                          OCI_HTYPE_SVCCTX,
                          (dvoid *) usrhp,
                          (ub4) 0,
                          OCI_ATTR_SESSION,
                          errhp);
    
      /* allocate the statement handle */
      result = OCIHandleAlloc((dvoid *) envhp,
                              (dvoid **) &stmtp,
                              OCI_HTYPE_STMT,
                              0,
                              (dvoid **) 0);
    
      /* prepare the statement for execution */
      result = OCIStmtPrepare(stmtp,
                              errhp,
                              sqlstmt,
                              (ub4) strlen((char *) sqlstmt),
                              OCI_NTV_SYNTAX,
                              OCI_DEFAULT);
    
      /* allocate the handle for the ref cursor */
      result = OCIHandleAlloc((dvoid *) envhp,
                              (void **) &cursr,
                              OCI_HTYPE_STMT,
                              0,
                              NULL);
    
      /* bind the ref cursor parameter */
      result = OCIBindByPos(stmtp,
                            &bndp1,
                            errhp,
                            1,
                            &cursr,
                            0,
                            SQLT_RSET,
                            NULL,
                            0,
                            NULL,
                            0,
                            0,
                            OCI_DEFAULT);
    
      /* execute the statement */
      result = OCIStmtExecute(svchp,
                              stmtp,
                              errhp,
                              1,
                              0,
                              NULL,
                              NULL,
                              OCI_DEFAULT);  
    
      /* get parameter descriptor for first column */
      result = OCIParamGet((dvoid *) cursr,
                           OCI_HTYPE_STMT,
                           errhp,
                           (dvoid **) &prmp1,
                           (ub4) 1);
    
      /* get parameter descriptor for second column */
      result = OCIParamGet((dvoid *) cursr,
                           OCI_HTYPE_STMT,
                           errhp,
                           (dvoid **) &prmp2,
                           (ub4) 2);
    
      /* get parameter descriptor for third column */
      result = OCIParamGet((dvoid *) cursr,
                           OCI_HTYPE_STMT,
                           errhp,
                           (dvoid **) &prmp3,
                           (ub4) 3);
    
      /* get the first column width in characters */
      result = OCIAttrGet((dvoid*) prmp1,
                          (ub4) OCI_DTYPE_PARAM,
                          (dvoid*) &col_width,
                          (ub4 *) 0,
                          (ub4) OCI_ATTR_DATA_SIZE,
                          errhp);
    
      /* allocate memory to hold the result */
      pEmpId = (oratext *) malloc(sizeof(oratext) * (col_width + 1));
    
      /* define the first column in the results */
      result = OCIDefineByPos(cursr,
                              &defp1,
                              errhp,
                              1,
                              (dvoid *) pEmpId,
                              (sword) col_width + 1,
                              SQLT_STR,
                              (dvoid *) NULL,
                              (ub2 *) 0,
                              (ub2 *) 0,
                              OCI_DEFAULT);
    
      /* get the second column width in characters */
      result = OCIAttrGet((dvoid*) prmp2,
                          (ub4) OCI_DTYPE_PARAM,
                          (dvoid*) &col_width,
                          (ub4 *) 0,
                          (ub4) OCI_ATTR_DATA_SIZE,
                          errhp);
    
      /* allocate memory to hold the result */
      pFirstName = (oratext *) malloc(sizeof(oratext) * (col_width + 1));
    
      /* define the second column in the results */
      result = OCIDefineByPos(cursr,
                              &defp2,
                              errhp,
                              2,
                              (dvoid *) pFirstName,
                              (sword) col_width + 1,
                              SQLT_STR,
                              (dvoid *) NULL,
                              (ub2 *) 0,
                              (ub2 *) 0,
                              OCI_DEFAULT);
    
      /* get the third column width in characters */
      result = OCIAttrGet((dvoid*) prmp3,
                          (ub4) OCI_DTYPE_PARAM,
                          (dvoid*) &col_width,
                          (ub4 *) 0,
                          (ub4) OCI_ATTR_DATA_SIZE,
                          errhp);
    
      /* allocate memory to hold the result */
      pLastName = (oratext *) malloc(sizeof(oratext) * (col_width + 1));
    
      /* define the third column in the results */
      result = OCIDefineByPos(cursr,
                              &defp3,
                              errhp,
                              3,
                              (dvoid *) pLastName,
                              (sword) col_width + 1,
                              SQLT_STR,
                              (dvoid *) NULL,
                              (ub2 *) 0,
                              (ub2 *) 0,
                              OCI_DEFAULT);
    
      /* loop through and print the results */
      while ((result = OCIStmtFetch(cursr,
                                    errhp,
                                    (ub4) 1,
                                    (ub2) OCI_FETCH_NEXT,
                                    (ub4) OCI_DEFAULT)) == OCI_SUCCESS)
      {
        printf("Employee ID: %s\n", pEmpId);
        printf(" First Name: %s\n", pFirstName);
        printf("  Last Name: %s\n\n", pLastName);
      }
    
      /* free allocated memory */
      free(pEmpId);
      free(pFirstName);
      free(pLastName);
    
      pEmpId = NULL;
      pFirstName = NULL;
      pLastName = NULL;
    
      /* terminate the session with the database */
      result = OCISessionEnd(svchp, errhp, usrhp, OCI_DEFAULT);
    
      /* detach from the server */
      result = OCIServerDetach(srvhp, errhp, OCI_DEFAULT);
    
      /* deallocate the environment handle     */
      /* OCI will deallocate the child handles */
      result = OCIHandleFree((dvoid *) envhp, OCI_HTYPE_ENV);
    
      return OCI_SUCCESS;
    }
    
    void checkerr(sword status, OCIError *errhp)
    {
      oratext errbuf[512];
      sb4 errcode = 0;
    
      switch (status) {
        case OCI_SUCCESS:
          break;
    
        case OCI_ERROR:
        case OCI_SUCCESS_WITH_INFO:
          (void) OCIErrorGet((dvoid *) errhp, (ub4) 1, (oratext *) NULL, &errcode, errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
          (void) printf("Error: %.*s\n", sizeof(errbuf), errbuf);
          break;
    
        case OCI_NEED_DATA:
          (void) printf("Error - OCI_NEED_DATA\n");
          break;
    
        case OCI_NO_DATA:
          (void) printf("Error - OCI_NO_DATA\n");
          break;
    
        case OCI_INVALID_HANDLE:
          (void) printf("Error - OCI_INVALID_HANDLE\n");
          break;
    
        case OCI_STILL_EXECUTING:
          (void) printf("Error - OCI_STILL_EXECUTING\n");
          break;
    
        case OCI_CONTINUE:
          (void) printf("Error - OCI_CONTINUE\n");
          break;
    
        default:
          break;
      }
    }
    
  • How to move the lob segment in a partitioned table

    My Oracle 11.2, I have a partitioned table that I want to switch to a different tablespace

    After invoking the script, there are still inside for the insensitive lob segment table
    CREATE TABLE BONGO.AAA_3
    (
      ID       NUMBER,
      DATUM    DATE,
      OBJEKAT  BLOB
    )
    TABLESPACE BONGODATA_HUGE
    PCTUSED    40
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    LOGGING
    PARTITION BY RANGE (DATUM)
    (  
      PARTITION P_MAXVALUE VALUES LESS THAN (MAXVALUE)
        LOGGING
        NOCOMPRESS
        TABLESPACE BONGODATA_HUGE
    LOB (OBJEKAT) STORE AS 
            (   TABLESPACE  BONGODATA 
              ENABLE        STORAGE IN ROW
              CHUNK       8192
              RETENTION
              NOCACHE
              STORAGE    (
                          INITIAL          64K
                          NEXT             1M
                          MINEXTENTS       1
                          MAXEXTENTS       UNLIMITED
                          PCTINCREASE      0
                          FREELISTS        1
                          FREELIST GROUPS  1
                          BUFFER_POOL      DEFAULT
                         )
            )
        PCTUSED    40
        PCTFREE    10
        INITRANS   1
        MAXTRANS   255
        STORAGE    (
                    INITIAL          64K
                    NEXT             1M
                    MINEXTENTS       1
                    MAXEXTENTS       UNLIMITED
                    FREELISTS        1
                    FREELIST GROUPS  1
                    BUFFER_POOL      DEFAULT
                   )
    )
    NOCOMPRESS 
    NOCACHE
    NOPARALLEL
    MONITORING;
    How to move this lob segment in a partitioned table?

    or, is there a package for data move in storage?

    concerning

    ALTER TABLE current_table MOVE PARTITION nom_partition
    TABLESPACE destination_table_space
    LOB (column_name) STORE AS (TABLESPACE current_tablespace);

  • How to move from areas of an image?

    • How can I move from areas of an image?
    • I have a picture with the sketch of a dog at the bottom of the image, with script above it. All I want to do is go down the script and move the dog up. I spent hours trying to do or not this result.
    • Help!
    • Pen-K5

    Here I chose the dog and copied/pasted into a new layer.

    Done the same with the poem.

    The move tool to reposition the two layers.

    The full original white background layer.

  • How to move from the physical layer to the business layer

    Hello

    I added schema SH to my physical layer, how to move that layer business and layer of presentation? If I want all the tables and the columns of this pattern to my company and Presenattion of the layer.

    Thank you.

    Hello

    Please find below the link he gives step by step help you from beginning to advance

    http://www.Oracle.com/technology/OBE/obe_bi/bi_ee_1013/bi_admin/biadmin.html

    assign as correct, so useful

    Thank you

  • How to move from the old iMac, iMac (24-inch mid 2007) to the new

    Got an iMac (24-inch mid 2007), and the desire to buy a new... How to transfer from 'old' iMac again?

    You will have the option to do so when you set up the new iMac; He can run through a network, external drive or disc mode target.

    (140878)

  • If you use vista, how to move from one account to another windows messaging?

    My set cable company in place for e-mail accounts.  One for my wife and one for me.  My wifes account is the default value.  How to switch from one account to another?

    I searched through default settings, account information, etc. anything. I believe that under XP, you could choose an account or another.

    OE has the option of identities, Winmail opener does not work. Unless you have separate Windows logons, you use the same instance of WinMail and share the same Inbox, unless you create another and divert the mail with message rules. The only "switch" you have at the moment is when you compose a new message, there is an arrow down to the right of the field to choose the account, the message will be.

  • 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;
    /
    
  • How to change the name of the attribute with ALTER TYPE?

    I have a question. How can I change the name of the attribute with ALTER TYPE? example:

    CHANGE the type of ATTRIBUTE to CHANGE type_attribute...

    What should I put in «...» "to change the attribute name?

    Thank you...

    What should I put in «...» "to change the attribute name?

    You can not. You can change the data type.

    You can delete and recreate the attribute:

    ALTER TYPE type DROP ATTRIBUTE type_attribute;
    ALTER TYPE type ADD ATTRIBUTE new_type_attribute data_type;
    

    Max

  • How to move from one screen to the other applications?

    In order to organize some screens after installing several applications, how can we move them from one screen to the other?
    I found it possible to place them in the bottom bar and then replace them in the necessary form, but it is very slow...
    Another way?

    Also, is it possible to place the apps where we want to and not automatically bring reorganized (empty filled)?
    Thank you

    DUPE: https://support.mozilla.org/en-US/forums/firefox-os-english-forum/709563

  • How to move from entry to a BACK executable that runs in parallel to a VI

    I use the system Exec to call an executable BACK that then runs in the background in parallel to a VI. During his execution, the executable is controlled by commands that are typed to her, and I need to be able to move these controls to the executable file for the duration of the execution of my VI. (This is different from unique parameters that I can pass the command line before you run the program.)

    Other discussions on this forum seem to indicate passing entry and exit back-and-forth with executables called via the command Exec System using a temporary file which is regularly queryied by VI and the executable file. In my case, it is not feasible as I need to be able to do this very quickly and, at times, often.

    Does anyone have a solution to directly deliver my orders (text) of the executable running in the background of BACK? I found an approach posted by smercurio_fc to: http://forums.ni.com/t5/LabVIEW/URGENT-How-we-read-stdout-directly/td-p/801983 , it looks promising but I do not know if it would solve my problem, because I couldn't see the solution (cannot open the examples as they are written for LabView 8, and I am running Version 7.1.).

    Thanks in advance for all tracks.

    In libraries OpenG is a library that allows you to open a command line as with SystemExec utility and gets its standard input and output to the stream that can be read and written as. It is still Alpha State, sort of since there are some other tests made on different versions of Windows, but it works for me so far.

    Check out this thread.

  • How to move from the position of the START button on the screen of my Windows vista?

    I wonder why the START button of my windows vista changes its position on the screen of my laptop. I tried to search the solution by right-clicking the windows logo ang then go to properties and proceed to the taskbar button. From there I could not fined option on how to change the position of my taskbar, usually on the lower part of the horizontal of the monitor. Now, he has moved from the left upright. I need to restore the parameters passed. Please help me.

    Hello

    read this:

    http://Windows.Microsoft.com/en-us/Windows-Vista/unlock-and-move-the-taskbar

    Unlock and move the taskbar

    Once you unlock the taskbar, it is ready to move to any horizontal or vertical office edge.

    Taskbar

    View all

    To unlock the taskbar
    • Right click on a space empty in the taskbar. If a checkmark beside him doesn't lock the taskbar, the taskbar is locked. You can unlock it by clicking on lock the taskbar, which removes the check mark.

      Note

      To lock the taskbar into place, right-click an empty space in the task bar, then click on lock the taskbar, so that the box is displayed.

    • Click on an empty space on the taskbar, and then hold down the mouse button, dragging the taskbar to one of the four sides of the office. Once the taskbar where you want, release the mouse button.

Maybe you are looking for

  • Tecra 8200: TV output refuses to work under Linux

    Hi guys! My tv-out will not work on linux with X. Anyone have a bit of luck and get this to work? The problem is with refresh rate I think the screen right color but is very deformated :( It works well with Windows XP and the console but I can't unde

  • WiFi connections: Laptop HP cannot find the 5 GHz wireless signal?

    Hello, this is my first post I just bought my first laptop and my first wireless router and have been setting them up. Laptop: HP touch laptop Pavilion 15 15-n088ca with windows (fully updated) 8.1 Router: D-Link Dual Band AC1000-band 2.5 GHz & 5 GHz

  • Loose headphone

    A few days ago I received my Compact awaited Z3. I'm very happy with the phone, but a few minutes ago, I noticed a flaw. It seems that the headphone jack is loose. When I insert the PIN there is a room important were you can move the PIN. I will cont

  • Reinstalling Windows XP OS

    HY computer was hacked and phished and does not work properly. Maybe I need to reinstall the operating system. I have a set of 12 disc called "Compaq recovery one.» This retrieves only lost programs or is it format the hard drive and reinstall the os

  • Win 7 - shared folder - sharing turns off sometimes

    I shared a folder in Win 7 PC. At any given time when customer accesses to / / ip-address, it's keep on request for credentials. When I turn off and turn on the network in Windows 7, it works fine. What is the real problem. ?