Load the CSV file

I use Apex 3.2 and construction of a facility charge of csv file.
I received a lot of help on this post
Re: Validate CSV File
I'm now able to load the data into my custom table.
Before I do that I want to update the collection first, using this option if statement
IF c001 IS NULL THEN
            c006    := 'APXIMP';
            c007    := c007 || 'Storekey is missing!';
          END IF;

          IF c002 IS NULL THEN
            c006    := 'APXIMP';
            c007    := c007 || 'Plan Delivery Moment is missing!';
          END IF;

          IF c003 IS NULL THEN
            c006    := 'APXIMP';
            c007    := c007 || 'WRIN Base is missing!';
          END IF;

          IF c004 IS NULL THEN
            c006    := 'APXIMP';
            c007    := c007 || 'WRIN Suffix is missing!';
          END IF;

          IF c005 IS NULL THEN
            c006    := 'APXIMP';
            c007    := c007 || 'Order Qty. is missing!';
          END IF;

          IF c005 IS NOT NULL THEN
            IF SIGN(vt_record(5))=-1 THEN
              c006    := 'APXIMP';
              c007    := c007 || 'Order Qty. must be a positive integer value!';
            END IF;
            IF MOD(c005,FLOOR(c005)) <> 0 THEN
              c006    := 'APXIMP';
              c007    := c007 || 'Order Qty. must be a positive integer value!';
            END IF;
          END IF;
        EXCEPTION
          WHEN others THEN
            c006    := 'APXIMP';
            c007    := c007 || 'Order Qty. must be a positive integer value!';
I am new to the collections, so if someone could show me an example or point me in the right direction, as there seems to be several types of update of collection procedures.

See you soon

Gus

Hello

You talk about the package but written the anonymous block syntax. I did understand what you're trying to do.

Assuming that it is a procedure of your code should look like

CREATE OR REPLACE PROCEDURE UPDATE_COLL (
  P_collection_name IN VARCHAR2  -- parameter passed when calling from Apex Process
) AS

begin

for x in (select seq_id, c001, c002, c003, c004, c005, c006, c007
         from apex_collections
        where collection_name = p_ collection_name )
LOOP

     IF x.c001 IS NULL THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
       apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 || 'Storekey is missing!'
      );
     END IF;

    IF x.c002 IS NULL THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
       apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 ||  'Plan Delivery Moment is missing!'
      );
     END IF;

    IF x.c003 IS NULL THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
       apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 ||   'WRIN Base is missing!'
      );
    END IF;

    IF x.c004 IS NULL THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
       apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 ||  'WRIN Suffix is missing!'
      );
   END IF;

  IF x.c005 IS NULL THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
      apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 || 'Order Qty. is missing!'
      );
  END IF;

  IF x.c005 IS NOT NULL THEN
      IF SIGN(c005)=-1 THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
      apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 || 'Order Qty. must be a positive integer value!'
      );
     END IF;
     IF MOD(c005,FLOOR(c005))  0 THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
      apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 ||'Order Qty. must be a positive integer value!'
      );
    END IF;
  END IF;
END LOOP;
 EXCEPTION
          WHEN others THEN
      apex_collection.update_member_attribute (
         p_collection_name=> p_collection_name,
         p_seq=> x.seq_id,
         p_attr_number =>6,
         p_attr_value=> 'APXIMP'
        );
      apex_collection.update_member_attribute (
          p_collection_name=> p_collection_name,
          p_seq=> x.seq_id,
         p_attr_number =>7,
         p_attr_value=> x.c007 || 'Order Qty. must be a positive integer value!'
      );
end;

Tags: Database

Similar Questions

  • SQLLOADER fails to load the CSV file space

    Hello


    -I use sqlloader to load the tables (Release 10.2.0.4.0)

    - But I'm real spaces in my CSV files, which I want to load is in the tables.

    -However, sqlloader load "null" instead.

    -Please help.

    Vishal,

    Let me know if previously posted the solution works for you, or you always spaces loading problems

    Concerning

  • The monitoring of test data to write in the CSV file

    Hi, I'm new to Labview. I have a state machine in my front that runs a series of tests. Every time I update the lights on the Panel with the State. My question is, how is the best way to follow the test data my indicators are loaded with during the test, as well as at the end of the test I can group test data in a cluster, and send it to an another VI to write my CSV file. I already have a VI who writes the CSV file, but the problem is followed by data with my indicators. It would be nice if you could just the data stored in the indicators, but I realize there is no exit node =) any ideas on the best painless approach to this?

    Thank you, Rob

    Yes, that's exactly what typedef are to:

    Right-click on your control and select make typedef.

    A new window will open with only your control inside. You can register this control and then use it everywhere. When you modify the typedef, all controls of this type will change also.

    Basically, you create your own type as 'U8 numéric', 'boolean', or 'chain' except yours can be the 'cluster of all data on my front panel' type, "all the action my state machine can do," etc...

  • How to download the Csv file with column headers

    Hi all

    This is pavan, using Apex version 4.2.3


    I am trying to download the csv file I followed this link , and I'm able to download excel with headers, when I try to download with headers of this error "'ORA-01858: a non-digit character was found here where was waiting for a digital" I searched in google but could not find the right solution, "


    can anyone help on this please.

    Thanks in advance,


    Kind regards

    Pavan

    This article is 6 years old.

    You should study the solutions that are available for APEX 4.2: data loader or the 'Excel2Collection' plugin (which also manages the CSV files).

    Data Loader

    It is a wizard that generates an Assistant for your application.

    Excel2Collection

    You will use the Excel2Collection (in a single process) to convert the BLOB in a Collection

    Then, in a 2nd address), you just do a "INSERT...". SELECT statement.  Add ' where seq_id > 1 "for files with a header.

    MK

    PS - Use the "EXECUTE IMMEDIATE" article is not necessary.

  • How create the CSV file delimited by tabs using ORACLE utl_file?

    How create the CSV file delimited by tabs using ORACLE utl_file? Please provide the code sampl.

    This isn't a problem with Oracle, it is a problem with the way you open the data in Microsoft Excel.

    In Excel, you want (depending on your version may vary slightly)...

    Office 2010...

    1. go in the Ribbon "Data".

    2. click on 'text '.

    3. Locate and select your file, and then click "import."

    4 step 1 of the wizard - choose "Delimited", then click on "next >".

    5. step 2 of the wizard - choose "Tab" as the delimiter and click on "next >".

    6. step 3 of the wizard - define types of column as needed (if necessary) and click on "Finish".

    7. check where you want the data in the worksheet.

    Data is loading now in single cells as you expect.

    If you just double-click the CSV, Excel is apparently assuming that it will be separated by commas and does not recognize tabs as separators, unlike when you rename the file with a .xls extension where it examines the file, complains that it is not a content .xls and asks you to confirm that you want to continue loading and then intelligently recognizes the tabs and the format for you.

    As I said, not a problem with Oracle, just a problem with the MS Excel software.

  • View the name of the CSV file based on date?

    So I have this CSV file where there are two columns Date and name. And I want to show the correct name on the correct date in the field of the name_txt, how can I do this? pls help.

    Use the urlloader class to load your csv file and string flash methods to analyze the data.

  • Validate the CSV file

    I have a process where the user used the file browser to load a csv file into a custom through the table APEX_APPLICATION_FILES table.
    Is it possible to count the reference lines in the file, once it has been loaded into APEX_APPLICATION_FILES, but before the custom table.

    I can validate the file type and size, but need to rank of County.

    See you soon

    Gus

    Dietmar,
    I just wanted to clarify... I posted the code I did for the poster get a start. The links you have posted also show the parsing code, but the example that I posted actually take the downloaded metadata apex and treatment file. Poster will have to do some work modifying the code, but it's a starting point...

    I also wanted to say thank you for your presentations to Kscope 2012... Wonderful meet you there too! Now, if you've posted a copy of your request of documentation that would be wonderful!

    Thank you

    Tony Miller
    Dallas, TX

  • Load a CSV file into a table like in dataworkshop

    Workshop of data has a function to load a CSV file and create a table based on it, the same, I want to create in my application.



    I went through the forum http://forums.oracle.com/forums/thread.jspa?threadID=334988 & start = 60 & tstart = 0

    but not able to download all the files (application, package HTMLDB_TOOLS and PAGE_SENTRY function) could not find the PAGE_SENTRY function.

    AND when I open this link http://apex.oracle.com/pls/apex/f?p=27746

    I could not run the application. I've provided a CSV file and when I click on SEND, I get the error:

    ORA-06550: line 1, column 7: PLS-00201: identifier ' HTMLDB_TOOLS. PARSE_FILE' must be declared

    tried in apex.oracle.com host as shown in the previous post.

    any help pls..,.

    Another method to load data into the tables..., (as dataworkshop)

    Hello

    I have check app works very well.

    Have you read instructions?
    Load a CSV file in a table
    >
    Create a small csv file as

    col1, col2, col3
    VARCHAR2 (10), Number, "Number (10.2)" "
    Cat, 2, 3.2
    dog, 99, 10.4
    >
    First row must have valid column names. To verify that your first line of titles have no spaces or those who are not words reserved.
    Second line of the CSV file must have column of table data types.

    When you meet these requirements app works perfectly

    Kind regards
    Jari

  • Load a CSV file and access to variables

    Hi guys,.

    I am new to AS3 and treated with AS2 before (just to get the scope when change it).

    Is it possible in AS3 to load an excel .csv file into Flash using the URLLoader (or?) and the data in the form of variables?

    I can get the .csv to load and trace values (cell1, cell2, cell3...) but I do not know how to collect the data and place it into variables.

    Can I create a table and access like so... MonTableau [0], myArray [1]? If so, I don't know why it does not work.

    I have to be on the road quite wrong. Here's what I have so far...

    var loader: URLLoader = new URLLoader();
    loader.dataFormat = pouvez;
    loader.addEventListener (Event.COMPLETE, dataLoaded);

    var request: URLRequest = new URLRequest ("population.csv");
    Loader.Load (request);
    //...
    function dataLoaded(evt:Event):void {}
    var myData:Array = new Array (loader.data);
    trace (mydata [i]);

    }

    Thanks for any help,

    Sky

    Simply load your csv file and use the string flash methods to allocate these values in a table:

    var myDate:Array = loader.data.split(",");

  • There is a special token that I can put in a column of the CSV file recovery channel which implies approval of the current value?

    Versistand version is 2013 sp1.

    I use stimulus CSV expressions in my sequence in real time and want a channel to keep its value current (last) until a certain time. Is there a way to do this?

    Stimulation CSV file example:

    timestamp, chan1, chan2

    0,0,

    10, 1,

    20,1,5

    30,2,10

    In this example, chan2 would retain its current value until the timestamp 20.

    Is it possible to implement this feature?

    Kind regards

    Rick Howard

    Thank you! It is a valuable feedback. I can't think of a way to do natively with the functionality of reading CSV for sequences in real time. Some thoughts on how this can be done:

    1. create your own utility to sequences of script based on a CSV file in real-time. Extend the functionality of having a special marker in a cell which designates not only to change the value for the channel as timestep. Do not start from scratch. This tool open source and this one the two script of sequences in real time and stimulation of reading profiles based on data sets (although in different ways).

    2. with the help of software without insertion to the fault of the string value that you want to keep the initial value for the first X seconds of reading the CSV file. For example, you could play another sequence with your CSV file at fault the channel at its current value so that reading CSV does not replace the value.

  • Open the csv file in labview

    Hello

    its difficult for me to open the .csv file in labview. If someone you suggest program labview or suspicion for bellows file attached?

    its really a challenge to open it in Labview.

    So free then try to solve this problem.

    Thank you

    Use the worksheet in reading file.  You can then use the table to Index to get the first colum and search for an empty string.  This will give you the break between the header data and the actual data.  Take all the data after this line and convert it to a number (String number floating/Exp).

  • Writing data in the CSV file?

    I tried, but in vain, to write data in the CSV file, with the column headers of the file labeled appropriately to each channel as we do in LabView (see attached CSV).  I know that developers should do this same in .net.  Can anyone provide a snippet of code to help me get started?  In addition, maybe there is a completely different way to do the same thing instead of writing directly to the CSV file?  (In fact, I really need to fill a table with data and who join the CSV every seconds of couple).  I have the tables already coded for each channel, but I'm still stuck on how to get it in the CSV file.  I'm coding in VB.net using Visual Studio 2012, Measurement Studio 2013 Standard.  Any help would be greatly appreciated.  Thank you.

    a csv file is nothing more than a text file

    There are many examples on how to write a text using .NET file

  • blue screen after Ko 2840149, error - "STOP: c0000218 {Registry hive failure} the registry cannot load the hive (file): \systemroot\system32\config\SOFTWARE.

    After I installed security KB2840149 on a 2008 VM w/exchange server that is running on the machine of Hyper-v server 2008 I'm dead in the water w / E-mail down hard.  The virtual computer is in a reboot cycle bluescreening before I can get anywhere.  Tried the last well known - no effect.  Safe mode - so bluescreens.

    BlueScreen info:
    STOP: c0000218 {Registry hive failure}
    The registry cannot load the hive (file):
    \systemroot\system32\config\SOFTWARE
    or its log or alternation.
    It is damaged, missing, or not accessible in writing
    I saw that it was a patch of replacement for a patch that crashed a lot of PCs.  Since there is no history on this patch, I wanted to check in a see what is the best way to fix this on a virtual machine?

    Being not so deep on VM, I wasn't sure if there was a better way. But I just put the virtual machine to load 2008 iso and then made the standard repair for registry problems off the coast of the article below.

    Of http:

    If the Windows registry is slightly or moderately damaged, you may be able to restart the computer in safe mode and use system restore to restore the registry from the computer to the last known good configuration. However, if the Windows registry is seriously damaged, all types of logon will be prevented. Trying to connect to Windows causes the system fails, then restart. In this case, you will need to boot the system into the recovery instead of Windows Console. Once in the Recovery Console, you can use the Startup Repair tool. Startup Repair tool automates common diagnostic and repair of the installations of Windows tasks starts longer.

    (a) start your Windows Vista or Windows Server 2008 DVD
    (b) on the first Setup screen click Next
    (c) in the lower left corner of the screen, choose "repair your computer".
    (d) on the System Recovery Options screen, select your Windows installation and then click Next
    (e) click on "Command prompt".
    (f) go to X:\sources\recovery > startrep.exe
    (g) this will take some time but will look at any registry related issues.

  • Rename the csv file

    Hello

    After an exhausting search this forum and a lot of trial and error, I was not able to work on how to rename a .csv file.  For example, I want to change the name of the csv files in a folder to include the name of the folder. For example, from Trial01 to Folder1_Trial01.

    Can someone help me, please!

    Thank you

    CJ

    CJ,

    You can try something like this:

    Norbert

    PS: If it is difficult for you to understand, you might want to do a training online or visit a LV course of NOR.

  • corrupted: WINDOWS\ SYSTEM32\ CONFIG\ SOFTWARE Stop: c0000218 {Registry file failure} the registry cannot load the hive (file): SystemRoo

    corrupt: WINDOWS- SYSTEM32- CONFIG- SOFTWARE Stop: c0000218 { file registry failure} the registry cannot load the hive (file): any on windows server 2003.  How can I fix this

    Hello, getin99

    For help on Windows Server, you need to create a new post on the TechNet forums at the following address: http://social.technet.microsoft.com/Forums/en-US/winservergen/threads

Maybe you are looking for

  • I downloaded version 5 and lost my google toolbar. Could you tell me how to recover my favorites?

    I waited like everyone else someone make compatible with firefox google 5. It does'nt look as if it's going to happen. Please advise me on how to recover the very important bookmarks that were on the google toolbar. Mike in Utah

  • Tools? missing toolbar

    the file, edit, view, bookmark, tools and help toolbar is missing. I tried to get him dirty with my toolbars customization, and I don't know how I deleted it.

  • Why my access code is necessary now to use Touch ID?

    On my iPhone 5s I don't use Touch Id because he had trouble reading my footprint by more than 50% of the time. I just upgraded to the 6s more and now I turned on Touch Id and saved my fingers. However, whenever I want to use fingerprint to unlock the

  • Error 1335 - corrupted file

    Hello I recently installed windows 7 on my new custom machine built a week ago. I ran into a problem when I tried to install a game [Crysis] error occurred during the installation began to copy files and install the game. This game is using .cab file

  • Backup Flash memory

    I made an application that stores information in flash memory. Is it possible to save the Flash for BB. Because if I install an update of the software of the device, flash memory is Wiped and I lose my information.