Get the error when switching from table


Hi all

I'm moving my procedure table values but no luck. your help in this regard will be highly appreciated. Thanks in advance.

I created the following procedure:

-------------

CREATE OR REPLACE PROCEDURE send_coll

IS

TYPE c_dept_no IS TABLE OF THE dept.deptno%TYPE;

v_dept_no c_dept_no: = c_dept_no();

BEGIN

SELECT DeptNo

TO COLLECT FEES IN BULK

IN v_dept_no

EMP;

END;

------------------------

Now, I want to spend all the values of v_dept_no to one of my name of the procedure as rec_coll that receives the value of v_dept_no and print the value against v_dept_no. for example:

When v_dept_no = 10 then print all empno against deptno 10 and so on...

I think I have to do something like below but no luck so far.

CREATE OR REPLACE PROCEDURE send_coll

IS

TYPE c_dept_no IS TABLE OF THE dept.deptno%TYPE;

v_dept_no c_dept_no: = c_dept_no();

BEGIN

SELECT DeptNo

TO COLLECT FEES IN BULK

IN v_dept_no

EMP;

I'm looping 1.v_dept_no

rec_coll (v_dept_no (i)); - call the rec_coll procedure and pass in the value

end loop;

end;

---------------

create another procedure that will receive the value for v_dept_no

------------

CREATE OR REPLACE PROCEDURE rec_coll (v_emp_no c_dept_no) - create collection with c_dept_no type

IS

BEGIN

I'm looping 1.v_emp_no.count

dbms_output.put_line (v_emp_no (i));

END loop;

END;

-----------

I get the error message to create these procedures and if someone help me so I really appreciate it. Thank you

Concerning

Shu

I would just write a single SELECT statement joining EMP and Dept. If this exercise is University (collections of learning PL/SQL types), then you can do something like that.

I used a PACKET to this implementation. Again, this is not how things are done in the real world.

SQL > create or replace package coll_pkg
2 as
3 type dept_no_tbl is table of the dept.deptno%type;
4
5 procedure rec_coll (p_dept_no in dept_no_tbl);
6 procedure send_coll;
7 end;
8.

Package created.

SQL > show err
No errors.

SQL > create or replace package body coll_pkg
2 as
3 procedure rec_coll (p_dept_no in dept_no_tbl)
4 is
5. start
6 because me in 1.p_dept_no.count
7 loop
8 d in)
9 select empno, ename
10 of PEM
11 where deptno = p_dept_no (i)
12                 )
loop 13
14 dbms_output.put_line (p_dept_no (i) |) ':' || j.EmpNo | ':' || j.ename);
15 end loop;
16 end loop;
end 17;
18
procedure send_coll 19
20 is
21 l_dept_no dept_no_tbl: = dept_no_tbl();
start at 22
23 deptno select bulk collect into l_dept_no
24 of the Department;
25
26 rec_coll (l_dept_no);
27 end;
28 end;
29.

Package body created.

SQL > show err
No errors.

SQL > set serveroutput on
SQL > exec coll_pkg.send_coll
10:7782:CLARK
10:7839:KING
20:7369:SMITH
20:7566:JONES
20:7788:SCOTT
20:7876:ADAMS
30:7499:ALLEN
30:7521:WARD
30:7654:MARTIN
30:7698:BLAKE
30:7844:TURNER

PL/SQL procedure successfully completed.

SQL >

Tags: Database

Similar Questions

  • Get the error when using the UTL_SMTP function in Oracle 11 g

    Hello

    I get the error when executing a trigger e-mail code in oracle 11 g:

    I have following trigger on the temporary table:

    CREATE OR REPLACE TRIGGER temp_temp_message AFTER

    INSERT OR UPDATE ON temp_message FOR EACH LINE

    declare

    Conn UTL_SMTP . CONNECTION ;

    msg VARCHAR2 (2000);

    Start

    Conn := UTL_SMTP . open_connection ( host => '10.250.1.149', port=>25 );

    UTL_SMTP . HELO ( conn, '10.250.1.149');

    UTL_SMTP . mail ( conn, '[email protected]');

    UTL_SMTP . RCPT () conn ' [email protected]');

    msg := "Hello, this is test mail." ;

    UTL_SMTP .data( conn, msg);

    UTL_SMTP . quit smoking ( conn );

    exception when others then

    dbms_output.put_line (sqlerrm);

    raise_application_error (-20000,

    "Failed to send because of the following error messages: ' " || sqlerrm);

    end;

    Insert in temp_message values ()1

    );

    When I insert the record in the table there are given the following error.

    ORA-20000: failed to send messages because of the following error: ORA-24247: access denied by access control (ACL) of network list

    ORA-06512: at the 'APPS '. TEMP_TEMP_MESSAGE', line 14

    ORA-04088: error during execution of trigger ' APPS. TEMP_TEMP_MESSAGE'

    But if I run the next plsql through sqlplus send mail successfully:

    declare

    Conn UTL_SMTP . CONNECTION ;

    MSG VARCHAR2 (2000);

    Start

    Conn := UTL_SMTP . open_connection ( host => '10.250.1.149', port=>25 );

    UTL_SMTP . HELO ( conn, '10.250.1.149');

    UTL_SMTP . mail ( conn, '[email protected]');

    UTL_SMTP . RCPT () conn ' [email protected]');

    msg := "Hello, this is test mail." ;

    UTL_SMTP .data( conn, msg);

    UTL_SMTP . quit smoking ( conn );

    exception when others then

    dbms_output.put_line (sqlerrm);

    raise_application_error (-20000,

    "Failed to send because of the following error messages: ' " || sqlerrm);

    end;

    Thanks in advance.

    Yoann

    To resolve ORA-24247 you must:

    (1) create an acl (if it is not already created)

    (2) add the user privileges using the resources of the network

    (3) to use the ACL to a specific address

    This might be useful

    How to fix an ORA-24247: access denied by access control (ACL) of network list | DB tips

  • Get the error when you try to manually create a restore point in Vista 32 - Bit - System - Protection of the system control panel. Got the unable to create the specified task

    Get the error when you try to manually create a restore point in Vista 32 - Bit - System - Protection of the system control panel.
    Got the unable to create the specified task

    Hello

    What is the exact error message received when the problem occurs?

    Methood 1:

    Auditor of file system (CFS) scan to fix all of the corrupted system files. To do this, follow the steps in the following link:

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7

    http://support.Microsoft.com/kb/929833 

    Method 2:

    You can start Windows Vista by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    I suggest to put the computer in a clean boot state, and check if the problem persists, see the link:
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135
    Note: See step 7; Reset the computer to start as usual after troubleshooting is performed.

    Method 3:

    You can temporarily disable the security software and check if the problem occurs. Check out the following link to do the same thing:

    http://Windows.Microsoft.com/en-GB/Windows-Vista/disable-antivirus-software

    Warning: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    I hope this helps! Let us know if you need more assistance.

  • Get the error when update: Office creative cloud could not be updated. (error code: 2)

    Get the error when update: Office creative cloud could not be updated. (error code: 2).

    I'm on a McBook Pro, OSX 10.9.5 retina.

    How to fix error Code: 2?

    Always the same?

    Follow the procedure below:

    Please follow the steps below:

    1)

    Click on the Finder and search options listed next to icon located Apple in the upper left of the screen and click on the "Go" menu button and select 'utilities '.

    (Applications > Utiliites)

    Look for a CC Adobe and Adobe Application Manager folder under utility window and trash both folders.

    2)

    Click on the link below and download & run the cleaning of Adobe tool:

    Select the option "Adobe Application Manager for Mac OS X 10.6" and then click on "Clean up selected."

    https://helpx.Adobe.com/content/help/en/Creative-Suite/KB/CS5-cleaner-tool-installation-PR oblems/_jcr_content/hand-Sea/accordion_container_1/accordion-nominal/accordion-point-1/agreement I on-item-par/procedure/proc_par/step_3/step_par/download/file.res/AdobeCreativeCloudCleane r Tool.zip

    3) click on the link below and download file Creative Cloud install and use the same to install the creative Cloud Desktop application.

    https://creative.Adobe.com/products/creative-cloud

  • get the error when apex.war is deployed on several managed server

    Hi all

    I sent apex.war on several managed server on server 11g webloigc

    his work on a single server managed not on others and I m having 3 servers managed as it

    http://ipaddress:7003

    http://ipaddress:7004

    http://ipaddress:7005

    and I m having infront of weblogic server that the server apache web http://IPAddress:80 / app_name

    I m getting this error when I'm trying to access the application of apex

    The environment can be locked to a single Editor access. ENV_LOCKED: The je.lck file could not be locked. Environment is not valid and must be closed.


    Please guide me how to configure it on several WLS managed server with the server web apache.


    Thanks and greetings

    Shadab akram khan

    solved by myself

  • get the error when starting weblogic server in jdeveloper

    get an error when you start weblogic server in jdeveloper

    The NEWSPAPER (its sequel shows):

    < 25 July 2013 19:19:15 IST > < opinion > < WebLogicServer > < BEA-000331 > < started WebLogic Admin Server "DefaultServer" domain "DefaultDomain" running in development Mode >

    < 25 July 2013 19:19:15 IST > < opinion > < WebLogicServer > < BEA-000365 > < Server State has changed in the RACE >

    < 25 July 2013 19:19:15 IST > < opinion > < WebLogicServer > < BEA-000360 > < server started operation >

    The user ' directors [weblogic, directors] =' the role of the administration. All jobs by administrators must go through an Administration Port.

    Authentication failure connecting to the IntegratedWebLogicServer application server. Please check the settings.

    Cannot complete the commissioning of the IntegratedWebLogicServer application server.

    [IntegratedWebLogicServer Instance server stops.  All running applications will be terminated and canceled.]

    [End of forcing of IntegratedWebLogicServer]

    Taskkill /F/PID 1620

    Process is complete.

    PLs help me

    User, please tell us your jdev version!

    Somehow your credentials are corrupted. Two possible solution:

    (1) open your folder, system11.1.1.xxxx open the DefaultDomain\servers\DefaultServer\security folder and edit the boot.properties file. Delete the part '(AES)... ". «"after the username and password and write the new example of username = weblogic", password = "Welcome1" Save the file and try to restart the integrated server. Once the server starts the entries are encoded again.

    (2) If 1) doesn't work, remove all of the DefaultDomain file and create a new instance of WLS in jdev.

    Timo

  • Get the error when saving files, afterSave '_afterSave.htm' is not defined

    Recently I updated my Windows Pro 8.1 for Windows 10 operating system, and then I started to work, using Dreamweaver, but all save, example CRL + S I get the error above, anyone else who has this problem and managed?

    Have a look here http://www.dmxzone.com/forum/topic/32899/

  • Get the error when you attempt to cancel the shipment of Release 11i


    Hi all

    I get the error while I am trying to cancel the amount open against relase expedition with multiple (4) below the distribution lines.

    Send # 2 # 3 quantity invoiced greater than the quantity shipped 2205 88181 Distribution

    Scenario-

    For shipment of release # 2 -

    Quantity ordered - 8820

    Due Qty-2

    Received Qty - 8818

    Qty. to beak - 8818

    Press release # 2 is to have 4 lines of distributions. Against distribution, line 1, 2 and 3 of the delivered quantity is 2205 while distribution on line 4, deilvered qty is 2203.

    But the quantity invoiced is 8818, only line 3 distibution and against the other lineages invoiced quantity is 0.

    Please let me know what to do now in order to cancel (the relase open expedition 2) amount in this case.

    Good reply as soon as POSSIBLE.

    Hi all

    It is not possible ancel relase shipping open quantity (2) in this case in the support environment.

    It is better for finally closed the expeditions of this release.

    But it is worth noting that finally close or cancel actions are intended to prevent additional changes to the purchase order. This includes invoice or receipt.

    This cannot be undone.

    Kind regards

    Piyush

  • Get the error when running rcu.bat

    Hi all

    After a successful installation on ODI 12 c.

    I am trying to run the rcu.bat but I get the error below.

    "Cannot find the javaw.exe.

    just me to get rid of this error.

    Thanks in advance

    Kind regards

    Fabien Manirao

    HI Vivek,

    JAVA_HOME is a regular path whenever we install JDK in our machine and if it does not support other tools.

    ODI_JAVA_HOME we define as the JDK path even as ODI motor needed Java and backgrond processes for studio ODI

    Kind regards

    Phanikanth

  • Get the error when the wsdl

    Hello

    I installed WCC 11.1.1.6. I downloaded the WSDL content WebCenter for CheckIn. While hitting the WSDL by SOAPUi, I get the error "the request requires user authentication. It MUST contain a header field WWW-Authenticate (section 14.46) containing a fault that is applicable to the requested resource. The client MAY repeat the request with a suitable authorization (section 14.8) header field. If the application already includes identification of the authorization information, then the 401 response indicates that authorization was refused for those credentials. If the 401 response contains the same challenge as the previous answer, and that user agent has already attempted at least once authentication, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include diagnostic information relevant. HTTP access authentication is explained in article 11 ".

    Any help is appreciated.

    Thank you.

    Hello

    Open SOAP UI - projects - - name of WSDL - demand.

    Highlight and select request - down left - ask properties see - here, username / password will be displayed.

    I hope this helps.

    Thank you
    Srinath

  • Get the error when loading data into the base cube

    Hi all

    I get the error by loading the file of hollow data to the database below.
    Please take suggest me...

    I use ESSBASE 9.3.1.3.


    Error:

    Basic charge database
    The Xchgrate database management
    Load the database Interntl
    Sample application loaded - connection established
    Start the application [example] with the process id [1688]
    Empty invalid character in name (E:\My personal Data\Test\222.txt) based on the ESSAPI EssUpdateFile
    Unexpected error Essbase 1030010

    Empty invalid character in name (E:\My personal Data\Test\222.txt) based on the ESSAPI EssUpdateFile

    Essbase has problems with spaces (white space characters) the path names (my personal data)

    Rename your path or move the data file to a location that has no characters/spaces in the path name.

  • Get the error when exporting

    Hello friends,

    Please help me...

    When I export data or selecting data by selection for a particular table statement then I get below error...

    Wed Jan 11 04:42:43 2013

    Thread 1 Advanced to record the sequence 924 (switch LGWR)

    Currently Journal # 3 seq # 924 mem # 0: E:\ORACLE\PRODUCT\10.2.0\ORADATA\10G\REDO03. JOURNAL

    Wed Jan 11 22:00:12 2013

    Met GATHER_STATS_JOB of errors.  Check the trace file.

    Wed Jan 11 22:00:12 2013

    Errors in the e:\oracle\product\10.2.0\admin\10g\bdump\10g_j000_8952.trc file:

    ORA-01115: reading block IO file error 1 (block # 62905)

    ORA-01110: data file 1: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\10G\SYSTEM01. DBF'

    ORA-27091: unable to queue I/O

    ORA-27070: async read/write failed

    OSD-04006: ReadFile() failure, unable to read the file

    S/O-error: incorrect function (OS 1).

    My version of DB: - Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    Thank you

    Hello

    First of all I would like to know have many blocks are corrupt - you can do this with rman (even if you do not use for rman backups).

    Just run

    RMAN target = /.

    This will connect you to the database (make sure that you are logged in as a user who is in the dba/ORA_DBA group)

    validate the database logical verification;

    This will check the whole database to see how many defective blocks you.

    Then report...

    See you soon,.

    Harry

  • get the error when you use the TRIM method in the collections

    Hi Experts,

    When you use the TRIM method I get below error. I make any mistake here?

    DB: Oracle 11g

    SQL > declare

    2

    emp_tab of type 3 is the employee table % rowtype index directory.

    4 l_emp_tab emp_tab;
    5

    6 start

    7

    8 select * bulk collect into l_emp_tab of employees;

    9 l_emp_tab.trim (5);

    10 dbms_output.put_line (l_emp_tab.count);

    11

    12 end;

    13.

    l_emp_tab. Trim (5);

    *

    ERROR on line 9:

    ORA-06550: line 9, column 2:

    PLS-00306: wrong number or types of arguments in the call to 'TRIM '.

    ORA-06550: line 9, column 2:

    PL/SQL: Statement ignored

    Thanks in advance for your help.

    See you soon,.

    Suri

    For PL/SQL collections "index by" you cannot use the TRIM function. If your collection statement excludes the portion "index of...» ", then you can.

    Gerard

  • Get the error when you try to rebuild StoreFrontModule.jpr

    Hi friends,

    New IAM came into the world of the ADF. IAM folllowing steps to create a schema of DOM from the link http://www.oracle.com/technetwork/developer-tools/jdev/index-095536.html

    The scheme was built successfully, iam now get many erros when the StoreFrontModule.jpr has been rebuilt.

    C:\FODSchema\StoreFrontModule\StoreFrontService\src\oracle\fodemo\storefront\entities\WarehouseEOImpl.Java
    Error (3,18): package oracle.jbo does not exist
    Error (4.18): package oracle.jbo does not exist
    Error (5,18): package oracle.jbo does not exist
    Error (6.25): package oracle.jbo.domain does not exist
    Error (7.25): package oracle.jbo.domain does not exist
    Error (8.25): package oracle.jbo.server does not exist
    Error (9.25): package oracle.jbo.server does not exist
    Error (10.25): package oracle.jbo.server does not exist
    Error (11.25): package oracle.jbo.server does not exist
    Error (17,38): cannot find symbol
    Error (29,20): could not find the class EntityDefImpl
    Error (38,32): could not find the class EntityDefImpl
    Error (104,12): unable to find the class Date
    Error (125,12): unable to find the class Date
    Error (143,44): cannot find class AttributeDefImpl
    Error (179,42): cannot find class AttributeDefImpl
    Error (219,12): cannot find class RowIterator
    Error (226,12): cannot find class RowIterator
    Error (234,19): unable to find the Key class
    Error (242,27): cannot find class AttributeList
    C:\FODSchema\StoreFrontModule\StoreFrontService\src\oracle\fodemo\storefront\entities\AddressEOImpl.Java
    Error (3,18): package oracle.jbo does not exist
    Error (4.18): package oracle.jbo does not exist
    Error (5,18): package oracle.jbo does not exist
    Error (6,18): package oracle.jbo does not exist
    Error (7.25): package oracle.jbo.domain does not exist
    Error (8.25): package oracle.jbo.domain does not exist
    Error (9.25): package oracle.jbo.domain does not exist
    Error (10.25): package oracle.jbo.server does not exist
    Error (11.25): package oracle.jbo.server does not exist
    Error (12.25): package oracle.jbo.server does not exist
    Error (13.25): package oracle.jbo.server does not exist
    Error (19,36): cannot find symbol
    Error (21.20): could not find the class EntityDefImpl
    Error (304.32): could not find the class EntityDefImpl
    Error (314,12): unable to find the class DBSequence
    Error (321,30): unable to find the class DBSequence
    Error (454,12): unable to find the class Date
    Error (476,12): unable to find the class Date
    Error (496,44): cannot find class AttributeDefImpl
    Error (507,29): unable to find the class TransactionEvent
    Error (515,5): cannot find the RowSet class
    Error (539,42): cannot find class AttributeDefImpl
    Error (550,12): cannot find class RowIterator
    Error (557,12): cannot find class RowIterator
    Error (564,12): cannot find class RowIterator
    Error (571,12): cannot find class RowIterator
    Error (579,12): cannot find the RowSet class
    Error (589,40): unable to find the class DBSequence
    Error (589,19): unable to find the Key class
    Error (596,12): unable to find the class EntityImpl
    Error (603,34): unable to find the class EntityImpl
    Error (612,24): cannot find class AttributeList
    C:\FODSchema\StoreFrontModule\StoreFrontService\src\oracle\fodemo\storefront\store\queries\OrdersVOImpl.Java
    Error (6,18): package oracle.jbo does not exist
    Error (7,18): package oracle.jbo does not exist
    Error (8,18): package oracle.jbo does not exist
    Error (9.18): package oracle.jbo does not exist
    Error (10,18): package oracle.jbo does not exist
    Error (11.18): package oracle.jbo does not exist
    Error (12.25): package oracle.jbo.domain does not exist
    Error (13.25): package oracle.jbo.domain does not exist
    Error (14.25): package oracle.jbo.server does not exist
    Error (20,35): cannot find symbol
    Error (57.38): could not find the local class

    This list is long... .i was a little bit upset to see so many mistakes :(

    Is someone can pls tell me where he has gone wrong?

    IAM using Jdeveloper 11.1.2.1

    Concerning
    Goutham

    You must have the role of Developer Studio in order to use the ADF.

  • get the error when the index built ora-00701

    Hi gurus

    I'm rebuilding the index of my large database around 1 800 GB. I get the following error:


    ERROR on line 1:
    ORA-00701: required object for warmstarting database cannot be changed.
    ORA-06512: at line 11 level

    BANNER
    ----------------------------------------------------------------
    Oracle Database 10 g Enterprise Edition release 10.2.0.3.0 - 64bi
    PL/SQL version 10.2.0.3.0 - Production
    CORE Production 10.2.0.3.0
    AMT for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - production
    NLSRTL Version 10.2.0.3.0 - Production


    Note: expdp runs when I m try to rebuild the index. It is problem?


    Please give me your valuable advice.


    Rwgards

    Rabi

    My advice is

    - always, really ALWAYS consult all the error messages in the online documentation

    Your question is redundant and a waste of volunteer time as the error message is explicit.

    You try to rebuild the index of dictionary tables needed at startup of the database.
    It is not possible.

    Solution: do not rebuild the index.
    Also: apologize for not "do what is necessary."
    ----------------
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • How to remove the hard drive on a Portege M400-170 password?

    Hello I read a lot of things in this forum, in the manual, I even phoned the Toshiba support and I still have no answer to my problem. During the first use of the PC, I set a hard drive password. Now, I want to remove this password.The user manual an

  • Classic blackBerry browser does not

    I have classic, the browser does not, the pages will not load. any other apps are no longer works. I restarted using the flight up down buttons and the off button. I wish it had a battery out! Help, please!

  • Passkey blackBerry Blackberry Passport Passport

    I need to enter a passkey on my passport to connect to my Bluetooth device. How to do that. I can't find a way to type a numberic password. Thank you

  • Updates for HP Pavilion p6667sc

    Hello. First of all I would like to warn you about my lack of experience with computers I have a "HP Pavilion p6667sc" ( http://support.hp.com/us-en/document/c02546430 ) and I was wondering what upgrade opportunities I have. The processor socket is a

  • How to call calendar of black berries

    Hello I am bigginer in development of black berries. I do poroject appointment. in the menu of the hat, I have a calendar option see the. When I click on this option I want to open my calendar of black berries. No one like me how? What is the code fo