View previous topic :: View next topic
|
Author |
Message |
jagankallis Warnings : 1 New User
Joined: 28 Jun 2006 Posts: 29 Location: DUISBURG
|
|
|
|
Dear All,
I want to . Please give me enough sample examples for this scenario.
Thanks a lot in advance for your co-operation |
|
Back to top |
|
|
Gautam512
Active User
Joined: 05 Oct 2005 Posts: 308 Location: Vizag / US
|
|
|
|
hi,
there are so many ways , but one way which is a bit simple is:
u can get the details from the other table first and copy them into the host variables for the insertion of data. |
|
Back to top |
|
|
Muthukumar.PLindia
New User
Joined: 03 Jul 2006 Posts: 51 Location: Chennai
|
|
|
|
If both of the tables are in same system, You can try inserting a row like this
Insert into table1 (select * (or) field1, field2 from table2)
If you want to update the existing rows from the values taken into other table, then i dint tried this type of query..... let me check it any info you |
|
Back to top |
|
|
jagankallis Warnings : 1 New User
Joined: 28 Jun 2006 Posts: 29 Location: DUISBURG
|
|
|
|
Dear All,
I explain in more details manner my requirement
Please find the below query
SELECT RKT_ID,RKT.GES_SALDO, XVIEW.GES_SALDO,XVIEW.CODE,
DATE(XVIEW.UMS_TS),XVIEW.BETRAG
FROM RKT RKT,
(
SELECT UMS.SYS_ID,UMS.GES_SALDO,UMS.KAP_SALDO,UMS.KST_SALDO,
UMS.ZSS_SALDO,UMS.UMS_TS, UMS.CODE, UMS.BETRAG
FROM UMS
WHERE UMS.UMS_TS IN (SELECT MAX(X.UMS_TS)
FROM UMS X
WHERE X.SYS_ID = UMS.SYS_ID)
) XVIEW
WHERE RKT.RKT_ID = XVIEW.SYS_ID
AND RKT.GES_SALDO <> XVIEW.GES_SALDO
AND DATE(XVIEW.UMS_TS) > '23.08.2006'
ORDER BY RKT_ID
WITH UR
;
Now my requirement is to
update the value XVIEW.GES_SALDO (refer above query resultant) into the UMS.GES_SALDO (UMS table) table for the above criterion.
Please let me know if more information need to be given for explanation. |
|
Back to top |
|
|
jagankallis Warnings : 1 New User
Joined: 28 Jun 2006 Posts: 29 Location: DUISBURG
|
|
|
|
Dear All,
I explain in more details manner my requirement
Please find the below query
SELECT RKT_ID,RKT.GES_SALDO, XVIEW.GES_SALDO,XVIEW.CODE,
DATE(XVIEW.UMS_TS),XVIEW.BETRAG
FROM RKT RKT,
(
SELECT UMS.SYS_ID,UMS.GES_SALDO,UMS.KAP_SALDO,UMS.KST_SALDO,
UMS.ZSS_SALDO,UMS.UMS_TS, UMS.CODE, UMS.BETRAG
FROM UMS
WHERE UMS.UMS_TS IN (SELECT MAX(X.UMS_TS)
FROM UMS X
WHERE X.SYS_ID = UMS.SYS_ID)
) XVIEW
WHERE RKT.RKT_ID = XVIEW.SYS_ID
AND RKT.GES_SALDO <> XVIEW.GES_SALDO
AND DATE(XVIEW.UMS_TS) > '23.08.2006'
ORDER BY RKT_ID
WITH UR
;
Now my requirement is to
update the value XVIEW.GES_SALDO (refer above query resultant) into the UMS.GES_SALDO (UMS table) table when the UMS.SYS_ID = XVIEW.SYS_ID
Please let me know if more information need to be given for explanation. |
|
Back to top |
|
|
|