Use FOR... LOOP counter in the treatment of PL/SQL procedures with nest. Table

Hi all!
I learn PL/SQL on the book by Steve Bobrovsky (specified below, sample comes from it) and I have a question.

In the procedure of the below specified program used a currentElement integer variable to get the reference to the line in the nested table of data type % ROWTYPE.
Meanwhile, the program itself uses a common FOR... LOOP counter I have.
DECLARE
 TYPE partsTable IS TABLE OF parts%ROWTYPE;
 tempParts partsTable := partsTable();
 CURSOR selectedParts IS 
  SELECT * FROM parts ORDER BY id;
 currentPart selectedParts%ROWTYPE;
 currentElement INTEGER;
 PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS
  BEGIN
   DBMS_OUTPUT.PUT_LINE(' ');
   DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT);
   currentElement := p_collection.FIRST;
   FOR i IN 1 .. p_collection.COUNT
   LOOP
    DBMS_OUTPUT.PUT('Element #' || currentElement || ' is ');
     IF tempParts(currentElement).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.');
     ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(currentElement).id || ' DESCRIPTION: ' || tempParts(currentElement).description);
     END IF;
    currentElement := p_collection.NEXT(currentElement);
   END LOOP;
 END printParts;
BEGIN
 FOR currentPart IN selectedParts
 LOOP
  tempParts.EXTEND(2);
  tempParts(tempParts.LAST) := currentPart;
 END LOOP;
 printParts('Densely populated', tempParts);
 FOR i IN 1 .. tempParts.COUNT
 LOOP
  IF tempParts(i).id is NULL THEN tempParts.DELETE(i);
  END IF;
 END LOOP;
 FOR i IN 1 .. 50
 LOOP
  DBMS_OUTPUT.PUT('-');
 END LOOP;
 printParts('Sparsely populated', tempParts);
END;
/
When I substituted a global variable of INTEGER type such for... The LOOP counter, an APEX have returned an error "ORA-01403: no data found.
DECLARE
 TYPE partsTable IS TABLE OF parts%ROWTYPE;
 tempParts partsTable := partsTable();
 CURSOR selectedParts IS 
  SELECT * FROM parts ORDER BY id;
 currentPart selectedParts%ROWTYPE;
 PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS
  BEGIN
   DBMS_OUTPUT.PUT_LINE(' ');
   DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT);
   FOR i IN 1 .. p_collection.COUNT
   LOOP
    DBMS_OUTPUT.PUT('Element is ');
     IF tempParts(i).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.');
     ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(i).id || ' DESCRIPTION: ' || tempParts(i).description);
     END IF;
   END LOOP;
 END printParts;
BEGIN
 FOR currentPart IN selectedParts
 LOOP
  tempParts.EXTEND(2);
  tempParts(tempParts.LAST) := currentPart;
 END LOOP;
 printParts('Densely populated', tempParts);
 FOR i IN 1 .. tempParts.COUNT
 LOOP
  IF tempParts(i).id is NULL THEN tempParts.DELETE(i);
  END IF;
 END LOOP;
 FOR i IN 1 .. 50
 LOOP
  DBMS_OUTPUT.PUT('-');
 END LOOP;
 printParts('Sparsely populated', tempParts);
END;
/
When I tried to manage this code in SQL * Plus, the following picture emerged:
Densely populated elements: 10
Element is an empty element.
Element is ID: 1 DESCRIPTION: Fax Machine
Element is an empty element.
Element is ID: 2 DESCRIPTION: Copy Machine
Element is an empty element.
Element is ID: 3 DESCRIPTION: Laptop PC
Element is an empty element.
Element is ID: 4 DESCRIPTION: Desktop PC
Element is an empty element.
Element is ID: 5 DESCRIPTION: Scanner
--------------------------------------------------
Sparsely populated elements: 5
DECLARE
*                                                 
ERROR at line 1:                                  
ORA-01403: no data found                          
ORA-06512: at line 14                             
ORA-06512: at line 35
What's not in the code (or what I did not understand)? Help please!

Your error occurs because you are dealing with a sparsely populated collection and using an index for items that do not exist.

For collections of the low density of population, you must iterate through using FIRST and THEN as modeled not from 1 to COUNT.

The crucial difference between your code and the example is:

tempParts(i)

Which, as you have demonstrated, doesn't work very well (!) if there is no item (i).

The code example is a little unusual in my opinion.

   currentElement := p_collection.FIRST;
   FOR i IN 1 .. p_collection.COUNT
   LOOP
    ...
    currentElement := p_collection.NEXT(currentElement);
   END LOOP;

It works, but it's an unusual way to iterate through a collection of rare which is perhaps most often done like this:

   currentElement := p_collection.FIRST;
   WHILE(currentElement IS NOT NULL)
   LOOP
    ...
    currentElement := p_collection.NEXT(currentElement);
   END LOOP;

Which is perhaps less open to confusion.

In the end, the distinction between

tempParts(currentElement).id

and

tempParts(i).id

is crucial.

Tags: Database

Similar Questions

  • I made a new music video for a song, and the music is not in time with the film, how I put in time?

    I made a new music video for a song, and the music is not in time with the film, how I put in time?
    Oh and I'm using WIndows Movie Maker. One.

    Please repost in Windows Live Solution Center.
    Forum on Windows Live Movie maker:
    http://windowslivehelp.com/forums.aspx?ProductID=5

  • Call the PL/SQL procedure with in out parameter of OIC clob

    Hello

    For a few days, I am facing a problem. I have to call the pl/sql procedure with colb parameter out. I use c ++ and OIC (don't ask me why :)).

    I use a pl/sql problem test procedure:

    create or replace function Test (longField outside clob) return number is
    Number of result;
    Start
    longField: = 'prefix ';
    Result: = 12;
    Return (result);
    end Test;

    So I do all the stuff with the connection to the DB,

    I prepare the statement: "start: res: = test(:param); end; »
    So I OCIHandleAlloc (m_pCtx-> hpEnv,
    (void *) & m_hpStatement,.
    OCI_HTYPE_STMT,
    0,
    (NULL);
    and
    OCIStmtPrepare (m_hpStatement,
    m_pCtx-> hpErr,
    (...),
    (...),
    OCI_NTV_SYNTAX,
    OCI_DEFAULT);

    Before the binding I prepare parameters. For a clob I devote to the lob Locator:

    OCIDescriptorAlloc ((dvoid *) m_pCtx-> hpEnv, (dvoid *) & m_pLobLocator,)
    (ub4) OCI_DTYPE_LOB (size_t) 0, (dvoid *) 0);
    OCILobEnableBuffering (m_pCtx-> hpContext, m_pCtx-> hpErr, (OCILobLocator *) m_pLobLocator);

    that I bind parameters using OCIBindByName and OCIStmtExecute statement execution.

    I get an error
    ---------------------------
    Microsoft Visual C++
    ---------------------------
    Unhandled exception in... (ORAOCIEI11. (DLL): 0xC0000005: Access Violation.

    My question is: is it possible to call the pl/sql procedure with parameter BEAK clob?
    If Yes, what steps I need to do to succeed?

    Thank you for your response.

    Hello

    Of course, it is possible :)

    Show that you are your piece of code that is binding.
    Are you sure you had correctly the lob descriptor in the call to bind?

  • I want to loop through the data from two different tables using for loop where the query should be replaced at runtime, please help me

    I have the data into two table with the structure of similar column, I want to loop through the data in these two tables

    based on some condition and runtime that I want to put the query in loop for example, the example is given, please help me

    create table ab (a number, b varchar2 (20));

    Insert into ab

    Select rownum, rownum. "" sample "

    of the double

    connect by level < = 10

    create table bc (a number, b varchar2 (20));

    Insert into BC.

    Select rownum + 1, rownum + 1 | "" sample "

    of the double

    connect by level < = 10

    declare

    l_statement varchar2 (2000);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: =' select * ab ';

    on the other

    l_statement: =' select * from bc';

    end if

    I'm in execute immediate l_statement - something like that, but I don't know

    loop

    dbms_output.put_line (i.a);

    end loop;

    end;

    Something like that, but this isn't a peace of the code work.

    Try this and adapt according to your needs:

    declare

    l_statement varchar2 (2000);

    c SYS_REFCURSOR;

    l_a number;

    l_b varchar2 (20);

    Boolean bool;

    Start

    bool: = true;

    If it is true, then

    l_statement: = "select a, b, AB;

    on the other

    l_statement: = "select a, b from bc;

    end if;

    --

    Open c for l_statement;

    --

    loop

    extract the c in l_a, l_b;

    When the output c % notfound;

    dbms_output.put_line (l_a |') -' || l_b);

    end loop;

    close c;

    end;

    /

  • Indexing for loop while seizing the unique values in table

    Hi all

    I have another question. Overall, I have a table and I want to take each element of this array. My thoughts of how do are the following:

    I use a loop for the indexing of my table. Then I create a local variable outside of the loop in order to get the individual elements of the array. But it does not work I think because the local variable is not updated at each iteration.

    Also, it feels like there is a more elegant way to do what I want to do.

    Can someone give me some advice to solve my problem?

    Thank you very much.

    Best regards

    Tresdin

    I don't know why you are so hung up with a local variable to send sequential orders of VISA.

    Here's what I do:

    That sends commands to the SCPI 7 to my AC source with a delay of 100 ms between each command sent.

  • While loop: counter in the name field

    Here is the code I have. I tested it and it works on the number one field. (in Formcalc)

    if ((FS270Pt1 > = 28,5) and (FS270Pt1 < = 38))

    then FS270Pt1.font.fill.color.value = '0,0,0 '.

    else FS270Pt1.font.fill.color.value = "255,0,0".

    endif

    I have 15 number fields should I apply this color to font for the criteria must be respected.  I try to use a while statement to achieve this.  I know that I have deduced that it should look like this:

    var i = 1

    While (I < = 15)

    do

    If ((FS270Pt (i) > = 28.5) and (FS270Pt (i) < = 38))

    then FS270Pt (i).font.color.value = "0,0,0".

    else FS270Pt (i).font.color.value = "255,0,0".

    endif

    i = i + 1

    endwhile

    When I run the 'Script Check syntax' I don't get any errors.  However, when running, she says that FS270Pt is unknown.  How can I loop through the fields binding name?

    It will throw the error. Because the instances of the field to which you refer is not correct. You need to loop through the instances of the field. The domain name is FS270Pt1. So it's instances and be FS270Pt1 [0], FS270Pt1 [1] FS270Pt1 [2]... etc.

    Therefore, replace the code inyour

    FS270Pt (i) with FS270Pt1 ["+ i +" "]. It should work.

    Thank you

    Sidonie.

  • Fill Winding rule null is used for all pixels on the screen?

    Hello

    I wanted to know this questions so I can better understand the operation in general programs Illustrator and vector. Trying to understand how the pathfinder, I learned later the winding fill rule non-zero.

    I think I understand that it is used to determine what parts of an object is filled when his path crosses itself or what other objects cross with her. Whenever the number of winding is not 0, it means that he went through something, that makes the number 1 coil. If it crosses this line again in the opposite direction, the winding number gets subtracted once again, so you have 0 again. Fill if the number is different from 0.

    But, my question is this. This made only of pixels IN a form, to determine if there is a hole inside... or if it actually makes for every single pixel in your file, whenever you open a file, for each pixel on the screen, it uses the rule fill winding non-zero?

    For example, if you make a small circle in the middle of your screen, is each pixel on the screen tested with the winding fill rule nonzero in order to determine whether a pixel is part of the circle?

    Thank you.

    I found it it seems.

    If anoyne wants to know

    -Vector programs determines how many pixels on the screen

    -It creates shapes with a formula, circle, square, Bézier formulas

    for simple objects without intersection he uses limit fills, he chooses a pixel of seeds within the object

    It checks the 4 or 8 next to it

    She fills until it finds an edge

    no simple forms, it checks each pixel on the screen with a number of winding

  • Determine the space used for each row in the table

    I am trying to determine how much disk space each row in the table will take place (data and indexes). I use sys_guids for my (PK_ID) primary key and foreign key columns (FK_xx), so who are on varchar2 (32).

    What is the best way to determine this?


    CREATE TABLE STU_ENROLLMENT
    (PK_ID VARCHAR2 (32), sys_guid() by default)
    CONSTRAINT pk_stu_enrollment
    KEY ELEMENTARY SCHOOL
    With the HELP of INDEX TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0),.
    FK_STU_SCHOOL VARCHAR2 (32)
    FK_SCHOOL_CALENDAR VARCHAR2 (32)
    FK_PCC_CODE VARCHAR2 (32),
    FK_GRADE_LEVEL VARCHAR2 (32),
    FK_VOTECH VARCHAR2 (32),
    FK_SPECIAL_ED VARCHAR2 (32),
    FK_TUITION_CODE VARCHAR2 (32),
    FK_HOME_INSTRUCTION VARCHAR2 (32),
    FK_DISTRICT VARCHAR2 (32),
    FK_PROGRAM_CODE VARCHAR2 (32),
    FK_SERVING_SCHL VARCHAR2 (32),
    FK_RESPONSIBLE_SCHL VARCHAR2 (32),
    FK_ADA_CODE VARCHAR2 (32),
    FK_ENROLL_TYPE VARCHAR2 (32),
    FK_PCC_REASON VARCHAR2 (32),
    STANDARD_DAY NUMBER (3).
    PCC_NOTES VARCHAR2 (1000).
    USER_FLD1 VARCHAR2 (100),
    USER_FLD2 VARCHAR2 (100),
    USER_FLD3 VARCHAR2 (100),
    USER_FLD4 VARCHAR2 (100),
    USER_FLD5 VARCHAR2 (100),
    PCC_TRANSACTION_ID VARCHAR2 (32),
    TRANSACTION_NUMBER DEFAULT NUMBER '1',
    TRANSACTION_TYPE VARCHAR2 (1) DEFAULT 'A,'
    DATE OF LAST_UPDATE_DATE,
    LAST_UPDATE_USER VARCHAR2 (100))
    TABLESPACE sis_express_base
    STORAGE (5120 INITIAL
    NEXT 5120
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I ON STU_ENROLLMENT (FK_STU_SCHOOL, FK_SCHOOL_CALENDAR, FK_PCC_CODE) SINGLE
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I2 ON STU_ENROLLMENT (FK_SCHOOL_CALENDAR)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I3 ON STU_ENROLLMENT (FK_PCC_CODE)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I4 ON STU_ENROLLMENT (FK_GRADE_LEVEL)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I5 ON STU_ENROLLMENT (FK_VOTECH)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I6 ON STU_ENROLLMENT (FK_SPECIAL_ED)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I7 ON STU_ENROLLMENT (FK_TUITION_CODE)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I8 ON STU_ENROLLMENT (FK_HOME_INSTRUCTION)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I9 ON STU_ENROLLMENT (FK_DISTRICT)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I10 ON STU_ENROLLMENT (FK_PROGRAM_CODE)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I11 ON STU_ENROLLMENT (FK_SERVING_SCHL)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I12 ON STU_ENROLLMENT (FK_RESPONSIBLE_SCHL)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I13 ON STU_ENROLLMENT (FK_ADA_CODE)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I14 ON STU_ENROLLMENT (FK_ENROLL_TYPE)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I15 ON STU_ENROLLMENT (FK_PCC_REASON)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I16 ON STU_ENROLLMENT (PCC_TRANSACTION_ID)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    CREATE INDEX STU_ENROLLMENT_I17 ON STU_ENROLLMENT (FK_STU_SCHOOL, PCC_TRANSACTION_ID, PK_ID)
    TABLESPACE sis_express_index
    STORAGE (4096 INITIAL
    NEXT 4096
    PCTINCREASE 0);

    Hello

    The maximum size of the row in the table

    Select table_name, ROUND (sum (data_length) / 1024,2) SIZE_IN_KB
    of user_tab_cols
    where table_name = 'STU_ENROLLMENT '.
    TABLE_NAME GROUP;

    +

    Select index_name table_name, ROUND (sum (CHAR_LENGTH) / 1024,2) SIZE_IN_KB
    of USER_IND_COLUMNS
    where table_name = 'STU_ENROLLMENT '.
    GROUP BY index_name table_name;

    See the size of the table - method with the average row size

    Concerning
    Hitgon

    Published by: hitgon on May 2, 2012 18:19

    Published by: hitgon on May 2, 2012 18:39

  • Zero error of iteration - the treatment of dynamic sql statements in dbms_xmlgen

    Hello

    I have a procedure that creates a dynamic sql v_sql

    cursor v_curr is
    Select *.
    of btctl_msg_log;

    BEGIN
    Select count (*) in the v_cnt of btctl_msg_log;

    IF v_cnt > 0 THEN
    C1 in v_curr
    LOOP
    v_sql: = "' | ' SELECT * from '. C1.msg_rcrd_src_tbl_nm | |' where rowid = ' | " ' ||'' ' || C1.msg_rcrd_src_tbl_id | " ' ||'' ' ||'' ' ;
    Select DBMS_XMLGEN.getXMLtype (v_sql) in the double v_xml;

    gives me an error

    ORA-19202: an error has occurred in the processing of XML
    ORA-24333: zero number of iterations
    ORA-06512: at "SYS." DBMS_XMLGEN", line 288
    ORA-06512: at line 1

    I don't know why is this error happening.
    Any help much appreciated.

    881575 wrote:
    Hello

    I have a procedure that creates a dynamic sql v_sql

    cursor v_curr is
    Select *.
    of btctl_msg_log;

    BEGIN
    Select count (*) in the v_cnt of btctl_msg_log;

    IF v_cnt > 0 THEN
    C1 in v_curr
    LOOP
    v_sql: = "' | ' SELECT * from '. C1.msg_rcrd_src_tbl_nm | |' where rowid = ' | " ' ||'' ' || C1.msg_rcrd_src_tbl_id | " ' ||'' ' ||'' ' ;
    Select DBMS_XMLGEN.getXMLtype (v_sql) in the double v_xml;

    gives me an error

    ORA-19202: an error has occurred in the processing of XML
    ORA-24333: zero number of iterations
    ORA-06512: at "SYS." DBMS_XMLGEN", line 288
    ORA-06512: at line 1

    I don't know why is this error happening.
    Any help much appreciated.

    Standard when boards (ab) use of EXECUTE IMMEDIATE is to compose the SQL statement in a single VARCHAR2 variable
    Then print the variable before passing to EXECUTE IMMEDIATE.
    COPY the statement & PASTE in sqlplus to validate its correctness.

  • Computer HP laptop slim 500 GB HARD drive: used for HP laptop HARD drive upgraded to Win 10 Pro with key now stuck after HP Drive Encryption Login

    I bought a portable hard drive used HP for the upgrade of my Lenovo G550 with ugraded CPU with Intel's CORE DUO T9300 2.50 ghz

    (HP hard drive: computer laptop slim drive HARD 500 GB SERIAL ATA DISK DRIVE S/N W627S9NL P/N 756731-001 MFG Seagate Technologies DOM 8 / 2015)

    I was happy to see that the hatd drive had already installed because Windows 7 I had bought already separate legitimate Windows 10 Pro license key for the upgrade. I was able to go online and download the upgrade of Windows 10 and used my purchased license key to activate my updated.

    While doing the installation, there are some HP software that was still on the hard drive. I thought it would be good to have some additional security protocols, so I also installed the WinMagic Securedoc Bootloader v1.2.12 and saved the drive encryption HP with the security issues and password for secondary access.

    10 Windows has been activated and everything was beautiful. But when I restarted the laptop, I put my password for windows and then it goes to this screen of disc HP encryption rises. I put the password and it is accepted - and then the screen turns white... not offshore... jblank TEU with a cursor flashing that doesbn can't react to inputs.

    I tried leaving it for a day or so and still nothing.  There is nothing I can change in the configuration of the BIOS that works so far.

    I also tried Reimage download on USB and re-creation of the sequence of boot, but not good. Even tried a boot drive, but nothing there either. I'll try again.

    I don't know where to go or how to get beyond the screen of HP encryption.  I am pretty good at following directions, I don't know coding, but may do what you suggest to help me fix this problem.

    Can you help me?

    Sorry... I missed the part that you have a license Win10.  I thought you were trying to activate 10 using the OEM HP license and causing problems.

    I do not use HP encryption applications - as having recently completed a career in the InfoSec, I personally focus together on the encryption of the PC to be laughable-, but my guess is that you are basically out of luck.

    If it was my drive, I WIPE the drive of all its content and then again install Win10.  A good product to do i.e. DBan: http://tiptopsecurity.com/how-to-securely-wipe-your-hard-drive-with-dban-erase-your-data-for-good/

    Once your disc is clean, then simply install Win10 on it.

    That said, with a bit of luck, one of the HP EXPERTS will probably come along and tell you how to get around their encryption.

    Good luck

  • Using a Bind Variable in the FROM of a SQL statement part?

    Hi all

    I have a problem, I am trying to execute a SQL statement. However, I need the FROM part of the SQL statement in a variable binding. This is because the end user will have to choose between 2 views of database.

    I tried this:
    Select CON_ID from: P23_DB_NAME where CON_LEGACY_ID =: P23_CONLEG_NO

    I had no chance. The error I got was,
    '+ The query cannot be parsed in the generator. If you believe that your request is
    syntactically correct, choose the generic "columns" box below the
    the source of the region without analysis.
    "ORA-00903: invalid table name +".
    What makes sence, but now I'm a little stuck.

    Does anyone have ideas for a workaround?

    Thanks in advance.
    -N.S.N.O.

    The example I gave you is quite simple. You must take some time to study it to see where you need to be very careful what put you where. Now, of course your example does not work becaues you have several errors. It will work for you:

    DECLARE
       x   VARCHAR2 (4000);
    BEGIN
       x := x || 'SELECT CON_ID FROM ';
       x := x || :p23_db_name;
       x := x || ' WHERE CON_LEGACY_ID = ' || :p23_conleg_no;
       RETURN (x);
    END;
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • Installation of the SP3 for XP now crush the latest system updates or interfere with programs like IE 8?

    In all other ways my XP system is up-to-date, with the exception of SP3. I never needed before. SP1 and SP2 have been installed at the time when they were new. Now SP3 is required to upgrade to some new programs. Installation of the SP3 at this late date crush the latest system updates or interfere with programs like IE 8? I don't want that my system is back to older parameters which are now outdated. If the system settings are changed, how do I know those who?

    No, this does not disturb.

  • Insert the output of a refcursor procedure into a table

    Hello

    I met a scenario in which I need to put the insert records returned by a procedure using refcursor, at a table.

    I followed the instructions in PL/SQL 101: understanding Refcursor (PL/SQL 101: understanding Ref Cursor am unfortunately still not able to do so.)

    Here is my sample codes. (Copied here as advised by the new Member)
    create or replace PROCEDURE TEST_PROCEDURE1 ( p_cursor OUT SYS_REFCURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT C1,C2
    FROM TEST_USER.test_table4procedure;
    END;
    I check the result using the following statement, which gives results.
    variable rc refcursor;
    exec TEST_USER.TEST_PROCEDURE1 (:rc)
    print rc;
    Now, I want to be able to use the output and insert the data into a table. That's how I came across this thread.

    I created the types and function...
    create or replace type test_user.type_table1 as object(var1 varchar2(50),var2 varchar2(50));
    create or replace type test_user.type_table2 as table of test_user.type_table1;
    
    create or replace function test_user.test_function1 (rc in sys_refcursor )
    return test_user.type_table2 is
    v_emptype test_user.type_table2 := test_user.type_table2(); -- Declare a local table structure and initialize it
    v_cnt number := 0;
    v_rc sys_refcursor;
    v_var1 varchar2(20);
    v_var2 varchar2(20);
    begin
    v_rc := rc;
    loop
    fetch v_rc into v_var1, v_var2;
    exit when v_rc%NOTFOUND;
    v_emptype.extend;
    v_cnt := v_cnt + 1;
    v_emptype(v_cnt) := test_user.type_table1(v_var1, v_var2);
    end loop;
    close v_rc;
    return v_emptype;
    end;
    After that, I want to be able to view the records by using the function... so I used the instructions below...
    variable rc refcursor;
    exec TEST_USER.TEST_PROCEDURE1 (:rc)
    SELECT * FROM TABLE(test_user.test_function1(:rc));   
    However, it fails with the error

    Error from line 3 in order:
    SELECT * FROM TABLE (test_user.test_function1 (:rc))
    Error report:
    SQL error: Missing a setting IN or OUT to index: 1

    Help, please...

    Your code does not work for a simple reason. SYS_REFCURSOR parameters must be in IN OUT mode. Check if the RC is open when he switched mode:

    create or replace type type_table1 as object(var1 varchar2(50),var2 varchar2(50))
    /
    create or replace type type_table2 as table of type_table1
    /
    create or replace PROCEDURE TEST_PROCEDURE1 (p_cursor IN OUT SYS_REFCURSOR)
    AS
    BEGIN
    OPEN p_cursor FOR
    SELECT ENAME,JOB FROM EMP;
    END;
    /
    create or replace function test_function1 (rc in sys_refcursor )
    return type_table2 is
    v_emptype type_table2 := type_table2(); -- Declare a local table structure and initialize it
    v_cnt number := 0;
    v_var1 varchar2(20);
    v_var2 varchar2(20);
    begin
    if rc%isopen
      then
        dbms_output.put_line('rc is open');
      else
        dbms_output.put_line('rc is not open');
     end if;
    loop
    fetch rc into v_var1, v_var2;
    exit when rc%NOTFOUND;
    v_emptype.extend;
    v_cnt := v_cnt + 1;
    v_emptype(v_cnt) := type_table1(v_var1, v_var2);
    end loop;
    close rc;
    return v_emptype;
    end;
    /
    variable rc refcursor
    exec TEST_PROCEDURE1(:rc)
    set serveroutput on
    SELECT * FROM TABLE(test_function1(:rc))
    /
    SELECT * FROM TABLE(test_function1(:rc))
                        *
    ERROR at line 1:
    ORA-01001: invalid cursor
    ORA-06512: at "SCOTT.TEST_FUNCTION1", line 15
    
    rc is not open
    SQL> 
    

    Now IN OUT parameter edit mode:

    set serveroutput off
    create or replace function test_function1 (rc in out sys_refcursor )
    return type_table2 is
    v_emptype type_table2 := type_table2(); -- Declare a local table structure and initialize it
    v_cnt number := 0;
    v_var1 varchar2(20);
    v_var2 varchar2(20);
    begin
    if rc%isopen
      then
        dbms_output.put_line('rc is open');
      else
        dbms_output.put_line('rc is not open');
     end if;
    loop
    fetch rc into v_var1, v_var2;
    exit when rc%NOTFOUND;
    v_emptype.extend;
    v_cnt := v_cnt + 1;
    v_emptype(v_cnt) := type_table1(v_var1, v_var2);
    end loop;
    close rc;
    return v_emptype;
    end;
    /
    variable rc refcursor
    exec TEST_PROCEDURE1(:rc)
    set serveroutput on
    declare
    v_emptype type_table2 := type_table2();
    begin
    v_emptype := test_function1(:rc);
    end;
    /
    rc is open
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    Problem is that you can't call the procedure/function with parameters in/out OUT of SQL.

    SY.

  • Is it possible to implement the sequences to browse to project with several tables of contents and conditionalized modules

    I use RoboHelp 9 with WebHelp output.

    I have five outings, which one contains help for common functions, while the other four contain help for modules under license. When a user opens a module under license assistance, the user sees the soul help and authorized assistance. In addition, the files are conditionalized so that the unauthorized search a help licensed module brings nothing.

    I have been solving problems with the previous topic and the next topic which, thanks William, I learned are associated with browse sequences. After having tried various configurations, I have a few questions:

    • HR support a sequence to travel alone in a project, even when the project has several outputs & fakes?
    • If HR supports a sequence to browse only, does that mean that there is no way to create a unique navigation for each separate output sequence?
    • If HR supports several sequences of travel, which is the workflow?

    I also maintain a table of 'master' contents which contains all the modules, frequent and without a license. What I've done for now is to autocreate a browse sequence based on the table of contents "master." When I generate the output of a module under license, which is conditionalized, I only see the table of contents for this module and, therefore, can only travel between books and subbooks for this add-on. I also checked that the subjects that do not appear in the module conditionalized as for another module licensed, do not appear in the list of search results either.

    Carol

    Me again, Carol

    You also questions about the functional differences between WebHelp and WebHelp Pro, so let me explain.

    I know only two major differences other than (the additional benefits of analytical feedback reports) and the management of 'Zones' with authentication in RoboHelp Server.

    1. The behavior of browse sequences as explained above
    2. The fact that the categories of content are not supported in WebHelp Pro for this latest version 9.

    In regards to sequences to browse you try to anticipate the various modules (licensed, etc.): multiple browse sequences are included in an single . File BRS. Sequences are defined in the XML code in the single file.

    As a solution (for WebHelp and WebHelp Pro), you could create a Help.brs of the NPM. that you have already created a module; then backup and archive. Then create a change for the different module before generating again. The Help.brs of the NPM. will need to have the same name as your project, so you will have to manage the .brs desired file in the project folder when you build this version. All your other choices (table of contents, Index, conditional tags, etc) remains the same for the respective modules.

    Finally, I notice that you generate apparently WebHelp Pro right now even if you are not published on the server of HR? This is really not the best practice. You must generate WebHelp plain for a web server that has no HR server on it (even if you can be getting away with it). Regarding your concern about "breaking" something; each output is placed in another! SSL! folder automatically when you build, so you should be able to generate WebHelp without interfering with the release of WebHelp Pro. Then, you can republish on the HR using WebHelp Pro Server, whenever the server is ready.

    John Daigle

    Adobe Certified RoboHelp and Captivate instructor

    Evergreen, Colorado

    www.showmethedemo.com

  • Call the PL/SQL procedure with different parameters?

    I use PL/SQL for web development. I have a page of PL/SQL which collects information and returns the user off site with one return url (another PL/SQL procedure).

    I have the return procedure with every documented return variable (default null) in order to always take the return. However, there are (reported... cannot reproduce because of the nature of the business) cases where a 404 error is returned because of the incompatibility of parameter.

    Is it possible to proceed regardless of the parameters? Someone at - it suggestions?

    Thank you!

    user2960509 wrote:

    My problem is that they sometimes send back of settings that do not match what I expect.

    Use the interface "+ flexible +" mod_plsql - see the Oracle® HTTP Server mod_plsql user's Guide for the documented details.

    The signature of the procedure parameter is as follows (it is called by mod_plsql using tables of name value pairs):

    create or replace procedure Scott.MyWebProc( name_array owa.vc_arr, value_array owa.vc_arr) is
    ...
    

    In your code, you just browse the berries to get the name values passed query string. You can even filled an associative array in your code (a table indexed by string and no number, where the index string represents the name of param)-this approach can make it pretty easy for the code make reference to a parameter, with little effort on your part to provide an interface to query by name for code to get the value of a parameter name.

    To enable the flexible (aka parameter 2) call interface, precede the call to web with an exclamation character. For example

    http://my-webserbver.my-domain.com/pls/dad/!scott.mywebproc?name-1=val-1&name-2=val-2..,name-n=val=n
    

Maybe you are looking for

  • Mac and Action Delete mail rules

    I use Mail 9.3 with El Capitan 10.11.6 and by mistake, I created an automatic e-mail rule that removed all email in my Inbox. This was due to accidentally clicking on the "If the following RULES are respected", instead of ALL. I got the error after a

  • Compatibility GPS NB200-122 win 7

    Hi all I've upgraded from Windows XP Home edition to Win 7 and am very satisfied. I had a problem with the connection manager. Paupau has solved it for me. I thought that I had all the compatibility issues resolved. I noticed today that I have a smal

  • Why are there no update in September for Malicious Software Removal Tool?

    Why are there no update in September for Malicious Software Removal Tool?

  • Read the time on WRT54GL

    How do I know what time it is on my WRT54G router? I don't see anywhere that this indication is displayed. The reason is I want to configure the router to block certain traffic at different times of the day

  • Cannot upgrade to Windows 10 invitation MSFT

    * Original title: update windows 10 running Windows 7pro... try to upgrade to windows 10 of msft free invitation... does not seem to download completely... When I try to "update", nothing