import a dmp file [message #339777] |
Fri, 08 August 2008 08:02  |
samfuerte
Messages: 7 Registered: May 2008
|
Junior Member |
|
|
Does anyone know how can we make touser parameter in imp as a variable so if the script is run by someone as a part of a patch to be able to declare the user he wants to import the dmp file into?
Is possible something like this?
|
|
|
|
|
|
|
|
|
Re: import a dmp file [message #340580 is a reply to message #340139] |
Wed, 13 August 2008 06:07   |
samfuerte
Messages: 7 Registered: May 2008
|
Junior Member |
|
|
Thanks Michel,
I need to ask one more question. I have created a sql script like this:
clear SCR
prompt
prompt Updating TABLE table
prompt ==========================
prompt
SET ECHO OFF
SET VERIFY OFF
set feedback off
SET serveroutput ON
prompt
prompt
prompt
prompt Checking table ...
prompt
set termout off
DECLARE
v_exist number;
BEGIN
v_exist := -1;
select COUNT(*)
INTO v_exist
FROM TABLE t
WHERE t.columnA='STP';
IF v_exist=0 THEN
............;
else
............;
END IF;
END;
/
COMMIT;
I want in the IF statement to add the sqlldr (HOST sqlldr &&CONN_STRING sam.ctl). Ctl file inserts one row in TABLE table.
Is it possible?
Any idea if and how can I do that?
Thanks in advance.
Sam
|
|
|
Re: import a dmp file [message #340582 is a reply to message #340580] |
Wed, 13 August 2008 06:12  |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Quote: | Ctl file inserts one row in TABLE table.
|
This "one row" is in a file, right? Instead of calling an operating system command (which SQL*Loader, in a way, is) from PL/SQL, wouldn't you, rather, use Oracle's external tables feature?
It would make this task very simple (as you'd use an INSERT INTO ... SELECT ... FROM external_table).
|
|
|