oracle11g

Escaping special characters in SQL

拈花ヽ惹草 提交于 2019-12-05 04:19:19
Is there an easy way in Oracle to escape special characters in a SQL statement? (i.e. %, &, ') I saw this link in regard to manually escaping characters, but I thought Oracle may have provided an easier way to do so. Note: I'm generating dynamic SQL select statements through an ORM. If using bind variables and ORM, embedded single quotes and ampersands should be handed automatically; those are special characters in SQL*Plus or SQL*Developer. To use LIKE where looking for the literal characters % and _ (not their multi- and single-character wildcard versions), you'd use the escape clause of the

converting a DB2 query into oracle query

假如想象 提交于 2019-12-05 04:19:01
问题 Previously we used DB2 as database, but now we are migrating to Oracle. Now, in our project we have extensively used sql's that were Db2 specific. Is there any way to convert those DB2 specific queries to oracle supported queries. Thanks 回答1: You have a lot of work ahead! Between DB2 and Oracle, some important differences are (just an arbitrary enumeration of what I can think of): Data types Number data types: DB2 has many more standard types, such as SMALLINT , INTEGER , DOUBLE , etc. Those

SQLException: Protocol Violation in oracle

天大地大妈咪最大 提交于 2019-12-05 04:11:52
I am getting the "Protocol Violation". I have an application running on RedHat Linux.The database and the application are co-resident on the machine. Oracle version used: Oracle 11g R2 (11.2.0.3.0) JDBC Driver used: 12.1.0.1 Java used: jdk1.7.0.65 32-bit I have come across many forums where this error has been pointed out to be a driver issue but in all those forums the oracle version used was higher and the driver version were older and changing the driver resolved the issue.But in my case the Oracle version is lower but driver version is higher.So , in this case will the higher version of

Accessing a table without specifying the schema name

半城伤御伤魂 提交于 2019-12-05 03:41:59
I have a schema called GBO_ARC_SCHEMA , in which I have one table called TEST_EMP , and I have two users say USER_A and USER_B . First I connected to USER_A and fired below query select count(*)from TEST_EMP; count ----- 20 After that I connected as USER_b and fired below query but it is giving an error, saying that table or view does not exit select count(*)from TEST_EMP; But if I use scma.object name it is allowing me to query like below select count(*)from GBO_ARC_SCHEMA.TEST_EMP; but as per my requirement I don't want to specify schema name. can somebody help me out? If you want all users

Oracle select query with inner select query error

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 02:47:55
I am getting a SQL error and trying to resolve, any pointers would be helpful, // this gets executed SELECT empid FROM employees WHERE deptid IN (10,20,30,40 ); // this gets executed SELECT deptid FROM department WHERE description LIKE '%application%' ORDER BY createddate DESC but the below query throws error: SELECT empid FROM employees WHERE deptid IN (SELECT deptid FROM department WHERE description LIKE '%application%' ORDER BY createddate DESC); error: ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis" Update: 07/14: Updating with the exact solution from

How to detach a partition from a table and attach it to another in oracle?

こ雲淡風輕ζ 提交于 2019-12-05 02:06:47
问题 I have a table with huge data( say millions of records, its just a case study though!) of 5 years, with a partition for each year. Now i would want to retain the last 2 years data, and transfer the rest of the 3 year data to a new table called archive? What would be the Ideal method, with minimal down time and high performance? 回答1: alter table exchange partition is the answer. This command exange the segment of a partition with the segment of a table. It is at light speed because it does

Oracle 11g - most efficient way of inserting multiple rows

痞子三分冷 提交于 2019-12-05 01:40:39
问题 I have an application which is running slowly over a WAN - we think the cause is multiple inserts into a table. I'm currently looking into more efficient ways to insert multiple rows at the same time. I found this method: INSERT ALL INTO MULTI_INSERT(VAL_1, VAL_2) VALUES (100,20) INTO MULTI_INSERT(VAL_1, VAL_2) VALUES (21,2) INTO MULTI_INSERT(VAL_1, VAL_2) VALUES (321,10) INTO MULTI_INSERT(VAL_1, VAL_2) VALUES (22,13) INTO MULTI_INSERT(VAL_1, VAL_2) VALUES (14,121) INTO MULTI_INSERT(VAL_1,

SQL Developer error Unable to find Java Virtual Machine [duplicate]

我只是一个虾纸丫 提交于 2019-12-05 01:02:09
This question already has an answer here: How to change settings for SQL Developer to correctly recognize current version of SDK 11 answers After installing Oracle 11g client, when I tried to run SQL Developer it's asked me to give it java.exe path. As I didn't know I gave it the wrong path to program files java installation. Which I later found out that I should have given the path to java.exe inside oracle folder. Now every time I run it doesn't ask me for java.exe path, but shows the next error: Unable to find Java Virtual Machine . I think to correct this I need to give Java path to it in

CLOB vs. VARCHAR2 and are there other alternatives?

你离开我真会死。 提交于 2019-12-05 00:52:36
I am using DevArt's dotConnect and Entity Developer for my application. I've created the tables using the Entity-First feature. I notice that many of the column types are set to CLOB. I only have experience with MySQL and Microsoft SQL server, so I am not sure about using CLOB for the application. I did some reading, and found out that CLOB are for large chunk of data. The questions are: Is using CLOB for most fields, such as the user's gender (which should be a varchar (1) ) or the full name, feasible? The steps for converting a CLOB field to VARCHAR2 requires dropping the column then re

Trigger for only changed values

主宰稳场 提交于 2019-12-05 00:52:23
Say we have 3 records in table: orig_tab --------------------------------------------- | PK | Name | Address | Postal Code | --------------------------------------------- | 1 | AA | Street1 | 11111 | | 2 | BB | Street2 | 22222 | | 3 | CC | Street3 | 33333 | --------------------------------------------- Now the data is changed: --------------------------------------------- | PK | Name | Address | Postal Code | --------------------------------------------- | 1 | AA | Street1 | 11111 | | 2 | BB | Street2 | 44444 | | 3 | CC | Dtreet7 | 33333 | --------------------------------------------- What