Reputation:
I use Quest TOAD for Oracle and Quest SQL Navigator for Oracle as my database query tools of choice.
These tools allow me to export the query results grid as INSERT statements.
For example
SELECT dummy
FROM dual;
exports to
INSERT INTO dual
(DUMMY)
VALUES
('X')
/
Is there an Oracle database query tool that exports query results as UPDATE statements?
For example
SELECT dummy
FROM dual;
would export to
UPDATE dual
SET dummy = 'X'
/
Upvotes: 2
Views: 3212
Reputation: 1
You can export the Insert query first, insert into a backup table. Then update the target table with the backup table with PK.
UPDATE (SELECT tr.id,
tr.name a,
tr.desc b,
bk.name A,
bk.desc B
FROM target tr,
backup bk
WHERE tr.id = bk.id)
SET a = A,
b = B
Upvotes: 0
Reputation: 51603
I don't know if there are other tools (wasn't able to find one, to be precise).
What I used to do for this to export the data as CSV
, then hack a quick awk
script to generate the desired UPDATE
s.
Upvotes: 0