‎2007 Jun 27 1:53 PM
Hi all,
I have created a ztable .also i created an internal table with the same structure as ztable.I have some data in internal table.how to load these data from internal table into database table.how thre insert statement will be.
‎2007 Jun 27 1:55 PM
‎2007 Jun 27 1:56 PM
If the table is empty, then use
INSERT ZTABLE FROM TABLE ITAB
if u have some data in table , then use
MODIFY ZTABLE FROM TABLE ITAB
‎2007 Jun 27 1:57 PM
Hi,
If u want to create new entry u can use INSERT Command , for updating existing record use UPDATE command.
But One more command called MODIFY is there which will take care of both insert and update based on key fields.
Reward points if input is usefull.
Regards,
A.Thuyavan.
‎2007 Jun 27 1:58 PM
hi,
u can use INSERT or INSERT LINES OF statement depening on your requirement as
ex: INSERT MARA[database table] FROM TABLE itmara [ uinternal table]
INSERT LINES OF MARA[database table] FROM TABLE itmara [ uinternal table]
if helpful reward some points.
with regards,
Suresh.A
‎2007 Jun 27 2:00 PM
use
MODIFY ZTABLE FROM TABLE ITAB
as if when a record exists it will modify the database entry and if no record exists it will insert the data into the database.
‎2007 Jun 27 2:00 PM
Hi,
Check whether entries are there in the internal table. Also check for the structure.
MODIFY dbtab FROM TABLE itab.
UPDATE dbtab FROM TABLE itab.
just read this.
If you just want to write (INSERT) 1.5 million rows of an internal table into a database table, use:
INSERT <table name> FROM TABLE <itab>.
Transaction Log Size could be a problem, therefore writing in packages could help, but this depends on your row size, your database configuration and on the current changes to your database. May be it runs in one package, if the rows are small (few bytes) then one package will be the fastest but you'll not much faster than with reasonable packages (3-20 MBytes). On Oracle with rollback segments you will probably have no problems at 1.5 million rows.
<b>Rewrad points</b>
Regards
‎2007 Jun 27 2:03 PM
HI Hemavathi
Go through this example:
-
TABLES spfli.
DATA wa TYPE spfli.
wa-carrid = 'LH'.
wa-cityfrom = 'WASHINGTON'.
...
INSERT INTO spfli VALUES wa.
wa-carrid = 'UA'.
wa-cityfrom = 'LONDON'.
...
INSERT spfli FROM wa.
spfli-carrid = 'LH'.
spfli-cityfrom = 'BERLIN'.
...
INSERT spfli.
-
Thanx
Adhir.
‎2007 Jun 27 2:11 PM
see following links
itab_zgseg-docno = ge_no.
insert into znor values ITAB_znor.
insert into zgseg values itab_zgseg.
Modify should be used instead of insert
MODIFY statement will AUTOMATICALLY
insert/update the records
based upon the primary key combination value
found/ not found in database.