ASP.NET DynamicData - Insert Records from Datatable - asp.net-dynamic-data

In DynamicData,
I have a datatable generated at runtime dynamically for a table while user is viewing a page. I need to insert these records from datatable to database Table(based on dynamicdata table page).
How can i do ?

Use the INSERT.aspx template provided in Dynamic Data under the folders
Dynamic Data --> PageTemplates

Related

Oracle APEX Data load definition with default column value?

I am using Oracle APEX 21.1
I am trying to create Data loading page with data load definition, which is required with APEX 21.1.
I have bulk upload on MD page, so I have PX_ID item which i want to set as default (fk column) for all new rows from bulk upload.

How to resolve error ORA-20987: APEX - ORA-02015?

I have a page in apex with multiple interactive grid. In one of the interactive grid i am trying to update the data of a column of a table in the database. The column named defect kind is a dropdown in the grid and on click of save should be able to updated the column value in database with the selected value in the grid.
While clicking on save apex is showing an error as follows:
Ajax call returned server error ORA-20987: APEX - ORA-02015: cannot select FOR UPDATE from remote table for.
I have used the type interactive grid - automatic row processing(DML) for saving the grid. Only defect kind is selected by the user rest all column value are coming directly from the table.
Interactive grid image:
NOTE:For this workspace the tables are accessed through a database link. I am using APEX 5.1.
This error is raised specifically because you are working over a database link.
Error code: ORA-02015
Description: cannot select FOR UPDATE from remote table
Cause: An attempt was made to select FOR UPDATE on a remote table (directly, or via a view) that had abstract data type columns, and the
view or select list contained abstract data type columns or non-column
items.
Action: To attempt a select FOR UPDATE, use a view or select list that consists only of base columns from the remote table, none of
which may be abstract data type columns.
I can't tell from what you've posted if the issue is with the query you're using to populate the IG or with some underlying view or the table itself. Depending your ability to locate and remove the "abstract data type columns or non-column items" (if that's even possible with an IG) you may not be able to make this work with automatic row processing over a database link at all. It may require a custom PL/SQL API instead.
Have you tried to set the attribute Lock Row (group Settings) to No in your Interactive Grid - automatic row processing(DML) process?

how to save multiple select data into a different table - pivot table

I have the input form as shown below
data on health facilities(fasilitas keselamatan), safety facilities(fasilitas kesejahteraan) taken from a different table. And then the contents of the form
in store in another table inside there is id corporation and id safeties, this is pivot table
how to function store on its controller?

How to create table dynamically based on the uploaded csv file column header using oracle apex

Based in the csv file column header it should create table dynamically and also insert records of that csv file into the newly create table.
Ex:
1) If i upload a file TEST.csv with 3 columns, it should create a table dynamically with three
2) Again if i upload a new file called TEST2.csv with 5 columns, it should create a table dynamically with five columns.
Every time it should create a table based on the uploaded csv file header..
how to achieve this in oracle APEX..
Thanks in Advance..
Without creating new tables you can treat the CSVs as tables using a TABLE function you can SELECT from. If you download the packages from the Alexandria Project you will find a function that will do just that inside CSV_UTIL_PKG (clob_to_csv is this function but you will find other goodies in here).
You would just upload the CSV and store in a CLOB column and then you can build reports on it using the CSV_UTIL_PKG code.
If you must create a new table for the upload you could still use this parser. Upload the file and then select just the first row (e.g. SELECT * FROM csv_util_pkg.clob_to_csv(your_clob) WHERE ROWNUM = 1). You could insert this row into an Apex Collection using APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY to make it easy to then iterate over each column.
You would need to determine the datatype for each column but could just use VARCHAR2 for everything.
But if you are just using generic columns you could just as easily just store one addition column as a name of this collection of records and store all of the uploads in the same table. Just build another table to store the column names.
Simply store this file as BLOB if structure is "dynamic".
You can use XML data type for this use case too but it won't be very different from BLOB column.
There is a SecureFile feature since 11g, It is a new BLOB implementation, it performs better than regular BLOB and it is good for unstructured or semi structured data.

Data loading in Oracle APEX

I create pages for loading data from CSV through Data Load Wizard. CSV-file contains data not for all fields, but this fields are required.
How can I insert data in fields, that not contains in CSV, for example, using queries to another tables?
My APEX vervion is 4.1.1.00.23
You can do that using Oracle SQL.
If there is a unique ID for the table that you are loading into (let's say you have most of the employee in a csv), you can use that ID to merge or update data from other tables.
For a table like this...
empid,
ename,
zip_code
state_code
Example : you can load this using CSV
EMP:
empid,
ename,
zip_code
and then update the state using this query.
update emp tgt
set state = (select state
from zip_code_lookup src
where src.zip_code = tgt.zip_code
);
If there is more than one column that needs to be updated, I prefer using the merge command.
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_9016.htm#SQLRF01606
you can refer to this link for more information about data loading to multiple tables using the data loading wizard http://vincentdeelen.blogspot.in/2014/03/data-load-for-multiple-tables.html

Resources