oracle-sqldeveloper

How do you get nicely formatted results from an Oracle procedure that returns a reference cursor?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 20:49:22
In MS SQL Server if I want to check the results from a Stored procedure I might execute the following in Management Studio. --SQL SERVER WAY exec sp_GetQuestions('OMG Ponies') The output in the results pane might look like this. ID Title ViewCount Votes ----- ------------------------------------------------- ---------- -------- 2165 Indexed View vs Indexes on Table 491 2 5068 SQL Server equivalent to Oracle’s NULLS FIRST 524 3 1261 Benefits Of Using SQL Ordinal Position Notation? 377 2 (3 row(s) affected) No need to write loops or PRINT statements. To do the same thing in Oracle I might

How to change the timezone of Oracle SQL Developer / Oracle Data Modeler?

核能气质少年 提交于 2019-11-26 20:40:47
问题 Each time I run Oracle SQL Developer or Oracle Data Modeler I receive this error message: ora-01882 "timezone region not found" Digging a this issue, I found that both Oracle SQL Developer and Oracle Data Modeler says that my timezone is Europe/Berlin , which is not listed into the Oracle's system view V$TIMEZONE_NAMES . So, I need to change the timezone in Oracle SQL Developer (not the database) to match the most similar timezone found in V$TIMEZONE_NAMES . 回答1: If you need to change the

Setting up the Oracle database on Macbook Pro (OS X Yosemite)

跟風遠走 提交于 2019-11-26 20:27:59
问题 I see that Oracle 11g or 12c doesn't have the download files for OS X. However, there is a version of the SQL Developer available for OS X. What's the point of the SQL Developer when you don't have a database? How do I install the Oracle database (preferable 12c or 11g Express Edition) on OS X? 回答1: You can't install the database server software directly on OS X 1 . Oracle made a decision some time ago not so support it any more, presumably because it wasn't used enough to justify the costs

Exporting a CLOB to a text file using Oracle SQL Developer

与世无争的帅哥 提交于 2019-11-26 20:18:08
问题 I am using Oracle SQL Developer and trying to export a table to a CSV file. Some of the fields are CLOB fields, and in many cases the entries are truncated when the export happens. I'm looking for a way to get the whole thing out, as my end goal is to not use Oracle here (I received an Oracle dump - which was loaded into an oracle db, but am using the data in another format so going via CSV as an intermediary). If there are multiple solutions to this, given that it is a one time procedure for

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

。_饼干妹妹 提交于 2019-11-26 19:12:25
问题 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? 回答1: 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

How to see refcursor result/output in Oracle SQL Developer? [duplicate]

帅比萌擦擦* 提交于 2019-11-26 18:28:39
问题 Possible Duplicate: Best way/tool to get the results from an oracle package procedure Oracle SQL Developer: Show REFCURSOR Results in Grid? I am new to Oracle SQL Developer. I am using Oracle SQL Developer Version 3.0. I was trying to test my SP using the following query. DECLARE type output_cursor is ref cursor; P_CURSOR output_cursor; BEGIN P_CURSOR := NULL; myPackage.mySPTest ( P_NOTIFICATION_ID => 1975357,P_CURSOR => P_CURSOR) ; END; When I ran the above query in my Oracle SQL Developer,

How to generate an entity-relationship (ER) diagram using Oracle SQL Developer

大城市里の小女人 提交于 2019-11-26 12:34:05
问题 I want to use Oracle SQL Developer to generate an ER diagram for my DB tables but I am new to Oracle and this tool. What is the process for creating an ER diagram in SQL Developer? 回答1: Create a diagram for existing database schema or its subset as follows: Click File → Data Modeler → Import → Data Dictionary . Select a DB connection (add one if none). Click Next . Check one or more schema names. Click Next . Check one or more objects to import. Click Next . Click Finish . The ERD is

How to use Timestamp_to_scn and Scn_to_timestamp in Oracle?

坚强是说给别人听的谎言 提交于 2019-11-26 11:27:44
问题 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

How to extract week number in sql

心已入冬 提交于 2019-11-26 11:18:41
问题 I have a transdate column of varchar2 type which has the following entrees 01/02/2012 01/03/2012 etc. I converted it in to date format in another column using to_date function. This is the format i got. 01-JAN-2012 03-APR-2012 When I\'m trying to extract the weekno, i\'m getting all null values. select to_char(to_date(TRANSDATE), \'w\') as weekno from tablename. null null How to get weekno from date in the above format? 回答1: After converting your varchar2 date to a true date datatype, then

Printing the value of a variable in SQL Developer

被刻印的时光 ゝ 提交于 2019-11-26 10:27:10
I wanted to print the value of a particular variable which is inside an anonymous block. I am using Oracle SQL Developer. I tried using dbms_output.put_line . But it is not working. The code which I am using is shown below. SET SERVEROUTPUT ON DECLARE CTABLE USER_OBJECTS.OBJECT_NAME%TYPE; CCOLUMN ALL_TAB_COLS.COLUMN_NAME%TYPE; V_ALL_COLS VARCHAR2(500); CURSOR CURSOR_TABLE IS SELECT OBJECT_NAME FROM USER_OBJECTS WHERE OBJECT_TYPE='TABLE' AND OBJECT_NAME LIKE 'tb_prm_%'; CURSOR CURSOR_COLUMNS (V_TABLE_NAME IN VARCHAR2) IS SELECT COLUMN_NAME FROM ALL_TAB_COLS WHERE TABLE_NAME = V_TABLE_NAME;