Inserting multiple records in a table through detail block
hi,
i am new to oracle forms. i want to enter more than one records in a table through a master detail forms.
the records will be entered by user in the detail section. can any ody help me?
Hi Lance,
Try creating records in detail block in the when new block instance trigger of
detail block. Set the validation unit property of the form to FORM before trying this.
Hope this might be helpful to you.
V.Senthil Kumar
Similar Messages
-
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. -
Inserting Multiple Records into two table
I want to insert records from a ADF swing form into two tables. In the first table the primary key is generated by a trigger and then I need to retrieve the primary id generated and then insert multiple records in another table using the primarykey obtained from the first table as foreign key.
How to do this ?User,
If you're using ADF Business components, have a read on the DBSequence data type. If you have two VO's linked by a view link, and the FK is a DBSequence type, all this happens for you out-of-the-box.
Hope this helps,
john -
Insert a record into a table through email in an Oracle APEX application
I developed an Oracle APEX application, there is a table called events. I can insert/update/delete a record in the table through browser. I am thinking in order to quickly do the data entry, user should be able to send an email, then the table should be inserted with values from email address, timestamp, subject and body. Anyd idea how to realize this functionality?
- DenisStart by checking whether your mail server provides any API's for accessing emails , if it does you might be able to reduce a lot of work by using some kind of web service consumer from apex to your mail server. In any case your implementation is going to be dependent on your Mail Server configuration.
Your problem breaks down to reading/accessing mails from the mail server from PLSQL (apex is driven by PLSQL).
I found this other thread which could be of some use.
WAY TO ACCESS A MAIL SERVER FROM ORACLE APEX
<li>The following package might solve your problem directly(from carsten czarski of the German Apex community)
[url http://plsqlmailclient.sourceforge.net]http://plsqlmailclient.sourceforge.net
PS: POP3 support is still TBD.
<li>I also found this posting in the orafaq forums which lists a java method and PLSQL code bit for it for accessing emails via POP3
[url http://www.orafaq.com/forum/t/80928/2/]http://www.orafaq.com/forum/t/80928/2/
If these do not work for you, find some java library to read mail from your server, write a PLSQL wrapper for it and use it in a scheduled job(DBMS_JOB)/a PLSQL block triggered from Apex.
If you get stuck there, find some utility that can read mails, invoke them from your DB using java,shell scrpt,dbms_scheduler etc and use the utility's function for the rest.
NOTE: I haven't tried any of these utilities and you must validate any java code before running them on your environment.
Since aren't really much restrictions(other than spam checks) in sending a mail to your mail account, you might want to consider filtering out the mails from which you create records. -
Inserting Multiple Records in Transparent Table
Hi Friends,
I am New to ABAP and Previously i was in Web Dynpro Java....
I am doing an scenario Travel Request.
The Problem i am facing i this scenario is inserting the data in the table. I have to maintain a custom table in which Travel request No (Primary Key), Employee No (Primary Key) and Transport Details.....etc.are maitained...
Employee Number -
Travel Request No--Place From-Place To
70043 -
817--Chicago--
Miami
70043 -
817--Miami--
Chicago
I have to maintain table like this
Whenever i inseted the data into the Tranparent Table its showing dump and sy-subrc count is 4
Plz provide suggestion to achieve this........Thanks in Advance
Regards
Chandran SIn ur case u r trying to enter duplicate values that's why u r getting error.
In ur custom table, Employee Number and Travel Request No are 2 primary keys. That means for each record content of these fields should be unique but in ur case they are same. If u really need to maintain data in this way then u have to make another field as key field so that it can uniquely identify a record.
Employee Number Travel Request No Place From Place To
70043 817 Chicago Miami
70043 817 Miami Chicago
Regards,
Joy. -
How to get multiple records from internal table through BDC
PERFORM DYNPRO USING:
'X' 'SAPMM61L' '0500',
' ' 'BDC_OKCODE' '=NEWC',
'X' 'SAPMM61L' '0500',
' ' 'BDC_CURSOR' 'PLPTU-PLWRK(01)',
' ' 'BDC_OKCODE' '=TAKE',
' ' 'PLPTU-PLWRK(01)' '2531'. (2531 is a plant)
This is the recording used to get plant via BDC of MS31.
Using this code i can get only single plant...
If i want to get multiple plants from an internal table,how i can change this code?
Since it is a recording i cant put this code in LOOP..ENDLOOP.
Suggest any method for doing this....
Awaiting for ur reply...Hi,
While recording also record the scroll down button.
The you can place different plant in the BDC using loop and endloop
Regards
Arun -
How to insert multiple records in DB table
HI Experts,
Jdev 11.1.2.3
I have requirement where my form belongs to two different tables (TableA and TableB).
In this form am using ADF shuttle component. The number of values i select in shuttle component same number of records to be inserted in TableB with each value.
on commit TableA and TableB both should be commited.
Thanks,
NiteshHi,
You can use a managed bean as the target of the value property of the shuttle component. Then in a value change listener you read the selected values and manually update the model. For this you could e.g. expose two view objects (one for each table) as an iterator to the PageDef file, access it from Java and then call dcIteratorBindingInstance.getRowSet().createRow() to create and populate new rows
The above is a bit rough in the outline, but so is the question
Frank -
How to insert multiple records into a table?
hi all
i have a table that name is : TiketsItem
now i want to 100 records insert my table
for example : TicketsHeaderRef=52000
Active=False
TicketsItemId=45000 to 45100
how to insert TicketsItemId 45000 to 45100 in my table
thanks all
Name of Allah, Most Gracious, Most Merciful and He created the humanSo, you just want to insert the serialized data into the table, without useDate or WKRef? I'm assuming these values will be updated later?
Try something like this:
DECLARE @TicketsHeader TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
DECLARE @startInt BIGINT = 45000
WHILE @startInt <= 45100
BEGIN
INSERT INTO @TicketsHeader (TicketsItemID, ticketsHeaderRef, active)
VALUES (52000, @startInt, 0)
SET @startInt = @startInt + 1
END
SELECT *
FROM @TicketsHeader
thanks
i edited your codes:
DECLARE @TicketsItem TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
DECLARE @startInt BIGINT = 45000
WHILE @startInt <= 45100
BEGIN
INSERT INTO @TicketsItem (TicketsItemID, ticketsHeaderRef, active)
VALUES (@startInt,52000 , 0)
SET @startInt = @startInt + 1
END
when i execute:
SELECT * FROM TiketsItem
i do not see any records inserted in TiketsItem
how to solve it?
Name of Allah, Most Gracious, Most Merciful and He created the human -
Inserting multiple records into a database from a table
I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess)
table name: Table1 ( in my form )
Database table : movies_comments ( as posted in stefan's forums ).
table columns: username, movieid, comments
i am using the following code.
Database.ExecSQL() function is as posted in stefcamerons forums.
var tlength = xfa.resolveNode("form1.#subform[0].Table1.Row1[*]").length;
xfa.host.messageBox("tlength is :" +tlength);
for ( var i = 1; i <= tlength; i++)
var username = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].user_name").rawValue;
var movieID = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].movie_id").rawValue;
var commentS = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].comment_").rawValue;
Database.ExecSQL("INSERT INTO movie_comments (username, movieId, comment) VALUES ('username','movieID', 'commentS');");
i am trying to insert multiple records using the code above. But i am getting error
GeneralError: Operation failed.
XFAObject.resolveNode:1:XFA:form1[0]:#subform[0]:Button1[0]:click
SOM expression returned list when single result was expected
suggest me an alternate way to insert multiple records from a table into a database.
thank Qfigured it out. I changed the ...OR (alternative names = colname) in the recordset to ...OR (alternative names LIKE %colname%). Works like a charm now- the result of a good night's sleep.
-
ORA-01654 error message when inserting multiple records
Hello all,
I have a Test table with attributes TEST_ID, TEST_NAME, TEST_DATE, STATUS, and want to insert multiple records into this table based on user input form. If user select a value from the drop down list, and the number of records to insert into the Test table, the application should insert that many into the Test table with the same TEST_DATE, STATUS, but TEST_NAME should be the drop down list value + i (1....the number of inserted records). I manually created the form, and wrote a sql for the process.
For example if the user select MUSIC, 3 then data should look like this
TEST_ID TEST_NAME TEST_DATE STATUS
1 MUSIC1 04/06/2010 Y
2 MUSIC2 04/06/2010 Y
3 MUSIC3 04/06/2010 Y
I got the error ORA-01654: unable to extend index TEST_TOOL_ID.TEST_PK by 128 in table space FLOW_13120862905990037739.
The process query
DECLARE IDTEST NUMBER := 1;
BEGIN
WHILE (IDTEST < :P1_COUNT + 1) LOOP
INSERT INTO TEST ( TEST_NAME, TEST_DATE, STATUS )
VALUES ((:P1_TEST_NAME || ' ' ||IDTEST), SYSDATE, 'Y');
END LOOP;
END;
Here is the link to this application
http://apex.oracle.com/pls/apex/f?p=4000:1:3173416575551580::NO:RP:FB_FLOW_ID,F4000_P1_FLOW:32828,32828
Any help would be appreciated.
Thanks,
KarolineThis is the output i get when i change the getMessage with printStackTrace.
String getMessage() replaced with printStackTrace:
G:\studies\Chapter11\MakeDB.java:33: 'void' type not allowed here
System.out.println("Could not drop primary key on UserStocks table: "
^
G:\studies\Chapter11\MakeDB.java:43: 'void' type not allowed here
System.out.println("Could not drop UserStocks table: "
^
G:\studies\Chapter11\MakeDB.java:54: 'void' type not allowed here
System.out.println("Could not drop Users table: "
^
G:\studies\Chapter11\MakeDB.java:64: 'void' type not allowed here
System.out.println("Could not drop Stocks table: "
^
G:\studies\Chapter11\MakeDB.java:83: 'void' type not allowed here
System.out.println("Exception creating Stocks table: "
^
G:\studies\Chapter11\MakeDB.java:102: 'void' type not allowed here
System.out.println("Exception creating Users table: "
^
G:\studies\Chapter11\MakeDB.java:119: 'void' type not allowed here
System.out.println("Exception creating UserStocks table: "
^
G:\studies\Chapter11\MakeDB.java:133: 'void' type not allowed here
System.out.println("Exception creating UserStocks index: "
^
G:\studies\Chapter11\MakeDB.java:159: 'void' type not allowed here
System.out.println("Exception inserting user: "
^
9 errors
Tool completed with exit code 1 -
Insert multiple records into database through internal table
Hi
please help me how to insert multiple records into database through internal tableHi,
Welcome to SCN.
Press F1 on INSERT statement and you will teh syntax as well the docu for the same. -
Inserting multiple records in to database table using webdynpro abap
Hi all,
I have created a username inputfield,a button and a table
with one coloumn.
If i enter names in the input field then the values should be
displayed in that table.
Even i have got the answer i am not able to insert
the values in to database(ztable) table.
i.e. only one value(1st) was inserted the second value was
not inserted ....
so kindly send me the coding to insert multiple records
into the database table......
by,
ranjithhi Ranjith,
If you want to insert multiple records from the webdynpro view table to database table then try the following code.
DATA lo_nd_tablenode TYPE REF TO if_wd_context_node.
DATA lo_el_tablenode TYPE REF TO if_wd_context_element.
DATA ls_tablenode TYPE wd_this->element_tablenode.
DATA it_tablenode LIKE STANDARD TABLE OF ls_tablenode.
navigate from <CONTEXT> to <tablenode> via lead selection
lo_nd_tablenode = wd_context->get_child_node( name = wd_this->wdctx_tablenode ).
get element via lead selection
lo_el_tablenode = lo_nd_tablenode->get_element( ).
get all declared attributes
lo_nd_tablenode->get_static_attributes_table(
IMPORTING
table = it_tablenode ).
MODIFY databasetablename FROM TABLE it_tablenode.
here it_tablenode is the internal table which holds the value from webdynpro view..
Regards,
Shamila. -
Insert Multiple records in single form
Hi all,
I have already come across inserting multiple rows into a table using ADF BC. The solution to this is in the following thread
Re: How to create multiple new rows in ADF Table?
However,
The above solution is useful when we want to enter new values along with all the table entries getting displayed.
What can I do If I dont want all the table values but just an 'AddEntries' page where I can only add new rows without having the entries in table getting displayed.
Like,
Say, a form has 5 rows
Each row has empId, eMailSlNo ,eMail attributes
EmpId is same for all 5 records but emailId is different.
EmpId and eMailSlNo make the PK.
empId generated using sequence.
Now on submitting the form, I want all five records to be inserted.
(can i use ADF form instead of ADF table for the ViewObject in this case. I tried ADF form but i could only insert 1 record at a time).
I'm using 10.1.3.4
Please help.
Thanks in advance,
Shri
Edited by: newtoOTN on Dec 29, 2009 6:02 PMHi Shri,
ADF Form is meant for single insert/update. For multiple insert/update/delete using collection UI like table is preferred. I guess that either your db table or the UI table design has flaw (In my opinion but i don't know your usecase fully, so my guess might b wrong).
I would suggest,
- make EmpId as PK
- have another table to store EmpId(foreign key),emailSiNo, email
- Have master-detail relationship between both the db tables in ADF BC.
- Create master-detail table UI and on selection of master, display detail and if no records found add records and commit.
check these examples:
http://www.oracle.com/technology/products/jdev/tips/mills/MasterDetailSync/Master_Detail_Synchronization_in_ADF_Faces.html
http://andrejusb.blogspot.com/2007/06/create-edit-and-delete-operations-in.html
Hope this makes sense.
~K -
Triggers to insert the record in a table
I have two table 1. Holiday 2. Attendance.
When I insert the record in holiday table for his
advance holiday with empid, the same time I want to insert it attendance table
automatically for the same date using a trigger
Insert into attendance (empid,date,holiday) values (20078,07/10/2014,1). If holiday column value 1 represent holiday marked,
0 represent holiday not marked. The same thing can happen vice versa
If employee mark his current attendance as holiday through attendance,
it should be inserted into holiday table
automatically using triggers.
Insert into Holiday (empid,date,holiday) values (20078,06/08/2014,1). If holiday column value 1 represent holiday marked,
0 represent holiday not marked. The same thing can happen vice versa
Please I am looking for your help , how I can make it using triggers
to insert both table in two different ways of options.
Regards
Pol
polachanHi polachan,
According to your description, if you want to synchronize the data between the holiday table and the attendance table while inserting records into holiday table, you need to create a trigger on the holiday table, please try the following syntax.
use <databasename>
go
create trigger Tr_holiday
on holiday
for insert
as
declare @empid varchar(20),
@date datetime,
@holiday int
select @empid = empid, @date=date, @holiday=holiday from inserted
declare @qty int
select @qty =count(*) from attendance where empid=@empid and date=@date and holiday=@holiday
if @qty<1
begin
insert into attendance
select i.empid,
i.date,
i.holiday
from inserted i
end
Meanwhile, if you want to insert the record into the holiday table when holiday is updated to 1 in the attendance table, you need to create another trigger on the attendance table, please try the following syntax.
use <databasename>
go
create trigger Tr_attendance
on attendance
for update
as
declare @holiday int
if update (holiday)
begin
select @holiday=holiday from inserted
if @holiday=1
begin
insert into dbo.holiday
select empid,
date,
holiday
from inserted
end
end
For more details about creating triggers in SQL Server, please review this article:
CREATE TRIGGER (Transact-SQL).
Thanks,
Lydia Zhang -
Abort inserting a record in a table using a trigger
Hi there,
Is there any way to abort inserting a record in a table using a trigger?
For full details, I have the following table ("myTable"):
BSC INTEGER NOT NULL,
BTS VARCHAR2(20) NOT NULL,
INFO1 INTEGER,
INFO2 INTEGER
myTable_PK = PRIMARY KEY (BSC,BTS)
I have also a stored procedure that imports a data from text file and inserts them to the specified table (using UTL_FILE package). The stored procedure works great.
But the thing that in the text file itselft it might be (due to third-parity report generation bug) that the primary key will be violated or the BSC/BTS field has null value. In such case I just want to ignore the insertion statement using a trigger.
ThanksOk Jens, could you tell me what exception could I use?
Below a protion of my StoredProcedure.
CREATE OR REPLACE PROCEDURE update_myTable() IS
FHANDLE UTL_FILE.FILE_TYPE;
BSC INTEGER;
BTS VARCHAR2(20);
INFO1 INTEGER;
INFO2 INTEGER;
BEGIN
FHANDLE := UTL_FILE.FOPEN('LOG_FILE_DIR',FILENAME,'R',4000);
LOOP
UTL_FILE.GET_LINE(FHANDLE,STR);
-- Process the line STR and generates BSC, BTS, INFO1, and INFO2 values
EXECUTE IMMEDIATE 'INSERT INTO myTable VALUES(:1,:2,:3,:4)' USING BSC,BTS,INFO1,INFO2;
END LOOP;
EXCEPTION WHEN NO_DATA_FOUND THEN UTL_FILE.FCLOSE(FHANDLE);
END UPDATE_R205BTS;
Remember that I am already using an exception with NO_DATA_FOUND to indicate the end of file then closing it.
Thanks for your reply
Maybe you are looking for
-
Printing Wireless remote to HP Pho. c4280 from XP through new Win 7 HP laptop
When I hoooked up my brand new DV7 6c63 nr laptop to the USB connection, it printed right away. I have added the Windows 7 drivers. But I cannot figure out how to get my older Dell laptop (Windows XP) to print remotely through the network. (worked
-
I am using a Canon MP530 to print my photos from IPhoto. All my blacks have purple in them. The Canon staff worked with me and it is not the printer, as when I print from Photo Elements, it doesn't happen. Does anyone have any suggestions?
-
Hi All, Im trying to see a web report in BW and this is the error im getting, can someone tell me how to solve this. Service cannot be reached What has happened? URL http://sapides.ad.infosys.com:8000/sap/bw/BEx call was terminated because the corres
-
Notification Center isn't pulling down
Hi, I have a problem with my iPhone 3GS running iOS 5.1.1 which is Notification Center isn't pulling down. My screen is fine as it is all responsive everywhere I touch Do I need to do a restore? Ive tried turning it off and on and putting it into D
-
Entourage is verifying and wanting to rebuild my database?
Entourage says it can't find my database, is verifying and wants to rebuild my database. Is this okay?