oracle11g

Return Message of Error code in Oracle Stored Proc

冷暖自知 提交于 2019-12-06 08:25:43
问题 The below procedure (in Oracle 11g release 1) accepts a sql as a parameter & returns its return code. Returns 0 if success Returns 1 if no update or no delete performs Returns actual error code in case of failure. How can I change below procedure to return me another out param say "return_message" which will contain short description of oracle internal error message? In case of success, it should say "success" and in case no delete/updates performed, it should say "nochange" CREATE OR REPLACE

Connect MS SQL Server database to Oracle 11g database

血红的双手。 提交于 2019-12-06 07:48:38
问题 I am struggling to create a db link from a Oracle Database to one SQL Server. For that, I have added the followings: In file tnsnames.ora : sqlUserConn = (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)) (CONNECT_DATA=(SID=sqlUserConn)) (HS=OK) ) in file listener.ora : (SID_DESC= (SID_NAME=sqlUserConn) (ORACLE_HOME=C:\oraclexe\app\oracle\product\11.2.0\server) (PROGRAM=dg4odbc) ) in file sqlnet.ora : SQLNET.AUTHENTICATION_SERVICES = (NTS) NAMES.DIRECTORY_PATH= (TNSNAMES,

Error in Update query-Visual Studio 2010- Oracle 11g Express edition

半世苍凉 提交于 2019-12-06 07:44:59
I am trying to perform update action in Visual Studio 2010 Ultimate with Windows form as the front end and Oracle 11g express as the back end. I am using C# to code this. private void update_student(string STUDENT_ID, string STUDENT_NAME, string STUDENT_ADDRESS) { con.Open(); String sql = "UPDATE STUDENT SET STUDENT_NAME = :STUDENT_NAME, STUDENT_ADDRESS= :STUDENT_ADDRESS WHERE STUDENT_ID= :STUDENT_ID"; OracleCommand query = new OracleCommand(sql, con); OracleParameter[] updatestud = new OracleParameter[3]; updatestud[0] = query.Parameters.Add("STUDENT_ID", OracleDbType.Varchar2, STUDENT_ID,

CHR(0) in REGEXP_LIKE

本秂侑毒 提交于 2019-12-06 07:36:07
I am using the queries to check how chr(0) behaves in regexp_like. CREATE TABLE t1(a char(10)); INSERT INTO t1 VALUES('0123456789'); SELECT CASE WHEN REGEXP_LIKE(a,CHR(0)) THEN 1 ELSE 0 END col, DUMP(a) FROM t1; The output I am getting like this - col dump(a) ----------- ----------------------------------- 1 Typ=96 Len=10: 48,49,50,51,52,53,54,55,56,57 I am totally confused, if there is no chr(0) as shown by the dump(a), how regexp_like is finding the chr(0) in the column and returning 1? Shouldn't it return 0 here? CHR(0) is the character used to terminate a string in the C programming

Insert xmltype into xmltype in specified place [PL/SQL]

与世无争的帅哥 提交于 2019-12-06 07:30:29
问题 I have problem with insert xmltype into another xmltype in specified place in pl/sql. First variable v_xml has the form: <ord> <head> <ord_code>123</ord_code> <ord_date>01-01-2015</ord_date> </head> </ord> And the second v_xml2: <pos> <pos_code>456</pos_code> <pos_desc>description</pos_desc> </pos> My purpose is get something like this: <ord> <head> <ord_code>123</ord_code> <ord_date>01-01-2015</ord_date> </head> <!-- put the second variable in this place - after closing <head> tag --> <pos>

What is better/faster: joining many tables or select one big table

非 Y 不嫁゛ 提交于 2019-12-06 07:16:33
问题 We are using Oracle 11, our application written on Java. Once a day, usually afternoon our database freezing because of many big sql queries. I want optimize this queries somehow. This queries consists of many joins of different tables. My question is: is it better for performance to use left join, or it is better put all information in one table and use one select? Suppose I will build a good indexes for this table. For information: in average, one query fetch 100 megabytes. Also this

ORACLE Constraint to allow Null Value, IF

*爱你&永不变心* 提交于 2019-12-06 06:49:48
问题 I'm working with oracle for the first time, and I have a table called ExpenseReport which stores details about expenses. I want Nulls to be allowed for ApprUserNo IF ERStatus = 'PENDING' Any help would be greatly appreciated, I've been trying to sort this all morning CREATE TABLE ExpenseReport ( ERNo NUMBER(10) NOT NULL, ERDesc VARCHAR2(255) NOT NULL, ERSubmitDate DATE NOT NULL, ERStatusDate DATE NOT NULL, ERStatus VARCHAR2(8) DEFAULT 'PENDING' NOT NULL, SubmitUserNo NUMBER(10) NOT NULL,

Oracle Database link with error

折月煮酒 提交于 2019-12-06 06:32:01
I'm trying to create a database link form an Oracle server to another. The command I'm using is: create public database link mylink connect to myuser identified by 0000 authenticated by myuser identified by 0000 using 'myTNSNameRemoteServer'; sqlplus give me this error: ERROR at line 1: ORA-00933: SQL command not properly ended Putting the '*' under the first character of the password in its first instance. Have I to escape it in someway? Thanks The solution was to double quote the password: create public database link mylink connect to myuser identified by "0000" authenticated by myuser

WARNING: Error while registering Oracle JDBC Diagnosability MBean

拥有回忆 提交于 2019-12-06 06:30:14
问题 We are getting the following error when using Oracle 11g ojdbc6.jar: WARNING: Error while registering Oracle JDBC Diagnosability MBean. java.lang.NoSuchMethodError: javax.management.StandardMBean.<init>(Ljava/lang/Class;Z)V at oracle.jdbc.driver.OracleDiagnosabilityMBean.<init>(OracleDiagnosabilityMBean.java:34) at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:342) at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199) After investigating from many forums and blogs

AWS Lambda cannot connect to Oracle Instant Client

假如想象 提交于 2019-12-06 06:22:25
I have a basic requirement of connecting an on premise Oracle database to Redshift. I need to use AWS Lambda to connect to both the databases using python. While I achieved connection to Redshift by exporting Linux libraries of psycopg2 , I am facing issues with the Oracle database. Below are the steps followed to try to connect to Oracle on premise DB : Installed cx_Oracle which came up with cx_Oracle.cpython-36m-x86_64-linux-gnu.so and psycopg2-2.7.4.dist-info Installed basic oracle client lite 64 bit for linux Set LD_LIBRARY_PATH to point to the lib files of the instant client package When