Works Datapump inside the SQL worksheet...
Hi all
"running the following code inside the spreadsheet and he just spits ' anonymous block completed.
*****************************
Set scan off
Set serveroutput on
escape game off
whenever sqlerror exit
DECLARE
number of H1;
errorvarchar varchar2 (100): = "ERROR";
tryGetStatus number: = 0;
Start
H1: = dbms_datapump.open (operation = > 'IMPORT', job_mode = > job_name 'FULL' = > 'IMPORT_JOB_SQLDEV_73', version = > 'COMPATIBLE');
tryGetStatus: = 1;
dbms_datapump.set_parallel (handle = > h1, degree = > 1);
dbms_datapump.add_file (handle = > h1, filename = > 'IMPORTtest2.LOG', directory = > 'DATA_PUMP_DIR', filetype = > 3);
dbms_datapump.set_parameter (handle = > h1, name = > 'KEEP_MASTER', value = > 0);
dbms_datapump.add_file (handle = > h1, filename = > ' ORAEU_COPIED.) (DMP", directory = >"DATA_PUMP_DIR", filetype = > 1);
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\APT_SYS_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/APT_SYS_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\APT_SYS_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/APT_SYS_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_MART_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_MART_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_MART_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_MART_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > UPPER ('C:\ORACLE\ORADATA\ORCL/DATA_STORE_DATA01.) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_STORE_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_STORE_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_STORE_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\RNET2_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/RNET2_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\RNET2_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/RNET2_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_AMA_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_AMA_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATA_AMA_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATA_AMA_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATASERVICES_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATASERVICES_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\DATASERVICES_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/DATASERVICES_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\ARC_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/ARC_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\MCSS_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/MCSS_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\MCSS_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/MCSS_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\IPAS_DATA01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/IPAS_DATA01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\IPAS_IDX01.)) DBF'), value = > SUPERIOR ('/ rdsdbdata/db/ORAEU_A/file/IPAS_IDX01.) DBF'));
dbms_datapump.metadata_remap (manage = > h1, name = > 'REMAP_DATAFILE', old_value = > SUPERIOR ('C:\ORACLE\ORADATA\ORCL\PFIZERCMS_DATA01.)) DBF "), value = >"
dbms_datapump.set_parameter (handle = > h1, name = > 'INCLUDE_METADATA', value = > 1);
dbms_datapump.set_parameter (handle = > h1, name = > 'DATA_ACCESS_METHOD', value = > "AUTOMATIC").
dbms_datapump.set_parameter (handle = > h1, name = > 'REUSE_DATAFILES', value = > 0);
dbms_datapump.set_parameter (handle = > h1, name = > 'TABLE_EXISTS_ACTION', value = > 'REPLACE');
dbms_datapump.set_parameter (handle = > h1, name = > 'SKIP_UNUSABLE_INDEXES', value = > 0);
dbms_datapump. START_JOB (handle = > h1, skip_current = > 0, abort_step = > 0);
dbms_datapump. Detach (handle = > h1);
errorvarchar: = "NO_ERROR"
EXCEPTION
WHILE OTHERS THEN
BEGIN
IF ((errorvarchar = ' ERROR') AND (tryGetStatus = 1)) THEN
DBMS_DATAPUMP. Detach (H1);
END IF;
EXCEPTION
WHILE OTHERS THEN
NULL;
END;
LIFT;
END;
/
*****************
all entries are appreciated
Thank you
Please let me know if you see a code problem
What is your question has to do with Sql Developer?
Unless you can connect you must mark ANSWERED thread and repost it in Sql and Pl/Sql forum
the Japan Government says:
Hi Jeff
I expect that it runs the import at least.
Get this error now on line 66:
EXCEPTION
WHILE OTHERS THEN
BEGIN
IF ((errorvarchar = ' ERROR') AND (tryGetStatus = 1)) THEN
DBMS_DATAPUMP. Detach (H1);
END IF;
EXCEPTION---> line 66
WHILE OTHERS THEN
NULL;
END;
When you repost you should post the EXACT code you use. The code you posted is NOT valid: you must also REMOVE the WHEN of OTHER or you can expect everyone to book you to INTENTIONALLY HIDE any exceptions that occur. Why do you NOT want to know if Oracle finds problems in your code? That makes NO sense at all.
IF ((errorvarchar = ' ERROR') AND (tryGetStatus = 1)) THEN
There is NO SPACE after the "and" what is garbage just as far as Oracle are concerned.
Either you have posted an incorrect code or your code has syntax errors and will not compile or run anyway.
I suggest that correct you your syntax errors before reposting in the Sql forum. If you have pain to find their delete ALL unnecessary code to reduce the problem to the example as SIMPLE as possible, until you find the code causing errors.
Tags: Database
Similar Questions
-
How can I turn off automatic formatting while working in the SQL worksheet?
Friends,
Hope you can help with a quick question.
Is it possible to stop the automatic formatting of SQL statements in the SQL worksheet?
for example, when I type select * double it auto SELECT formats becomes * FROM DUAL when I press return.
I use SQL Developer 2.1.1.64
Thanks in advancePreferences - editor of Code - completion Insight - uncheck change case when typing
Have fun
K. -
How to get line numbers to display on the SQL worksheet?
Dear Forum,
I learn the SQL Developer. I use it in my work and school. At school, when I enter a query in the SQL worksheet, line numbers show in a column to the left of the editing area. In my work, no line number. I'm working on a fairly long query at my work, and the line numbers would be useful.
I looked at tools / preferences / settings for the Code Editor, but do not find a setting for line numbers. I looked at the other tabs in preferences and found nothing that looked useful.
I have looked at all of the choices on the display list, but can't find anything on line numbers.
Am I missing something obvious? Line numbers is also available? If so, how?
I looked at various hits "line number" in this forum, but I've not found anything exactly the point.
Beverly
PS Oracle 11g, SQL Developer 3.0.04, Linux x 86-64 (don't have version)
Tools-> preferences /-> Code Editor-> line gutter
-
How to perform the procedure in the SQL worksheet?
Hi, anyone knows, how I can execute procedure here?
I try to EXEC sec_roles, EXEC security_admin.sec_roles, EXECUTE - there's a SQL statement error. When I use the CALL - there is no such procedure (I have execute privileges).
Although in SQLPlus EXEC works, but there are problems with the standard SQL commands (each of them '2' returns any content is).
Any ideas?
Concerning
KrzysztofEXEC procedure (parameters) is a plu sql (and some others) shortcut for
BEGIN procedure(parameters); END;
So try that and then pressing / on anything in the sql worksheet that makes a statement in execution.
Note that if your procedure has defined parameters as OUT or IN OUT, you need to provide a variable to accept the returned values.
John
-
Monitoring stops working after changing the SQL Service account
I have the Foglight for SQL Server cartridge. I recently changed the service account that is running the SQL Server engine and SQL Server Agent from a local account to a domain account. Everything works fine on the SQL Server side.
No configuration changes have been made on the Foglight end, and none should be necessary Foglight is configured to use a separate service for SQL account both OS level followed. This account has always been in the local "Administrators" Group on the database server, as well as a "sysadmin" on the side of SQL Server server role. If I 'validate connectivity' within Foglight to that server, it shows that the connection is correct. I tried to remove the monitoring officer and recreation, but yet to see errors in the attached screenshot. Has anyone meet a similar problem?
Although I couldn't find any indication that the agents were locked, I tried to release them anyway. That seemed to do the trick!
This can be found here:
Databases-> Dashboard Support-> Support of databases-> release agents
-
Formatting characters in the SQL worksheet in the version 2.1.1.64
Hello
Using the version 2.1.1.64
When I type SQL in the SQL worksheet calculation is to show formatting characters - for example all the spaces display as a light gray and a newline character appears at the end of each line.
Formatting characters displayed not initially when I started to use this version. I don't know how this setting is enabled, but there doesn't seem to be a preferences setting to turn it off. Any ideas?Tools-> preferences-> Code Editor-> display-> Show characters
should take care of your problem.
-
In SQL Developer 1.5.3 seems no "feedback" in the SQL worksheet when you insert, update, and delete records. So I like the timer, it is more important for users to get comments for the UPDATE and DELETE statements; for example, it is essential to know if 0, 1 or 1,000 files have been updated by a particular SQL statement - also for DELETE queries (for example when users forget the WHERE clause, feedback is an important mechanism to realize the error).
Is it possible to turn on your comments? ("set feedback we" seems not be honored). What is this fixed point 1.5.4? Should be presented as a feature request?
Thank you.
Dana
Published by: Dana N on May 18, 2009 05:06Blame poor analytical skills or whatever, but they managed to have 2 reports areas separated from each other.
You've found one of the toolbar in the spreadsheet with the timings of course, but there is also one in the status bar of heads...Have fun
K. -
Preserve Bind values in the SQL worksheet
Hello
When you run the SQL statements with var/binding settings, SQLD can persist values entered the tool reboots?
Is there a preference that controls this?
Java (TM) Platform 1.7.0_71 Oracle IDE 4.0.3.16.84 Support for versioning 4.0.3.16.84 Thank you
Manish
Never mind. Found, he looked at me, but I was blind.
Under the worksheet, check 'Save the Bind Variables on the disc to the output'.
-
End of the characters on the line in the SQL worksheet
Hello
All of a sudden end of characters on the line in the SQL in SQL Developer worksheet.
Can someone please advice how to hide those?
It looks like 2 ' < ' characters followed by a mathematical symbol Pi.
Thank you
SagayTools | Preferences | Code editor | Display | Show the white space characters
-
ToolTips not working not inside the Embedded Movie Clip but works on the main stage
Hey,.
I have a clip which is a browser window, and I try to have some sensitives of the ToolTip on the buttons inside the browser window.
If I create a button on the main stage, it hovers and works very well, but if I create the same clip inside the embedded browser window, the ToolTip is not displayed. I have no error messages, but it is not here that I see.
Any ideas?
Thank you!
Even you place your mc in another clip for example NavWindowMC:
Write code in the maintimeline as
Fl.transitions.easing import. *;
Fl.transitions import. *;NavWindowMC. mc.addEventListener ('mouseOver', mouseRollOver);
NavWindowMC. mc.addEventListener ("mouseout/mouseouthandler()", mouseRollOut);
NavWindowMC. mc.addEventListener ("mouseMove", mouseMove1);var tooltip:Tooltip = new Tooltip();
ToolTip.txt.Text = "Design";
ToolTip.x = stage.mouseX;
ToolTip.y = stage.mouseY - NavWindowMC. MC.height;function mouseRollOver(e:MouseEvent):void {}
addChild (tooltip);
var myTween:Tween = new Tween (Regular.easeIn, 0, 1, 0.5, tooltip, "alpha", true);}
function mouseRollOut(e:MouseEvent):void {}
removeChild (tooltip);
}function mouseMove1(e:MouseEvent):void {}
ToolTip.x = stage.mouseX;
ToolTip.y = stage.mouseY - NavWindowMC. MC.height;
} -
Impossible to delete characters on the SQL worksheet
I am facing a noisy problem with SQL Developer (Versioning Support 1.5.5.59.69)...
Whenever I open a SQL worksheet, I can insert characters but I can't remove them...
What happened!Hello
There is too much of a week, I had problem with strikes in the worksheets. For me has been useful tools-> preferences-> accelerators-> load Preset...
This returned value hit in the normal state.
Petr -
How to display the current time inside the SQL prompt
Hi all;
I want to know how to set the time permanently in the SQL prompt.
I'm running oracle database (10 g) on linux (5.5) machine.
Thanks in advance.
There under the name [g] login.sql file under ... sqlplus\admin (probably X:\xxx\product\11.2.0\client\sqlplus\admin), this file is executed whenever you connect to sqlplus. You may need to place ' set time on "in this file and save.
-
How can I leave echo in the sql worksheet developer sql?
When I generate out of the script from a sql file that is loaded into the spreadsheet sqldeveloper, the statement appears in the output pane before the results of the query. This can occur because there are substitution (for example & site) variables in the query. However, I would really for Nothing of the sql statement displayed in the results - I want to save it as an output file. Is there a way to do this? 'left echo' is not recognized as a valid command.
I know that I can export data in the results pane of query to a text as well as a csv file, etc., but I don't like how it looks - I want the data as described in the output of the script.
Here is a portion of the script... just enough to show "set echo off" and use of the user variable.
Thank you
Carol
set echo off select s.site_id SID,substr(s.site_name,1, 50) SITE, month.start_date_time, sum(decode(sd.datatype_id,111,month.value,null)) EC, sum(decode(sd.datatype_id,1217,month.value,null)) PPM, round(sum(decode(sd.datatype_id,19,month.value,decode(sd.datatype_id,93,month.value,null))),2) CFS, round(sum(decode(sd.datatype_id,1216,month.value,decode(sd.datatype_id,1218,month.value,null))),0) TOTAL_CFS, round(sum(decode(sd.datatype_id,20,month.value,decode(sd.datatype_id,1113,month.value,null))),0) AF from hdb_site s, hdb_site_datatype sd, r_month month, ref_yao_sal_flow_site_map map where map.flow_site_id = &&site
set verify off
can hide variable replacements in sqlplus and sql developer
-
SQLdeveloper export to Excel - how to hide the SQL worksheet for data export
Export to Excel - how to hide SQL worksheet for data export?Hello
SQL Developer forum is here: SQL Developer
Frank
-
Update statement works only inside the function
The logic of this function:
**************************
The system of billing, we will post data to the ERP system once the invoice is processed this function will update the invoice of erp number and treat a flag to the table of billing system.
CREATE OR REPLACE FUNCTION ERP_TO_MOPS_INV_UPD RETURN NUMBER IS
/ * Update function treated invoice status back to the invoice table number * /.
FRETVAL NUMBER: = 0;
BEGIN
FOR I IN (SELECT PISH_ID, PISH_INV_NO FROM PH_INVOICE_SMRY_HDR WHERE ERP_STGFLG = S ') LOOP
FOR J IN (SELECT INVOICE_NO XXMO_AR_INVOICE_ARC, WHERE REFERENCE_NO = I.PISH_INV_NO AND REFERENCE_DOC_ID = I.PISH_ID AND NVL(MO_STATUS,'N') =' NO) LOOP
UPDATE PH_INVOICE_SMRY_HDR SET ERP_INVOICE_NO = J.INVOICE_NO, ERP_STGFLG = 'P' WHERE PISH_ID = I.PISH_ID AND PISH_INV_NO = I.PISH_INV_NO;
IF SQL % NOTFOUND THEN
FRETVAL: = 1003;
END IF;
UPDATE XXMO_AR_INVOICE_ARC SET MO_STATUS = 'P' WHERE REFERENCE_DOC_ID = I.PISH_ID AND REFERENCE_NO = I.PISH_INV_NO;
IF SQL % NOTFOUND THEN
FRETVAL: = 1004;
END IF;
END LOOP;
END LOOP;
RETURN FRETVAL;
exception when others then
FRETVAL: = - 1;
END ERP_TO_MOPS_INV_UPD;
When I try to run as these values are not updated. But when I run this code using anonymous block of his work. Someone help me please
declare
number of RET: = 0;
Start
RET: = ERP_TO_MOPS_INV_UPD;
DBMS_OUTPUT. PUT_LINE ("RETURN VALUE" | ") (RET);
end;
Hello Abisheksiva,
when I try to run as these values are not updated. But when I run this code using anonymous block his work. >>
What do you mean 'try to start like that...'? Maybe you mean that SOME myfunction (...) DOUBLE; gives you an error message? It is good, as in this case using Returns is not really enjoyable because your 'function' is much more than calculation and returns its result. You must use a procedure with a parameter 'OUT', if you wish.
((Remarque: votre bloc d'exception met-1 en FRETVAL mais ne retourne pas cette valeur))
declare
RET number;
Start
ERP_TO_MOPS_INV_UPD (ret);
DBMS_OUTPUT. PUT_LINE ("RETURN VALUE:" | ") To_char (retired));
end;
Best regards
Bruno Vroman.
Maybe you are looking for
-
Can I protect as installed extensions?
Can I protect as installed extensions? I have an extension such as parental control, but I can't use this extension if the user can simply disable or remove in order to protect the not deleted? a option to hide the menu extensions or passwords? I don
-
Watching videos on YouTube is one of the things I do mainly on the internet. My GPU is able to handle HD videos. That's why I allow it. Although Firefox seems not to like it. He begins hanging is 4 to 6 seconds apart. And the most interesting part is
-
My Hp Slate Tablet Wont turn on HELP!
I recently bought a hp slate 7tablet 2 days ago and its doesn't turn is not on. As I put it to load, but it won't turn. I tried to load it into a different power outlet, but nothing happens. I know for sure the plugs work fresh body of my mother her
-
15 - n073sl VOLUME AND BRIGHTESS CONTROL / DEVICES of UNKNOW
Hello I went down the os from windows 8 for windows 7. I have 2 problems: -i downloaded the drivers from the hp site, even if they were designed for windows 8... in any case I lost the "eyewitness" for volume and the brightess... I want to say... I c
-
Registration Wizard missing "show more options" in the film
I need to record a movie in .avi, but when I hit CTRL-P and running the wizard, there is no other choice "Show more options" as everyone says to use. I only have 'My Computer', 'Recordable CD', 'Email', 'The Web', and 'Caméra DV'. I have been throu