Posts

Showing posts from 2010

Checking all Check boxes in a Manual Tabular Form

If you get into edit all page processes on one of your pages, you'll notice that the second tab accross is titled 'Delete multiple processes' (7400:745). This page also provides the same functionality, for checking all checkboxes in the column. You'll notice this elements onclick function is html_CheckAll($x_UpTill(this,'TABLE'),this.checked) So, in your column header, using this will give you the same behaviour <input type="checkbox" onclick="html_CheckAll($x_UpTill(this,'TABLE'),this.checked)" /> It is worth noting that html_CheckAll is not an apex documented function, so should be used with caution. In saying that, it is just  a wrapper for $f_CheckAll, which is documented - so it should be safe to use that function call instead of html_CheckAll. So the better input type would look like: <input type="checkbox" onclick="$f_CheckAll($x_UpTill(this,'TABLE'),this.checked)" /> The fu

CSV Upload into Oracle Table

The first thing you need is a page with a file type item, and a submit button. When you submit the page, the selected file is uploaded into the apex_application_files (or wwv_flow_files) view. The actual blob contents of the file is uploaded into the column BLOB_CONTENT but since a CSV file is just plain text, it made sense to me to convert that file to a CLOB, so that you can perform regular string functions on the data. The first reference to converting a blob to a clob, was in the OTN forums  - confirmed by referring to the oracle documentation . After converting it to a clob, it is simply a matter of looping over each row of the data, and then populating into an apex collection (or some other temp table). This is an intermediary step just so you can review the data before committing the changes. Finally, you just move the data from the collection into the table. So the code for copying the blob into a clob and populating the collection can be seen below. declare --variables t