oracle-sqldeveloper

Run sql code with variables in Oracle SQL Developer code window

牧云@^-^@ 提交于 2019-12-03 09:06:58
问题 I'm writing code using Oracle SQL Developer. I have a simple select statement that works: SELECT CFS.CAE_SEC_ID, CFS.FM_SEC_CODE, CFS.LAST_USER_ID, case when 1 = 1 then sl.usbank_to_edit else case when 'ENT\CB174' = CFS.last_user_id then sl.owner_to_edit else sl.to_edit end end canEdit FROM CAEDBO.CAE_FOF_SECURITY CFS INNER JOIN caedbo.CAE_DATA_SET_ELEMENT CDSE_STAT ON (CDSE_STAT.DATA_SET_ELEMENT_ID = CFS.APPR_STATUS) INNER JOIN caedbo.CAE_STATE_LOOKUP sl ON (sl.object_state = CDSE_STAT.data

PLSQL generate random integer

一个人想着一个人 提交于 2019-12-03 08:56:00
In Oracle Sql developer 11g, how do I generate a random integer and assign it to a variable? This is what I've tried so far: S_TB := SELECT dbms_random.value(1,10) num FROM dual; With this code I got error: S_TB := SELECT dbms_random.value(1,10) num FROM dual Error report - Unknown Command What is the proper way to solve my issue? Variables require PL/SQL; it's not clear from your question whether your code is a proper PL/SQL block. In PL/SQL variables are populated from queries using the INTO syntax rather than the assignment syntax you're using. declare txt varchar2(128); n pls_integer;

Can't open View->DBA Menu in SQL Developer (Oracle 12C Standard Edition Installed)

心不动则不痛 提交于 2019-12-03 08:31:53
问题 I have installed Oracle 12C Standard Edition. Everything works fine there. I have also connected the Oracle SQL Developer Client 4.0. From that I can access the tables, indexes etc. I am trying to see the tablespace details from SQL Developer Client by clicking the View -> DBA menu. By clicking this menu, nothing is getting opened. Through EM I can able to see those. But I want to see through SQL developer. I am not sure, whether I need to do any settings, so that the View -> DBA menu can be

How can I insert into a BLOB column from an insert statement in sqldeveloper?

风流意气都作罢 提交于 2019-12-03 06:38:11
问题 Is it possible to insert into a BLOB column in oracle using sqldeveloper? i.e. something like: insert into mytable(id, myblob) values (1,'some magic here'); 回答1: Yes, it's possible, e.g. using the implicit conversion from RAW to BLOB: insert into blob_fun values(1, hextoraw('453d7a34')); 453d7a34 is a string of hexadecimal values, which is first explicitly converted to the RAW data type and then inserted into the BLOB column. The result is a BLOB value of 4 bytes. 回答2: To insert a VARCHAR2

Oracle SQL Developer: how to view results from a ref cursor?

人走茶凉 提交于 2019-12-03 06:25:31
If I have a function which returns a reference cursor for a query, how can I view the result set of this in SQL Developer? Toad has a special tab for viewing the results of a reference cursor, this is the functionality I would like to find. Double click the cursor fields in your result record. On the right side there is a "..." icon. Click this and you'll see the contents SET SERVEROUTPUT ON; VARIABLE X REFCURSOR; EXEC PROCEDURE_WITH_OUTPUT_SYS_REFCURSOR(:X); PRINT X; Hi I know this was asked a while ago but I've just figured this out and it might help someone else. Not sure if this is exactly

PostgreSQL with SQL Developer Issue

删除回忆录丶 提交于 2019-12-03 06:15:46
I added my Third Party JDBC drivers for PostgreSQL, the tab shows up. However, after I fill in the Username/Pwd and Hostname/Port and then select Choose Database - I get: Failure -FATAL: database "user1" does not exist Anyone else having this issue? The JDBC driver I am using is postgresql-8.4-701.jdbc4.jar . Kloe2378231 If you have a different user and db name, SQLDevelopper 4.1 works with this workarround: username: testuser password: mypass Host: 127.0.0.1:1234/testdb? Port: 1234 Don't forget the "?" character. Then Select Database becomes available and connection works. Thanks to

Unable to log in to database as SYS with Oracle SQL Developer

ε祈祈猫儿з 提交于 2019-12-03 05:35:36
I've worked with Oracle for some time but very much a noob with the Admin side of things and am learning, so bear with me. I cannot log on to my database (orcl_test) with SQL Developer with the SYS username. I can log on just fine in SQLPlus with SYS as SYSDBA - when I try with SQL Developer I get an error: ORA-01017: invalid username/password; logon denied. Logging on as SYS as SYSDBA in SQLPlus, I created a test table within the database and granted the test user SCOTT with SELECT permissions. The Scott user can log on through SQL Developer w/o problem and access the allowed tables. I have

Oracle SQL Developer - Query results window with grid missing

喜你入骨 提交于 2019-12-03 05:21:58
问题 I've just made the switch from MS sql server to Oracle. The query tool I am using is Oracle SQL Developer. The problem I am having is that I cannot get the query results window to stick around. The query results window being the Grid view for the results. It seems to show up arbitrarily when I open a new "sql worksheet". But not always. Then once I run a query, it disappears the next time I run one. Can anyone point me to a consistent way to leave this results grid active? Thanks so much. 回答1

how to modify the size of a column

ε祈祈猫儿з 提交于 2019-12-03 04:59:10
问题 I created the table Test_Project2 in Oracle SQL Developer. After that I realized that the column proj_name is of a small size, so I decided to modify the column using the follwoing statement ALTER TABLE TEST_PROJECT2 MODIFY proj_name VARCHAR2(300); but for some reason Oracle SQL Developer underscores the semi-colon with red and I do not what is mistake and how to correct it Test_Project2 : CREATE TABLE Test_Project2 ( proj_id number(30), proj_name VARCHAR2 (30), proj_desc VARCHAR2(300) ); 回答1

Creating a new database and new connection in Oracle SQL Developer

↘锁芯ラ 提交于 2019-12-03 04:46:24
问题 I've installed SQL Developer on my system. No connections are being shown in my system yet. How do I create a new connection. Must I create a database first? If yes, then how do I create a new database. The SQL Query Editor window is not opening because there is no connection. All of this because there is no database. How do I create an empty database and then connect to it. 回答1: This tutorial should help you: Getting Started with Oracle SQL Developer See the prerequisites: Install Oracle SQL