How to view FND_FILE. OUTPUT in the loop message

Hello

I have a package created and I would like to display error message on each loop. If it's 5 records then error message 5 times. My validation is data existing in the table csv if customers. My package below.



PACKAGE body to CREATE or REPLACE APPS.omOrderLoader AS
PROCEDURE SPKO1 (errbuf OUT VARCHAR2,
RETCODE ON NUMBER,
vfile IN VARCHAR2,
v_source_id in NUMBER) IS

FH UTL_FILE. TYPE_DE_FICHIER;
v_line VARCHAR2 (32767).
v_created_by NUMBER (10);
v_creation_date DATE;
v_org_id NUMBER (10);
v_orig_sys_docref VARCHAR2 (50);
V_Customer VARCHAR2 (360);
v_customer_prev VARCHAR2 (360);
v_sold_to_org NUMBER (10);
v_orig_line_ref NUMBER (10);
v_item_code VARCHAR2 (2000);
v_ordered_qty NUMBER (10);
v_selling_price NUMBER (10);
v_hcount NUMBER (10);
v_lcount NUMBER (10);
v_stat NUMBER;

BEGIN
-v_source_id: = 6;
v_created_by: = - 1;
v_org_id: = 204;
v_customer_prev: = null;
v_orig_line_ref: = 0;
v_stat: = 0;
errbuf: = NULL;
RETCODE: = 0;
v_sold_to_org: = 0;

SELECT header_id in (DE) v_orig_sys_docref
Select header_id
of OE_ORDER_HEADERS_ALL
creation_date desc order
) WHERE ROWNUM = 1;

FH: = UTL_FILE. FOPEN ('XXANDDIR2', 'R', 32767, vfile);
< < file_read_lines > >
LOOP
BEGIN
UTL_FILE. GET_LINE (fh, v_line);

V_Customer: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 1") ',' "') ','" ');
v_creation_date: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 2") ',' "') ','" ');
v_item_code: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 3") ',' "') ','" ');
v_ordered_qty: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 4") ',' "') ','" ');
v_selling_price: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 5") ',' "') ','" ');
v_orig_line_ref: = (v_orig_line_ref + 1);

If v_stat = 0 then
v_orig_sys_docref: = (v_orig_sys_docref + 1);
end if;

SELECT hca.cust_account_id from v_sold_to_org
OF hz_cust_accounts AOB.
HP hz_parties
WHERE hca.party_id = hp.party_id
AND hca.warehouse_id IS NOT NULL
AND hp.party_name = v_customer;

-If non-existent then display message for every row of the csv.

If v_stat = 0 then
INSERT INTO OE_HEADERS_IFACE_ALL...
commit;
end if;

INSERT INTO OE_LINES_IFACE_ALL...
commit;

v_customer_prev: = v_customer;
If v_customer_prev = v_customer then
v_stat: = 1;
on the other
v_stat: = 0;
end if;

fnd_file.put_line (FND_FILE. OUT, ' LINE: ' | V_Customer);

EXCEPTION
WHEN NO_DATA_FOUND THEN
OUTPUT file_read_lines;
fnd_file.put_line (FND_FILE. OUT, «no records found...» ») ;
END;
END LOOP;
SELECT count (*) in the v_hcount OF OE_HEADERS_IFACE_ALL;
SELECT count (*) in the v_lcount OF OE_LINES_IFACE_ALL;
fnd_file.put_line (FND_FILE. OUT, ' header: Total Record inserted successfully: ' | v_hcount);
fnd_file.put_line (FND_FILE. OUT, ' LINES: Total Record inserted successfully: ' | v_lcount);
UTL_FILE. FCLOSE (FH);
END SPKO1;
END omOrderLoader;
/


Help, please.

Thank you.

Kind regards
Diane

sth - something :)

>
So when I applied it, error display "PLS-00103: encountered the symbol EXCEPTION when expecting one of the following values (begin case declare and if the exit for goto loop mod null).
>
Add start before choosing
>
BEGIN - home
...
start - it!
SELECT hca.cust_account_id from v_sold_to_org
OF hz_cust_accounts AOB.
HP hz_parties
WHERE hca.party_id = hp.party_id
AND hca.warehouse_id IS NOT NULL
AND hp.party_name = v_customer;

exception when no_data_found then
v_sold_to_org: = null;
end;
...

Tags: Oracle Applications

Similar Questions

  • When I create two keyframes at the same position between keyframes at different positions this way adds a loop. How can I get rid of the loop?

    When I create two keyframes at the same position between keyframes at different positions this way adds a loop. How can I get rid of the loop? I was just by dragging the handles on the vertex point, but I want to get rid of the loop together.

    Focus on the Bezier handles on the motion path in the Composition window. You can select the tool pen (g) and hold down the Alt/Option key to select the tool convert Vertex (it looks like a V on the side) and then fix the handle manually or click on the top of the trajectory to change it to a straight line. You can also play with spatial interpretation Keyframe.

    To avoid this, you can change the interpolation of keyframes in space to linear preferences. Most of the time I don't like straight so I keep my default value of Bézier.

  • How can I get rid of the Thunderbird message?

    How can I get rid of the Thunderbird message?

    Are you talking about the Thunderbird start page when you start the program?

    In the menu bar, select Tools-Options-general

    Uncheck the first option.

    No Menu bar? Press the ALT key .

  • How can I get rid of the error message % APPADATA %

    original title: how CAN I get RID OF THE error MESSAGE % APPADATA %

    Please can someone help me get rid of the error message '% APPADATA '.

    Hi jmlMoh'ed,.

    Exactly when you receive this error message?

    If it is a mistake to start, I you suggest trying to set up the machine in a clean boot state and then install the update.  Follow the given article to set up the machine in a clean boot state.

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

    Note: Please make sure that the computer is configured to start as usual according to step 7 of the article: how to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7: http://support.microsoft.com/kb/929135.

    Hope the helps of information. Please post back and we do know.

  • How can I get rid of the error message error "jre terminated unexpectedly" at first upward?

    How can I get rid of the error message error "jre terminated unexpectedly" at first upward?

    [Moved from comments]

    Hello

    Re: Java... You should do some research and decide. I disabled the add-on modules. Many would say that this is not enough.

    Here is an article good start:

    Java security hole: so forth and so | Articles from Computerworld:
    http://blogs.Computerworld.com/cybercrime-and-hacking/20921/Java-security-flaw-yada-yada-yada

    Search terms such as 'java vulnerability","java security"and" disable java "will return useful information.

    Don

  • How to stop a beep when the loop ends

    Hello

    I have a beep occurs inside a loop (which contains waves of data acquisition) to a certain threshold. I want the sound system for not introducing any delay in the execution of the loop.

    But I also have another beep when the loop ends. How to eliminate this noise?

    Your comments will be greatly appreciated. Thank you

    PI

    The obvious answer would be: remove the beep VI this is probably. Please show us your code.

  • How can I get rid of the annoying message Sync at the bottom of my Firefox page as I am not interested in sync

    I would like to no longer receive the synchronization message please. He keeps returning to my browser page

    You can attach a screenshot?

    • Use a type of compressed as PNG or JPG image to save the screenshot
    • Make sure you do not exceed the maximum size of 1 MB
  • Every time my husband myself texts, his new message appears with the same old message in weeks. How can I get rid of the old message?

    If my husband I text message about 3 weeks telling me that dinner was ready, and I got this message alerted on my Apple Watch first, until I saw it on my phone. I replied with my phone. Since then, now whenever texts he me this message appears first as well as all his new message says on my Apple Watch only. How can I fix?

    Hello

    You can have an alert notification not cleared for the old message in the Notification Center on your watch.

    You can close the message notifications individually as and when read you either by:

    -When you read one: scroll to the bottom of the notification and clicking on the button reject, or;

    -When you read one: drag down on the notification (from the upper section, if a notification that is longer than that of a playback screen), or;

    -In the list (after slipping from the top of your watch face down to open the Notification Center): hit left swipe on an individual notification, then tapping on Clear.

  • When I try to copy files to a CD, I get message "Windows has a problem to copy this file to a CD." How to fix? I get the same message that I click on "Copy to CD" or drag the file to copy to the CD player.

    When I try to copy files to a CD, I get the message "Windows has encountered a problem when trying to copy this file."  I press the button "Retry" without any result.  I get the same message that I have click on 'Copy' files on a CD or drag the files to copy to the CD player.  I was able to copy these same files to a CD a few days ago.  Thanks for the suggestions.

    • You have problems with programs
    • Error messages
    • Recent changes to your computer
    • What you have already tried to solve the problem

    Hello

    1. don't you get an error code along with this error message?
    2. what CD burning software is installed on your computer?
    3. what kind of CD do you use to burn?
    4. What is the status of the CD - DVD drive in Device Manager?

    Method 1.
    Let us first check the status of the optical drive in the Device Manager. Check if there is no error code or yellow mark is listed.
    Reference:
    Explanation of error codes generated by Device Manager in Windows XP Professional
    http://support.Microsoft.com/kb/310123

    Method 2.
    If the problem is to start the computer in a clean boot state and check if you are able to accomplish this task.
    Reference:
    How to configure Windows XP to start in a "clean boot" State
    http://support.Microsoft.com/kb/310353/en-us
    Note: When you are finished troubleshooting, follow the steps as explained in the article to reset the computer to start as usual.

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to turn Pix timestamp of the log messages in the buffer

    How can I activate the timestamp of the log 'stamped' PIX messages? I activated the "record timestamp" command that generates timestamps for 'syslogd' messages but my messages saved in the buffer do not have a timestamp on them.

    I'm running ver 6.2 (2) 'warnings of logging in buffered memory ".

    Rgds tony

    Unfortunately you don't have. As you have seen, the "horodateurs log" command the timestamps on the syslog messages, but still put on the console messages.

    There is a bug already open about it, CSCdu18237. No word on when it will be resolved, however.

  • How can I get rid of the large message on my screen of e-mail about Thunderbirdd birthday?

    The large message covers the bottom of my screen. Thanks for your help!

    The easy answer is to click on one of your messages, and the message text will replace the Start Page in the messages pane.

    If you want that he spread ever to go to the Menu bar and select Tools-Options-general and uncheck the option to display the Start Page.

    No menu bar display? Press the ALT key.

  • How to view my favorites on the left side of my screen while I am in gmail as I have on my system win 7? my new system is win 8.1

    On Win 7 my books always appear on the left side of the screen makes it very convenient. I can't get there on my laptop Win 8.1.
    Thank you
    Peter

    Have you checked the view menu?

    • Press the F10 key or press the Alt key to bring up the hidden menu bar.
  • How to get two outputs at the same time?

    Hello

    I use the PCIe6351 DAQ card to generate two signals separately. This product has two exits, so I thought that I can use both at the same time, but when I run the code it gives an error: "the spesified resource is reserved. I just want to know if it is possible for me to use both outputs together at the same time or not? If so, would you please guide me what should I do to solve the problem?

    Thank you very much

    Soran

    Great! This works. I appreciate your help

  • output to the loop iteration

    Hi people!

    I am trying to use a very simple "loop For" with "16" iterations and Shift Registers starting at '0' and adding '4' on each iteration.

    But I am not successful to display each value in the iteration. Only the final value of '64 "!

    Is it possible to generate the value of each iteration in each loop?

    If this is the case, then could you give an example?

    See you soon!


  • How to let two independent, while the loops are scrambling

    Hello

    I have a while loop for imaging system (PXI) remotely. Another while loop will save the data in parallel with the first through the shared to host variable. But the first loop for the image acquisition must wait for the trigger. For this purpose, the two loops cannot start at the same time. Y at - it an idea to solve this problem? Thanks in advance.

    Hello

    You can use a shared with a Boolean variable. The variable is set to false by default. During the first loop begins the variable is set to true. The other PC bed the shared variable one waits until it is true. Now the other loop begins.

    But you still have the delay of the network, if it is not possible that loops start accurate at the same time.

Maybe you are looking for