oracle-sqldeveloper

PL / SQL to search a string in whole database

ぐ巨炮叔叔 提交于 2019-12-04 15:04:15
More than a question, its an information sharing post. I have come across a situation today where i needed to look for a sting in the entire database of an application with no idea of, which table/column it belongs to. Below is a PL/SQL block i wrote and used to help my propose. Hope its helps others to with a similar requirement. Declare i NUMBER := 0; counter_intable NUMBER :=0; BEGIN FOR rec IN ( select 'select count(*) ' || ' from '||table_name|| ' where '||column_name||' like''%732-851%'' ' as sql_command from user_tab_columns where data_type='VARCHAR2' ) LOOP execute immediate rec.sql

sql oracle ignore holidays

假如想象 提交于 2019-12-04 13:41:22
I am using this code to calculate the difference between two dates ignoring weekends: SELECT To_date(SYSDATE) - To_date('01.07.2014', 'DD.MM.YYYY') - 2 * ( TRUNC(Next_day(To_date(SYSDATE) - 1, 'FRI')) - TRUNC( Next_day(To_date('01.07.2014' , 'DD.MM.YYYY') - 1, 'FRI')) ) / 7 AS DAYS_BETWEEN FROM dual I have another table called table1 in which the column "date" exists (its type is "DATE") in which all dates where a holiday is are written down. Example table 1: DATES 12.06.2011 19.06.2014 09.05.2013 ... I am trying to make my code check this table and that if one date is between the two dates

Connecting to oracle 12c using Oracle Sql developer (remote)

旧时模样 提交于 2019-12-04 11:50:00
I have been trying to connect to Oracle 12c remotely by using Oracle SQL developer. It shows the below error during connecting to the server : Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection I do can connect to oracle database on the server, but the problem is regarding to connect to this server (database) remotely The content of my listener.ora is : SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:\app\ORCLNEWUSER\product\12.1.0\dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:d:\app\ORCLNEWUSER

Laravel dosen't connect with Oracle

我们两清 提交于 2019-12-04 11:49:19
I'm using yajra/laravel-oci8 for Oracle connection with laravel. But I couldn't connected to Oracle, from my client PC to Server. showing this error: I'm using this code in database.php: 'oracle' => array( 'driver' => 'oracle', 'host' => '192.168.152.189',// this is my server IP 'port' => '1521', 'database' => 'ocp', 'username' => 'ocpl', 'password' => '123456', 'charset' => 'AL32UTF8', 'prefix' => '', 'port' => 1521 ), But I'm connected with Sql Developer. see the Sql-Developer Property: problem in this line : 'database' => 'ocp' , solve it with : 'database' => 'orcl' , or 'database' => '192

SQLDeveloper not starting

大城市里の小女人 提交于 2019-12-04 11:30:28
When i try to start SQLDeveloper, it is giving me the following error in command prompt: Error: This product requires a Java(TM) Platform 5.0 runtime. You are using 1.4.2-b28 from C:\j2sdk1.4.2\jre But my JAVA_HOME is set to java 6 JAVA_HOME=C:\Program Files\Java\jdk1.6.0_32 Can anyone explain what exactly to do to resolve this? Oracle SQL Developer uses a configuration file named products.conf which is situated at your roaming directory. If you are using Windows 7 then the directory path will be: C:\Users\\AppData\Roaming\sqldeveloper\1.0.0.0.0 Delete whole sqldeveloper directory from C:

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

孤街醉人 提交于 2019-12-04 10:22:43
问题 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

DB2 database in Oracle SQL developer

≯℡__Kan透↙ 提交于 2019-12-04 09:17:45
问题 I've heard it's possible to connect to a mainframe DB2 database with a client like Oracle SQL developer. I've looked on-line and can't seem to find the connector files needed to do this in SQL developer. Can anyone direct me to a link to make this work? Or tell me if im just looking for the wrong thing to begin with. I've got the connector working with MySQL databases in Oracle, so I assumed it would be similar for a DB2 database. 回答1: The easiest way to connect to DB2 is through their JDBC

How can I keep Oracle SQL Developer from closing the DB connection?

我们两清 提交于 2019-12-04 08:13:49
问题 Is there any way to keep Oracle SQL Developer from closing my DB connections, or to increase the timeout? Sometimes during a long-running query SQL Dev will just close the connection, leaving my query running on the server but me with no results. If I RDP into the server and run SQL Dev locally it never seems to have this problem. 回答1: This doesn't sound like an issue with SQL developer, cetainly I've never come across it. Are you sure it's not something else, like your network? What happens

Combine several rows with null values into one

爱⌒轻易说出口 提交于 2019-12-04 05:51:17
问题 I have a little problem with my select statement. I need to select the latest record for each type of phones from my table, so I try this code: CREATE TABLE contacts( tel_number VARCHAR2(14), tel_type NUMBER, row_id_con NUMBER, record_id NUMBER ); CREATE TABLE orders( order_id VARCHAR2(9), row_id_ord NUMBER ); INSERT INTO contacts VALUES('444-444-444', 1, 1, 1); INSERT INTO contacts VALUES('22-22-22', 2, 1, 2); INSERT INTO contacts VALUES('555-555-555', 1, 1, 3); INSERT INTO orders VALUES(

SQL Command to insert Chinese Letters

半世苍凉 提交于 2019-12-04 05:25:36
问题 I have a database with one column of the type nvarchar. If I write INSERT INTO table VALUES ("玄真") It shows ¿¿ in the table. What should I do? I'm using SQL Developer. 回答1: Use single quotes, rather than double quotes, to create a text literal and for a NVARCHAR2 / NCHAR text literal you need to prefix it with N SQL Fiddle Oracle 11g R2 Schema Setup : CREATE TABLE table_name ( value NVARCHAR2(20) ); INSERT INTO table_name VALUES (N'玄真'); Query 1 : SELECT * FROM table_name Results : | VALUE |