Skip to main content

Posts

Showing posts from February, 2011

Loading CSV(Comma Delimited Values) document into a Sample Oracle APEX Application

Today i want to show you a way you can load .csv documents into tables in an application. For this session i have a sample application that stores information into this these tables 1.EMP ----these stores a list of Employees 2.BADLOG---this logs errors   3.DOCUMENT_TABLE --this stores the uploaded document(.csv in this case) I want to load a .csv(comma delimited values) document into the EMP table. Note: The document must have matching columns with the table you want to upload into  Steps to take on the application level 1.Create a Page that 'll allow the user to upload the CSV into the document table 2.On the same page or a branched page ensure you call this procedure which must already be in the database /****************************************************************/ procedure document_upload_api  (   p_filename in varchar2,   p_output out varchar2  ) is v_blob_data BLOB;   v_blob_length NUMBER; v_position NUMBER; v_inserted_rows NUMBER:=0; v_