Inserting multiples rows into a table
We have a job schedule table and a job date table.
Job Schedule
Job_ID Frequency
1 1234567
2 12-456-
Job Date
Job_ID Date
1 01-JAN-07
1 02-JAN-07
We need to insert all DATES (not number of day in the week) into the Job Date table for a job according to the frequency. For example, for Job_ID 1 daily and for Job_ID 2 only Mondays, Tuesdays, Thursdays, Fridays, and Saturdays of the year.
How can we achieve this?
This question smells like this one...
Inserting rows
Similar Messages
-
Inserting multiples rows into a table using function or procedure..
How do i insert multiples rows into a table using function or procedure?
Please provide me query..Use FORALL bulk insert statement...
eg:
procedure generate_test_data as
type cl_itab is table of integer index by pls_integer;
v_cl_itab cl_itab;
type cl_vtab is table of varchar2(25) index by pls_integer;
v_cl_vtab cl_vtab;
type cl_dtab is table of date index by pls_integer;
v_cl_dtab cl_dtab;
begin
for i in 1.. 100 loop
v_cl_itab(i):= dbms_random.value(1,1000);
v_cl_vtab (i):=dbms_random.string('a',20);
v_cl_dtab (i):=to_date(trunc(dbms_random.value(2453737, 2454101)),'j');
end loop;
forall i in v_cl_itab.first .. v_cl_itab.last
execute immediate 'insert into test_order values( :n, :str , :dt ) ' using v_cl_itab(i), v_cl_vtab (i), v_cl_dtab (i);
commit;
end; -
Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency
I need to insert multiple rows into a database table using the JDBC adapter (receiver).
I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?Hi Bhavesh/Kanwaljit,
If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
Why i am saying this?
If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
<i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
Doesnt this mean that rows are inserted one by one?
Correct me if i am wrong.
This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
Regards,
Sumit -
Inserting multiple rows into a table (using sequences)
Hi!
I want to insert multiple rows into a db table, but I don't know how.
I know how to insert 1 row using a sequence:
I put all the fields in the jsp form's page and in the submit page I put something like this:
<jbo:Row id="myRow" datasource="ds" action="Update" rowkeyparam="MyRowKey" >
<jbo:SetAttribute dataitem="*" />
</jbo:Row>
But how can I insert multiple rows like this:
Id Name
1 ana
2 monteiro
3 maria
Thanks!Hi Chris,
I think this should give you what you need: Working with a Multiple Select List Item
--Jennifer -
Insert Multiple rows into the table from that table data
Hi All,
I have a requirement like to insert mulitple rows into the table from that table data only(I need to replicate the data).
In this table primary key is composite primary key with all foreign keys.primary key also including the Date foreign key.I need to change that date at the of insertion.
INSERT
INTO myschema.Fact_page_performance
time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available ,
date_sk
VALUES
(SELECT time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available
FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
WHERE date_sk=20090509,20090510
But it is giving the error like missing Expression.
Could anyone please help to me.
Thanks and Regards
Swetha.You can have either VALUES or SELECT not both
INSERT
INTO myschema.Fact_page_performance
time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available ,
date_sk
SELECT time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available
FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
WHERE date_sk=20090509,20090510; -
Inserting Multiple Rows into a Table
I am having problems insert multiple rows. I am using Table1.Row1.instanceManger.addInstance(1).
I try adding another line using
Table1.Row2.Cell2.value.#text= "TEST"
and I get an error acessor is unknown. I assume this is an index issue. Can someone tell me if I am doing this wrong and discuss table indexes?The first thing I notice is that your variable, "num," isn't initialized in the FOR loop like I'm used to seeing.. The next thing I would try would be declaring my variables outside of the loop. Something like this maybe.
String query = null;
Statement stmt = null;
int rowsUpdated = 0;
for (int num = 0; num < 10; num++); {
query = "INSERT into apartment (apartmentID,blockID) VALUES ('"+num+"','"+aid+"')";
stmt = con.createStatement();
rowsUpdated += stmt.executeUpdate(query);
}Let me know how it goes.
-Aaron
http://www.WeKnowErrors.com/ A free Wiki for error codes and computer problems. -
Inserting multiple rows into a table using a multiple-select list
I'm trying to figure out how to take the output of a multiple-select list (":" separated list of values) and use that to update a table by inserting multiple rows based on the values. Is there a straight-forward way to do that in APEX?
Thanks.
ChrisHi Chris,
I think this should give you what you need: Working with a Multiple Select List Item
--Jennifer -
Inserting multiple rows into database table
hi
I have a simple jsp/html page like this:
<h1>Enter Comments</h1>
<select name = "g1">
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
<option>60</option>
<option>70</option>
<option>80</option>
<option>90</option>
<option>100</option>
</select> <input name = "comment1" type = "text" size = "60"><p>
<select name = "g1">
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
<option>60</option>
<option>70</option>
<option>80</option>
<option>90</option>
<option>100</option>
</select> <input name = "comment1" type = "text" size = "60"><p>but when i say : String fruit=request.getParameter("g1");
String fruit=request.getParameter("comment1");
only one gets written into the table. How would I write them both into seperate rows of the table? e.g.
g1 comment1
g1 comment1
thank you all,change the name of the second select and second text element.
You're only getting one because they're named the same, so the second one is overwriting the values of the first.
HTH. -
Insert multiple rows into a same table from a single record
Hi All,
I need to insert multiple rows into a same table from a single record. Here is what I am trying to do and I need your expertise. I am using Oracle 11g
DataFile
1,"1001,2001,3001,4001"
2,"1002,2002,3002,4002"
The data needs to be loaded as
Field1 Field2
1 1001
1 2001
1 3001
1 4001
2 1002
2 2002
2 3002
2 4002
ThanksYou could use SQL*Loader to load the data into a staging table with a varray column, then use a SQL insert statement to distribute it to the destination table, as demonstrated below.
SCOTT@orcl> host type test.dat
1,"1001,2001,3001,4001"
2,"1002,2002,3002,4002"
SCOTT@orcl> host type test.ctl
load data
infile test.dat
into table staging
fields terminated by ','
( field1
, numbers varray enclosed by '"' and '"' (x))
SCOTT@orcl> create table staging
2 (field1 number,
3 numbers sys.odcinumberlist)
4 /
Table created.
SCOTT@orcl> host sqlldr scott/tiger control=test.ctl log=test.log
SQL*Loader: Release 11.2.0.1.0 - Production on Wed Dec 18 21:48:09 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Commit point reached - logical record count 2
SCOTT@orcl> column numbers format a60
SCOTT@orcl> select * from staging
2 /
FIELD1 NUMBERS
1 ODCINUMBERLIST(1001, 2001, 3001, 4001)
2 ODCINUMBERLIST(1002, 2002, 3002, 4002)
2 rows selected.
SCOTT@orcl> create table destination
2 (field1 number,
3 field2 number)
4 /
Table created.
SCOTT@orcl> insert into destination
2 select s.field1, t.column_value
3 from staging s, table (s.numbers) t
4 /
8 rows created.
SCOTT@orcl> select * from destination
2 /
FIELD1 FIELD2
1 1001
1 2001
1 3001
1 4001
2 1002
2 2002
2 3002
2 4002
8 rows selected. -
Insert multiple rows into table
Hi,
I want to insert into multiple rows into a table,say 1m rows.
Can somebody help me out...
Thanksrp0428 wrote:
>
ALTER TABLE t1 NOLOGGING;
insert /*+ append */ into t1 select col1, col2, col3 from source_table;
alter table test_table logging;
>
It's usually standard practice that if you set a table (e.g. 't1' in your example) to NOLOGGING then you should set the same table back to LOGGING after the insert. Setting table 'test_table' to LOGGING isn't really what you intended is it? ;)Ohh yes, It was a Typo. I am so accustomed to Test_table on OTN that I forgot, I had actually used the table T1 in demonstration.
I meant as below
ALTER TABLE t1 NOLOGGING;
insert /*+ append */ into t1 select col1, col2, col3 from source_table;
alter table t1 logging;Thanks for correcting me :) -
Insert multiple records into a table(Oracle 9i) from a single PHP statement
How can I insert multiple records into a table(Oracle 9i) from a single PHP statement?
From what all I've found, the statement below would work if I were using MySQL:
insert into scen
(indx,share,expire,pitch,curve,surface,call)
values
(81202, 28, 171, .27, 0, 0, 'C' ),
(81204, 28, 501, .25, 0, 0, 'C' ),
(81203, 17, 35, .222, 0, 0, 'C' ),
(81202, 28, 171, .27, 2, 0, 'C' ),
(81204, 28, 501, .20, 0, 1, 'C' ),
(81203, 28, 135, .22, 1, 0, 'C' )
The amount of records varies into the multiple-dozens. My aim is to utilize the power of Oracle while avoiding the i/o of dozens of single-record inserts.
Thank you,
WillYou could look at the INSERT ALL statement found in the documentation here:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_913a.htm#2133161
My personal opinion is that you probably won't see any benefit because under the hood I think Oracle will still be doing single row inserts. I could be wrong though.
The only way to confirm was if you did a test of multiple inserts vs an INSERT ALL, that is if the INSERT ALL met your requirements.
HTH. -
Error inserting a row into a table with identity column using cfgrid on change
I got an error on trying to insert a row into a table with identity column using cfgrid on change see below
also i would like to use cfstoreproc instead of cfquery but which argument i need to pass and how to use it usually i use stored procedure
update table (xxx,xxx,xxx)
values (uu,uuu,uu)
My component
<!--- Edit a Media Type --->
<cffunction name="cfn_MediaType_Update" access="remote">
<cfargument name="gridaction" type="string" required="yes">
<cfargument name="gridrow" type="struct" required="yes">
<cfargument name="gridchanged" type="struct" required="yes">
<!--- Local variables --->
<cfset var colname="">
<cfset var value="">
<!--- Process gridaction --->
<cfswitch expression="#ARGUMENTS.gridaction#">
<!--- Process updates --->
<cfcase value="U">
<!--- Get column name and value --->
<cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
<cfset value=ARGUMENTS.gridchanged[colname]>
<!--- Perform actual update --->
<cfquery datasource="#application.dsn#">
UPDATE SP.MediaType
SET #colname# = '#value#'
WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
</cfquery>
</cfcase>
<!--- Process deletes --->
<cfcase value="D">
<!--- Perform actual delete --->
<cfquery datasource="#application.dsn#">
update SP.MediaType
set Deleted=1
WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
</cfquery>
</cfcase>
<cfcase value="I">
<!--- Get column name and value --->
<cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
<cfset value=ARGUMENTS.gridchanged[colname]>
<!--- Perform actual update --->
<cfquery datasource="#application.dsn#">
insert into SP.MediaType (#colname#)
Values ('#value#')
</cfquery>
</cfcase>
</cfswitch>
</cffunction>
my table
mediatype:
mediatypeid primary key,identity
mediatypename
my code is
<cfform method="post" name="GridExampleForm">
<cfgrid format="html" name="grid_Tables2" pagesize="3" selectmode="edit" width="800px"
delete="yes"
insert="yes"
bind="cfc:sp3.testing.MediaType.cfn_MediaType_All
({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
onchange="cfc:sp3.testing.MediaType.cfn_MediaType_Update({cfgridaction},
{cfgridrow},
{cfgridchanged})">
<cfgridcolumn name="MediaTypeID" header="ID" display="no"/>
<cfgridcolumn name="MediaTypeName" header="Media Type" />
</cfgrid>
</cfform>
on insert I get the following error message ajax logging error message
http: Error invoking xxxxxxx/MediaType.cfc : Element '' is undefined in a CFML structure referenced as part of an expression.
{"gridaction":"I","gridrow":{"MEDIATYPEID":"","MEDIATYPENAME":"uuuuuu","CFGRIDROWINDEX":4} ,"gridchanged":{}}
ThanksIs this with the Travel database or another database?
If it's another database then make sure your columns
allow nulls. To check this in the Server Navigator, expand
your DataSource down to the column.
Select the column and view the Is Nullable property
in the Property Sheet
If still no luck, check out a tutorial, like Performing Inserts, ...
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
John -
Inserting Multiple Rows in a table
Hello,
I need to insert multiple rows in a table with the selected items from a list (Multiple select).
How do i go about it. I'm using ADF-struts-UIX application on Jdeveloper 9.0.5.2
Thanks.Jonas, I've downloaded the sample application from your ADF UIX Editable table tip but have some problems.
I can't even open the emp.table.uix file - errors are:
Parsing error. Unable to parse binding.
javax.servlet.jst.el.ELException:Function ctrl:createSortableHeaderModel was not found.
and
javax.servlet.jst.el.ELException:Function ctrl:getSortOrder was not found.
Also - is there a place in the sample where you define the sample tables? They do not seem to match the standard sample emp table, for instance.
I've just started using JDeveloper and would like to use the solution.
Thanks - Linda -
Inserting multiple rows in child table
i have two entity beans (main and child) with relationship one to many .... when i insert one row in main table (ie when i make one object for main entity bean)... how to insert multiple rows in child table...
Can anyone pls provide some sample code for the above.. how to pass a collection and populate it in the child table.
1.Where to pass the collection, to the childbean directly or to the parent bean and then itereate to the collectio and create child bean.
Much obliged if you could paste some code for the above.. -
Inserting multiple checkboxes into a table cell
Hi all, new to Livecycle so I could use a little advice.
I'm trying to insert multiple checkboxes into a single table cell, but as far as I can tell that seems impossible as one checkbox fills the entire cell. Now how do I go about splitting the table cell into 2 rows so that I can insert both of the checkboxes?
I've also got to add a button to create new rows for the table on click so I don't know if that will factor into the answer.
| Header | Header2 | Header3 |
| | |__________________|
| | | |
I hope this crappy ascii drawing comes out right, but that's what I need to happen.
Thanks!Hi Chris,
I think this should give you what you need: Working with a Multiple Select List Item
--Jennifer
Maybe you are looking for
-
Commision agent Payment.
Sir(s) please help me in bellow issue My client is selling few of their finish products through agents and paying commission to them. This commission calculations and payment is handled manually as of now. We have to handle this through system by us
-
Insert 600 variable values in pop up filter of a web query
Hello all, in order to analyze some Material movements I have to insert 600 material numbers in the selction of a query. In Bex Analyzer I can copy and paste the variable in the variable pop up screen. But when I execute the query in web the filter p
-
after updating to ios 7.1.1, my camera doesn't focus anymore. pictures are blurry. what do i do? can anyone help me with this?
-
Declaring variables or constants at the start of a class
Hi, I have a question. I am in an introductory java course and my instructor says that anything that is declared outside of a method (ie. very beginning of a class) must be a final constant. She says that I must use public static final int EXAMPLE_CO
-
TRIGGER FOR BATCHING NOT FIRING, How can we debug
We're on latest patch MLR#2 on 10.1.2.3, this only happens in one instance, is there a way to check if the event is getting fired or not Thanks, Kalyan