oracle-sqldeveloper

How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?

梦想与她 提交于 2019-11-27 17:49:37
I need to debug in pl/sql to figure times of procedures, I want to use: SELECT systimestamp FROM dual INTO time_db; DBMS_OUTPUT.PUT_LINE('time before procedure ' || time_db); but I don't understand where the output goes to and how can I redirect it to a log file that will contain all the data I want to collect? DBMS_OUTPUT is not the best tool to debug, since most environments don't use it natively. If you want to capture the output of DBMS_OUTPUT however, you would simply use the DBMS_OUTPUT.get_line procedure. Here is a small example: SQL> create directory tmp as '/tmp/'; Directory created

Run 2 queries at the same time on Oracle SQL Developer?

微笑、不失礼 提交于 2019-11-27 17:11:56
问题 I need to retrieve quite a bit of data from our oracle DB and to do so I need to run 20+ queries. Is there any way to run more than one query at a time on the same connection? I tried using / to separate the queries, but that simply opens multiple tabs and queries still run sequentially, although I don't have to start them one by one. 回答1: Pressing ctrl + shift + N will open a new unshared worksheet that can run queries in parallel. In that case you have to paste a query in each tab and run

CLEAR SCREEN - Oracle SQL Developer shortcut?

坚强是说给别人听的谎言 提交于 2019-11-27 13:04:41
问题 With the aim of reducing mouse activity I was wondering if there was such a command shortcut (eg cls or Ctrl + L ) to provide the SQL * Plus (?) "CLEAR SCREEN" command functionality found by clicking the rubber-on-end- of-pencil icon in Oracle SQL Developer to clear the lower " Results " sub-tab ( ... incorrect terminology I'm sure ). 回答1: To clear the SQL window you can use: clear screen; which can also be shortened to cl scr; 回答2: If you're using sqlplus in a shell, like bash you can run

Does SQLDeveloper support executing scripts?

孤街醉人 提交于 2019-11-27 10:33:32
问题 I was trying to follow some instructions today, and it starts with the comment REM In SQLPlus I manually copy in each line and execute it. That's nice, I don't have SQLPlus, I have SQLDeveloper. The lines that were pasted in were of the type: @\\server\dir\dir\dir\commandfile1.txt; COMMIT; ...etc. It didn't like it when I tried that in a SQL window. I opened up and pasted in the commands by hand, and it wasn't happy with that either. (Did I mention that I'm not so good with this application

Use tnsnames.ora in Oracle SQL Developer

跟風遠走 提交于 2019-11-27 09:22:22
问题 I am evaluating Oracle SQL Developer. My tnsnames.ora is populated, and a tnsping to a connection defined in tnsnames.ora works fine. Still, SQL Developer does not display any connections. Oracle SQL Developer Soars mentions, that if you have Oracle client software and a tnsnames.ora file already installed on your machine, Oracle SQL Developer will automatically populate the Connections navigator from the net service names defined in tnsnames.ora. I also tried to set my TNS_ADMIN environment

How to change settings for SQL Developer to correctly recognize current version of SDK

大憨熊 提交于 2019-11-27 07:39:44
问题 I've installed Oracle 11g r2 to my machine and when I opened Oracle SQL Developer it says: java 1.6.0_02 is not supported and telling me to install new java version. Then I've installed JDK 1.6.0_27 and set the path in environment variables and run Oracle SQL Developer again, but the same error occurred. How can I change the settings for Oracle SQL Developer to recognize 1.6.0_27 as my SDK? 回答1: sqldeveloper.conf under sqldeveloper/bin in the SQLDeveloper base directory has an entry for the

SQL*Plus does not execute SQL scripts that SQL Developer does

醉酒当歌 提交于 2019-11-27 06:47:17
问题 I am facing a very annoying problem. I have written (in Notepad++) some SQL scripts. Now when I try to execute them by SQL*Plus (through the command line, on Windows 7), I am getting errors like ORA-00933: SQL command not properly ended . Then I copy & paste the script into the SQL Developer worksheet window, hit the Run button, and the script executes without any problem/errors. After a long investigation, I came to think that SQL*Plus has a problem with some whitespaces (including newline

insert if not exists oracle

落花浮王杯 提交于 2019-11-27 05:24:52
问题 I need to be able to run an Oracle query which goes to insert a number of rows, but it also checks to see if a primary key exists and if it does, then it skips that insert. Something like: INSERT ALL IF NOT EXISTS( SELECT 1 WHERE fo.primary_key='bar' ) ( INSERT INTO schema.myFoo fo ( primary_key, value1, value2 ) VALUES ('bar','baz','bat') ), IF NOT EXISTS( SELECT 1 WHERE fo.primary_key='bar1' ) ( INSERT INTO schema.myFoo fo ( primary_key, value1, value2 ) VALUES ('bar1','baz1','bat1') )

NLS_NUMERIC_CHARACTERS setting for decimal

夙愿已清 提交于 2019-11-27 05:16:28
I have one db setup in a test machine and second in production machine. When I run: select to_number('100,12') from dual Then it gives error in test machine. However, this statement works quite fine in production machine. Now, when I check for NLS_NUMERIC_CHARACTERS then I see ',' (comma) in both machine. Is there anywhere else I should be looking for the decimal setting? Cheers! You can see your current session settings by querying nls_session_parameters : select value from nls_session_parameters where parameter = 'NLS_NUMERIC_CHARACTERS'; VALUE ---------------------------------------- .,

How to use Timestamp_to_scn and Scn_to_timestamp in Oracle?

断了今生、忘了曾经 提交于 2019-11-27 05:07:50
I have this as a result of the query: select cast(to_date(a.start_time,'mm/dd/yyyy hh:mi:ss pm') as timestamp) date_of_call, ora_rowscn from calling_table a where rownum <= 10; DATE_OF_CALLING ORA_ROWSCN 26-JUL-13 12.29.28.000000000 PM 8347567733892 26-JUL-13 12.29.35.000000000 PM 8347567733892 26-JUL-13 12.29.35.000000000 PM 8347567733892 26-JUL-13 12.29.38.000000000 PM 8347567733892 26-JUL-13 12.29.44.000000000 PM 8347567733892 26-JUL-13 12.29.47.000000000 PM 8347567733892 26-JUL-13 12.29.48.000000000 PM 8347567733892 26-JUL-13 12.29.48.000000000 PM 8347567733892 26-JUL-13 12.29.48.000000000