00497 PLS: do not mix between row and several rows (in BULK) list

Hello

I have a requirement to send an array of data via mail,

so use execute statement after opening the connection and use the following code PLSQL, who is not running.

My code goes like this.

0            10            20           30           40            50

1 CREATE OR REPLACE PROCEDURE SEND_TABLE_DATA (FROMAD IN VARCHAR2,

2 TOAD IN VARCHAR2,

3 SUBJECT IN VARCHAR2,

4 MESSAGE IN VARCHAR2,

5 DOCID IN VARCHAR2,

6 DOCDT IN DATE,

PRODOAID 7 IN NUMBER)

8 AS

BATCHNO 9 VARCHAR2 (32767).

NUMBER OF PCSBOX 10;

NUMBER AMOUNT 11;

12 SMTPHOST VARCHAR2 (255): = ' XXX.XXX. X.XXX ";

13. A UTL_SMTP. CONNECTION;

BEGIN 14

15A: = UTL_SMTP. OPEN_CONNECTION(SMTPHOST,25);

16 UTL_SMTP. HELO (A, SMTPHOST);

17 UTL_SMTP. MAIL (A, FROMAD);

18 UTL_SMTP. RCPT (A, TOAD);

19 UTL_SMTP. OPEN_DATA (A);

20 UTL_SMTP. WRITE_DATA (ONE, CHR (13) |) CHR (13) | CHR (13));

21 UTL_SMTP. WRITE_DATA (, ' Date: ' |) TO_CHAR (SYSDATE, ' DD/MM/YYYY HH24:MI:SS'). CHR (13));

22 UTL_SMTP. WRITE_DATA (, ' from: ' |) FROMAD | CHR (13));

UTL_SMTP 23. WRITE_DATA (, ' from: ' |) TOAD | CHR (13));

24 UTL_SMTP. WRITE_DATA (, ' subject: ' |) TOPIC | CHR (13));

25 UTL_SMTP. WRITE_DATA (ONE, MESSAGE |) DOCID | "Documented on ' | DOCDT | CHR (13));

26 UTL_SMTP. WRITE_DATA (A, CHR (13) |) CHR (13) | CHR (13));

UTL_SMTP 27. WRITE_DATA (A, "it's for your information" |) CHR (13));

28 UTL_SMTP. WRITE_DATA (, ' BATCHNO ' |) ' -- '||' PCSBOX ' |' --' ||' AMOUNT '. CHR (13));

29 IMMEDIATE EXECUTION

30 ' SELECT

31 A.BATCHNO, B.PCSBOX, B.AMOUNT

32

33 SCHEMA1. TABLEX, SCHEMA2. TABLEY B

34. WHERE THE

35 A.BATCHID = B.BATCHNO AND B.PRODOAID =' | PRODOAID

36. IN BULK COLLECT INTO BATCHNO, PCSBOX, AMOUNT;

37 FOR indx IN 1.BATCHNO. COUNTY

LOOP 38

UTL_SMTP 39. WRITE_DATA (A, BATCHNO (indx) |) ' -- '|| PCSBOX (indx) |' --' || Amount (indx) | CHR (13));

40 END LOOP;

UTL_SMTP 41. WRITE_DATA (A, CHR (13) |) CHR (13) | CHR (13));

UTL_SMTP 42. CLOSE_DATA (A);

UTL_SMTP 43. QUIT (A);

44 EXCEPTION

45 THEN THAN OTHERS THEN

UTL_SMTP 46. QUIT (A);

RAISE 47;

FIN 48;

49.

SELECT * FROM USER_ERRORS

NAME TYPE SEQUENCE LINE POSITION TEXT ATTRIBUTE MESSAGE_NUMBER

SEND_TABLE_DATAPROCEDURE3371PL/SQL: Statement ignoredERROR0
SEND_TABLE_DATAPROCEDURE23724PLS-00487: Invalid reference to the variable 'BATCHNO '.ERROR487
SEND_TABLE_DATAPROCEDURE1362500497 PLS: do not mix between row and several rows (in BULK) listERROR497

Thanks in advance

Concerning

Pradeep.

> 29 IMMEDIATE EXECUTION

> 30 ' SELECT

> A.BATCHNO, B.PCSBOX, B.AMOUNT 31

> 32 OF

> 33 SCHEMA1. TABLEX, SCHEMA2. TABLEY B

> WHERE 34

> A.BATCHID = 35 B.BATCHNO AND B.PRODOAID =' | PRODOAID

> 36 BULK COLLECT INTO BATCHNO, PCSBOX, AMOUNT;

BATCHNO PCSBOX and AMOUNT variables are defined as scalar variables. Check the definition here

> 9 BATCHNO VARCHAR2 (32767).

NUMBER OF PCSBOX > 10;

> 11 AMOUNT NUMBER;

You cannot use COLLECT LOOSE on scalar variables. The variables must be defined as a TYPE of COLLECTION to make in bulk to collect.

Tags: Database

Similar Questions

  • How to lock my iPhone 6's screen so it does not move between portrait and landscape?

    How to lock my iPhone 6's screen so it does not move between portrait and landscape?

    Select portrait orientation lock.

    Swipe the top of your home screen to access the control center and select the icon with a lock and an arc around him.

  • It does not sync between iOS and windows laptop.

    I just downloaded firefox for iOS and logged into my account from firefox. I did the same thing on my windows laptop 10 and synchronized together. No story appeared. It says that I have not all devices connected to this account of Firefox to synchronize. What's wrong?

    Hello
    I understand that for the moment that history is no synchronization between a Device IOS and office. I'm happy to help you.

    First of all, what measures do you take to see this "You have not all devices connected to this account of Firefox", second, in the settings on the PC sync, is checked for synchronization history?

    For troubleshooting, first try to restart the synchronization by going to the gear icon and logout at the bottom of the menu. Erase cache cookies private then re-launch of the app and the connection.

    This aid?

  • Data store space used not maching between VMWare and 3PAR

    Hello world

    I have a strange behavior between our environment VMWare and 3PAR storage system.

    I checked each data store of our cluster and for each of them, the space used in vSphere Client does not match the size of the user 'used' their volume associated with 3PAR.  The value displayed in VMware is higher.

    For example, our data store named DS03 has space around 1 TB in VMWare.  And when I checked in the Console of 3PAR, I see that the volume created for this data store has a size of the user 'used' 722 GB.

    While doing some research, I came across this post: ability to store data about the free space is not the same thing in VMware and 3PAR

    But the problem I encounter is quiet different. It's the opposite. I do not understand why the displayed value is higher in VMWare...  We are also running vSphere Server version 5.1.0

    Any advice? Ideas?

    Thank you very much.

    It's the ASIC 3PAR inline zero detection function stripping zeros of incoming data until they land on the disc. Www.3parug.com try this happens a lot.

  • Why my file size results do not match between Photoshop and on my computer?

    I found something intriguing in CC PSD that I hope someone can explain to me.  I'm actually creating photo resizing tutorial and when I opened the picture in PSD I got these dimensions:

    info-1.jpg

    But when the picture is turned on in Windows the size indicates a completely different size:

    info-2.jpg

    I have advanced and resized the picture in PSD to 250 x 336 and reopened in PSD, it shows the size of the file to be 246K but in Windows and when clicked, it shows 130K so I don't know who is right now because they do not correspond to the top.

    If anyone has experienced this before?  Should I change something so that they match?  Please advise - thanks.

    Deaf Mike wrote:

    I'm trying to demonstrate the importance of WHY you should not upload a photo which is 19 MB size

    Yes, we can all agree on that. But note that even if the pixel dimensions are reduced to an appropriate size (800-1200 pixels or so), the file size can always be a problem because of things like the metadata.

    So for use web, you should always use the new export function or save for Web in Photoshop. These will remove the metadata and also allow you to optimize the compression level so that you can arrive at a reasonable file size, for the given pixel size.

  • Contacts and contact names do not sync between iPhone and Mac

    Hello

    I have a mini Mac running OS X El Capitan and an iPhone 6 Plus running iOS 9.2.1. I'm having issues synchronize my contacts and contact names in messages. Account of default contact on both devices is set to iCloud and I connected with the same account on both devices iCloud. Help, please!

    They synchronize be it?

    Synchronize calendars? It's test iCloud

  • Difference between DAQMX and DAQMX base. Task list empty

    Hello

    Can someone please explain the difference between NOR-DAQMX and NIDAQMX base?

    I have recently installed Labview10.0 and NOR-DAQMX base on linux opensuse 11.4 3.4.0. Everythinng works very well. The device is recognized by labview and I put my controller and chassis using nipxiconfig. The DAQ assistant function is missing and also the drop down task and channels is empty, even if I create a new task using the basic NIDAQMX configuration utility.

    Can you get it someone please let me know where I'm going wrong?

    Thank you

    The DAQ Assistant is a Windows program only, DAQmx only.  It not Linux or with DAQmx Base.  DAQmx basic tasks and channels are a little different (I think) counterparts DAQmx.  The fall to the bottom of the list of basic parts, or is it only DAQmx?

    Lynn

  • Move data between linux_32 and linux_64 database files

    Hello

    Can I move a database (all data files, controlfiles, etc.) between different architectures? I've already moved the databases between servers with the same os + arch but have not moved between 32 and 64 bit...


    Concerning
    Ricardo

    If you want to move the database for 32-bit linux for 64-bit linux, you can by simply restore rman on 64-bit box of backup performed in 32-bit box. Once this is done, run $ORACLE_HOME/rdbms/admin/utlirp.sql and run $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile your objects from 32-bit to 64-bit word size.

  • How to add an additional note between < ROWSET > and < ROW >

    Hi all

    Is there a way to add an additional NŒUD between < ROWSET > and < ROW > which appears ONCE per each XML document?

    <? XML version = "1.0"? >

    rowset <>

    < ROW >

    < > 7369 EMPNO < / EMPNO >

    SMITH < ENAME > < / ENAME >

    CLERK of < JOB > < / JOB >

    < MGR > 7902 < / MGR >

    < HIREDATE > 17 December 80 < / HIREDATE >

    < > 800 SAL < / SAL >

    < DEPTNO > 20 < / DEPTNO >

    < / ROW >

    < ROW >

    < > 7499 EMPNO < / EMPNO >

    ALLEN < ENAME > < / ENAME >

    SELLER of < JOB > < / JOB >

    < MGR > 7698 < / MGR >

    < HIREDATE > 20 February 81 < / HIREDATE >

    < SAL > 1600 < / SAL >

    < Order > 300 < / COMM >

    < DEPTNO > 30 < / DEPTNO >

    < / ROW >

    ...

    < / LINES >

    Will be

    <? XML version = "1.0"? >

    rowset <>

    new <>test < / test >

    < ROW >

    < > 7369 EMPNO < / EMPNO >

    SMITH < ENAME > < / ENAME >

    CLERK of < JOB > < / JOB >

    < MGR > 7902 < / MGR >

    < HIREDATE > 17 December 80 < / HIREDATE >

    < > 800 SAL < / SAL >

    < DEPTNO > 20 < / DEPTNO >

    < / ROW >

    < ROW >

    < > 7499 EMPNO < / EMPNO >

    ALLEN < ENAME > < / ENAME >

    SELLER of < JOB > < / JOB >

    < MGR > 7698 < / MGR >

    < HIREDATE > 20 February 81 < / HIREDATE >

    < SAL > 1600 < / SAL >

    < Order > 300 < / COMM >

    < DEPTNO > 30 < / DEPTNO >

    < / ROW >

    ...

    < / LINES >

    Thank you in advance, Sonya

    I don't think it's possible with dbms_xmlgen. I suggest you explore sql/xml to generate your own code xml using the keywords etc. of xmlelement, xmlagg.

    For example:

    Select xmlelement ("LINES"

    , xmlelement ("TEST", "NEW")

    XMLAGG (XMLELEMENT ("ROW",

    XMLFOREST (EMPNO,

    ENAME

    WORK

    BISHOP

    HIREDATE

    SAL

    COMM

    DEPTNO

    ) AS THE FOREST - XMLFOREST

    ) - LINE

    ) - TOT.

    ) - ROWSET

    from EMP;

    you will look like the following:

    New

    7369

    SMITH

    CLERK

    7902

    1980 12-17

    800

    20

    7499

    ALLEN

    SELLER

    7698

    1980-02-20

    1600

    300

    30

  • Parachute does not not between iOS and Mac devices... Does anyone have a good solution for it nor a lot of garbage to support

    Parachute does not not between iOS and Mac devices... Does anyone have a good solution for it nor a lot of garbage to support

    You want the solution? Why not tell us what Mac and Apple, mobile devices you have the OS and version?

    Also what troubleshooting steps you took?

    We do not have a crystal ball, and we're not sitting next to you.

  • AirDrop does not work between Mac mini end of 2014 and 6 s iPhone more

    Hello!

    I'm here for the first time. A little more last year, I bought a Mac mini end of 2014 with Core i5 clocked at 2.6 GHz, 8 GB RAM and 5400 RPM HARD drive. I replaced the HDD for an SSD, Samsung EVO 850 250 GB, to be correct. I also have an iPhone 6 Plus and does not AirDrop between my devices. They discover each other. Update both OS X and iOS on a regular basis, so that's not the problem. Check on this issue and finding a solution a have met this Airdrop is not my Mac mini 2012 and I have a few questions:

    I checked that TRIM Enabler Coulon, but later on my Mac I searched this Samsung EVO can't GARNISH. What it means? Download and install TRIM Enabler would be unnecessary, because the problem isn't here? Everything is fine with the Bluetooth, WiFi, my 6s more connects to the other MacBook Pro Retina early 2015, as the new MacBook 12 "iPads and iPhones, too. Please help me, thank you in advance.

    10.10.4 and later Apple does not allow that you caraa select TRIM and third part SSD. See:

    http://osxdaily.com/2015/10/29/use-trimforce-trim-SSD-Mac-OS-x/

    Can yo test to see if AirDrop works among other devices?

    like the iPhone with another device iOS or Mac or Mac with another Mac or iOS device?

  • problem syncing notes between mac and iphone

    Suddenly 6 months ago my notes stopped sync between my mac and my iphone. Synchronization between the iphone and the ipad still works. I have 'unchecked' syncing notes in icloud on all units, even disconnected my mac completely and back on to see if it would work, but no. When I check my iclouds units on my ipad, it lists only the ipad and iphone. And when I login to icloud in safari, showing notes on my phone and pad, not from my mac. So it seems that my mac is out of the loop. How can I me in?

    BTW, everything is fine, it's just my notes.

    If you have upgraded to a mobile device from Apple iOS 9 or a later version and then synchronize the Notes database to iCloud, then you won't be able to synchronize the Notes on a Mac with the same iCloud account until it is upgraded to OS X 10.11 or later version.

    Only the notes in the iCloud category will synchronize with iCloud. If you have any comments on my Mac, or synchronized with another network service, that they don't synchronize.

    If note that synchronization are not, please open the iCloud pane in system preferences. Make sure that you are connected to iCloud with the good Apple ID and the Notes selected. Uncheck and check again.

  • Notes will not sync between my Mac and my iPad

    Hello. I noticed that my Notes are not sync between my iPad and my Mac.

    In my iPad I have iOS 9, in my Mac I have the Mavericks.

    I checked in iCloud dot com, and my notes of the iPad are here,

    but my notes from my Mac are not there.

    I'm not sure but I think that this started happening after I upgraded to iOS 9 on my iPad.

    Any ideas that I can synchronize Notes between my Mac and my iPad?

    Thank you.

    You must upgrade to a later version of Mac OS X, because these Notes are created in the new application 'Notes' that is only supported by iOS 9 and OS X El Capitan.

    http://www.Apple.com/OSX/how-to-upgrade/

    I hope that answers your question.

    Best regards

    Austin

  • Table does not work correctly between LabView and TestStand

    I'm doing a TestStand program that reads data from a LabView VI.

    If I run the VI in LabView, it works perfectly well and generates a table with 18 points in length, the first 3 are numbers between 0 and 10 and the rest being-1 as I intended. Re-run the VI causes the re - initialize correctly and I get a new table that also meets my specifications.

    When I run the VI of TestStand, it works fine once, producing a table with 18 points, the first 3 are numbers between 0 and 10, and the rest is-1.

    If I run the VI in TestStand once again it increases the length of array in 18 each time. In so doing, it fails to write the new 3 numbers and just add - 1 in table 18 times. If I restart TestStand will work fine once more, he repeats the error if I re - run the VI. I don't understand why this is happening.

    I have re-product the error in a separate VI and the order, and I have attached an example in this post. The VI contains all the necessary information (if not, please say so and I will correct it), and TestStand sequence is configured to put all results, I would find useful in the report (as additional results).

    Your problem is your VI.   Specifically the comment nodes.  They initialize on the first call.  TestStand retains the VI in memory.  So when the VI is called again, the comments always nodes have their last value.  You will get the same results if you have VI your ArrayBuild.vi twice appealed.

    The way you use the feedback nodes, they really replace with Shift Registers.  I like your comment nodes, but since you pass the value of the node in the loop, the SHIFT registers are much more appropriate.  Just make sure you initialize your Shift Registers.

  • DMA between host and target FPGA is not supported for this remote system.

    I try to cover with my FPGA (on the cRIO-9002) of the RTO.  I have install upward of anOpen good VI reference without error, but as soon I try to access thefifo I error-63001 and the attached message wrote:

    Error-63001 occurredat reference FPGA VI opened in the target - multi rate - variables - fileIO_old.vi

    Possible reasons:

    NOR-RIO FPGACommunications framework: (Hex 0xFFFF09E7) DMA from the host to the FPGA targetis not supported for this remote system. Another method for controller of e/s or climatiqueLes associated with the FPGA target.

    What other I/O optionsdo I need to move the data asynchronously to the RTO for the FPGA. I have triedcreating memory, but it seems that I can't write to the memory of the RTOSside.

    We have also a 9012sitting around will using this cRIO rather solve this problem.

    I'm very very greenwhen it comes to LabView, so I apologize if this is an easy question.

    As stated in the readme of the driver NOR-RIO, DMA is not taken in charge from the host to the FPGA on the cRIO-900 x series. The cRIO-901 x supports DMA transfers between host and FPGA and FPGA to host all the cRIO-900 x series controllers only support transfers the FPGA host DMA. As a result, LabVIEW returns an error if you try to transfer using DMA controller for cRIO-900 x.

    The 9012 looks like the ideal solution, you are very lucky to have additional hardware laying around

Maybe you are looking for

  • Framing key text

    I'm trying to make the text are still in a clip that has camera movements. How can I make the text stay in the same place no matter where the camera moves? Help, please

  • Satellite L500-120 - where can I get the display driver?

    Hey guys,. I need help to find the right driver form. My graphics card is: ATI Mobility Radeon HD 4650 and I have Satellite L500 120 PSLJ3EI need to have the driver for my ATI Mobility Radeon HD 4650, but I can't find the right...Can someone help me

  • Why can I not register my PSP to my PS3?

    Supposed to connect the PSP to PS3 via a USB cable. After doing PSP then says "please wait" and PS3 "PSP not hooked" Huh? The cable is attached. There are no other instructions. PSP is proving to be the biggest waste of possible $ 249.00. Games, prim

  • How to change the screen on my new monitor ratio?

    Original title: report of the screen How can I change my ratio of the screen for a new monitor, I bought?

  • Trying to transfer files between computers

    When I plug my USB key and try to run the wizard I get this message: "your migration store was created with a previous edition of the wizard of Transgfer and files. Please collect your settings using the current version of the file transfer Wizard an