Oracle 10G query
I have following queries to be solved please help me out....
1) Difference / Limitation of Oracle Standard Edition / Enterprise Edition 10..... latest ?
2) Can Data of Oracle 8. ..... Expo File will be Imported to 10....... latest ?
If not than what steps we have to take. Basically I would like my current DB of 8 to be moved to 10G
3) From which AIX Ver Oracle 10 ...... is Supported ?
4) if the customer has 8... Ver Lic When if goes for New Ver than media will have full Ver or only Upgrade files. ?
5) If the Customer has Old ver Lic and he goes for upgrade Lic Than we have to first Install Old Lic Ver & than Upgrade or directly we can load Latest Lic Ver on New Server and work. ? What I mean is if I have to go ahead from Oracle 8 to Oracle 10G how should I go about.
6) Is Oracle Media ver Compatible for Aix ?
7) Oracle Lic Policy / Product Information Web Link ?
Thanks & Regards
Shivanand S S
This is a perfectly valid way to query the data. Here's an example on my own production tables. This one has about 300 million rows:
select *
from prod.tran_history
where tran_date >= to_date(add_months(sysdate, -2))
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 11M| 863M| 146K|
| 1 | TABLE ACCESS BY INDEX ROWID| TRAN_HISTORY | 11M| 863M| 146K|
|* 2 | INDEX RANGE SCAN | TRAN_HIST_DATE_IDX | 2144K| | 2098 |
--------------------------------------------------------------------------------------------
Similar Messages
-
0
down vote
favorite I am using oracle 10g. I have a temp table TEMP.
TEMP has following structure:-
USER COUNT TYPE
1 10 T1
2 21 T2
3 45 T1
1 7 T1
I need a query which will show all types has column names,and types can be any value like T1,T2,..Tn and columns will be like:-
USER T1 T2 Tn
and User column will show all the users and T1,T2 column will show total count of types.
Edited by: 969468 on Nov 15, 2012 9:35 PMPlease see my original post ("I have a page erroring in production (but not in development) when it gets to a date that it needs to display.") Sorry if it came across as vague. It made sense, to me, when I typed it. But, then, I'm usually typing fast just to get the question out there, when I'm in a hurry.
Haven't done a CFDUMP, yet, as every time I make a change in development that needs to be tested in production, I have to notify my supervisor that there are files that need to be copied into production, which can sometimes take a while, so I try to do troubleshooting on dev side - it's a pain in the you-know-what, but that's the kind of environment I'm working in.
As it turns out, changing the format in the SELECT to_char() did the trick. If anyone else has this issue with Oracle 10g, I'm now using SELECT to_char(create_date,'YYYY/MM/DD HH:MI') FROM tableA, and now the CFOUTPUT is processing the whole page. I guess the MM-DD-YYYY threw CF into a tizzy, breaking the process?
Anyhoo, it's working, now. Thank you, Dan and Adam, for your thoughts on this.
^_^ -
Oracle 10g query rows to column transpose
In oracle 10g I have table called LoginUser
Select * from LoginUser where Day = '01-Dec-2012'
will give me the below result
Day, Name, Country
1-Dec-12 , John, UK
1-Dec12 , Cate, US
1-Dec-12 , Prakash, India
1-Dec-12 ,Juli, Pak
But I want result as below
Day, Name1, Country1, Name2, Country2, Name3, Country3, Name4, Country4
1-Dec-12, John, UK, Cate, US, Prakash, India, Juli, Pak
Please help
Edited by: 975340 on Dec 6, 2012 1:48 AM
Edited by: 975340 on Dec 6, 2012 1:50 AMRefer to below thread
Re: Multiple rows into a single line in 'Single Column Table' -
Oracle 10g - query is very slow in jdbc but not in other tools
I'm using PreparedStatement to execute a query with some parameters.
in sql developer, it just spends 12 seconds but in jdbc, it's around 140 seconds.
I disabled "_optim_peek_user_binds" parameter already but it didn't help.
alter session set "_optim_peek_user_binds"=false;Please mark this thread ANSWERED and repost it in the JDBC forum.
https://forums.oracle.com/forums/category.jspa?categoryID=288
When you post provide your 4 digit Oracle version, Java version and JDBC jar name and version as well as the code you are using. -
Oracle 10g Query on Date Column
Hello -
What is the most efficient way to query on a date column to get all dates within the last 2 months? I use something like the following in the WHERE clause:
billing_date >= to_date(add_months(sysdate, -2))
However, I can't ever get the index on billing_date to be used.
Any help is greatly appreciated...
Thanks!!This is a perfectly valid way to query the data. Here's an example on my own production tables. This one has about 300 million rows:
select *
from prod.tran_history
where tran_date >= to_date(add_months(sysdate, -2))
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 11M| 863M| 146K|
| 1 | TABLE ACCESS BY INDEX ROWID| TRAN_HISTORY | 11M| 863M| 146K|
|* 2 | INDEX RANGE SCAN | TRAN_HIST_DATE_IDX | 2144K| | 2098 |
-------------------------------------------------------------------------------------------- -
Selective export failing - Solaris Sparc - Oracle 10g
HI Gurus,
I am trying to export selective data from one of my prod database tables. But not succeeding. I was keep on trying for the past 2 hours.
Could anybody please verify the script and let me know what was wrong in it. Thanks in advance
OS : SOLARIS SPARC
ORACLE - 10G
Query --> WHERE E3RECV_DT LIKE '201305%' (I need to export this query data)
Below Script i am using
===============
exp E3USER@SGEBAPU2 statistics=none consistent=n buffer=100000000 file=exp_pipe_file TABLES=IFDATA query=\"WHERE E3RECV_DT LIKE '201305\%'\" log=PGTB_IFDATA_conditional.logNagaraju P wrote:
HI Gurus,
I am trying to export selective data from one of my prod database tables. But not succeeding. I was keep on trying for the past 2 hours.
Could anybody please verify the script and let me know what was wrong in it. Thanks in advance
OS : SOLARIS SPARC
ORACLE - 10G
Query --> WHERE E3RECV_DT LIKE '201305%' (I need to export this query data)
Below Script i am using
===============
exp E3USER@SGEBAPU2 statistics=none consistent=n buffer=100000000 file=exp_pipe_file TABLES=IFDATA query=\"WHERE E3RECV_DT LIKE '201305\%'\" log=PGTB_IFDATA_conditional.logconsider placing everything on Control file to avoid fighting with the command line interpreter.
my car is not succeeding.
Tell me how to make my car go.
use COPY & PASTE so we can see what you do & exactly how Oracle responds.
How do I ask a question on the forums?
SQL and PL/SQL FAQ -
Hi,
I have a query with regards to Oracle 10g licensing for additional options (OLAP, Data Mining, Partitioning, Spatial & Database Vault) on top of enterprise edition.
Even though i am not using any of the options, i have them installed along with enterprise edition. Do i still need to pay for these additional options?
From 10g, you can always prove to oracle that any of the features/options are not in use via DBA_FEATURE_USAGE_STATISTICS.
We are using shared infrastructure for hosting many application databases. Today we have a application that uses only partitioning, but tommorrow we might have to create a database within the same oracle home that uses OLAP & data mining as well.
would be interested in knowing what is oracle stand on this i.e. we pay for additional options only if we are using them or we pay just because they are installed regardless of we are using them or not??
Thanks & Regards
ChandarChandark,
You need to pay licenses if you are using it commercially and if it is installed and you haven't paid for it then how would you stop anyone not using it because its not paid but its there. This will be against your contractual agreement and they may fine you or you have to pay for the options. So I recommend not to install options you haven't paid for to avoid any issues. But if you are using for learning purpose and not commercial then you are good. You can further contact local Oracle Support or local Sales rep for more information
Hope this helps, regards
OrionNet -
Issue with "Select Distinct" query in Oracle 10g against Oracle 9i
Hi,
I would appreciate if some one help me here because it is really urgent.
We are upgrading our database from 9i to 10g.
There are the "Select distinct" queries in the code which populated the grid on the applications screens. We found a difference in 9i and 10g the way the result is populated for these queries. If "Select Distinct" query wihtout a order by clause is executed in 9i then the result is automatically sorted. But Oracle 10g does not do this.
We can change the queries adding order by clause but we are almost at the end of the testing and want to know if there is any way that we can do this from database settings. Would there be any impact of these settings change on overall operation of Oracle 10g?
I would appreciate if some one can help me here.
Thanks,
Dineshthen the result is automatically sorted.No. Oracle may have done a sort operation to perform the distinct, but it still did not guarantee the order of your results.
In 10g and in 9i, if you want your results in a certain order you must use order by. -
Query can run in Oracle 10g but very slow in 11g
Hi,
We've just migrated to Oracle 11g and we noticed that some of our view are very slow (it takes seconds in 10g and takes 30 minutes in 11g), and the tables are using the local table.
Do any of you face the same issue?
This is our query:
SELECT
A.wellbore
,a.depth center
,d.MD maxbc
,d.XDELT xbc
,d.YDELT ybc
,e.MD minac
,e.XDELT xac
,e.YDELT yac
from
table_A d,table_A e, table_B a
where a.wellbore = d.WELLBORE (+)
and a.wellbore = e.WELLBORE(+)
and d.MD = (select max(MD) from table_A b where b.MD < a.depth and
d.wellBORE = b.wellBORE)
and e.md = (select min(md) from table_A c where c.MD > a.depth and
e.wellBORE = c.wellBORE);Thanks I will move to the correct one..
Rafi,
Build the Indexes and it is still slow. I am querying from a view from another database, which is in 10g instances.
Moved: Query can run in Oracle 10g but very slow in 11g
Edited by: 924400 on Apr 1, 2012 6:03 PM
Edited by: 924400 on Apr 1, 2012 6:26 PM -
Query working fine in 9i but throwing an error in Oracle 10g
Hi All,
I am having a query which contains large number of When clauses inside a case statement.
The Same SQL is working fine in 9i, but not working in 10G.
If we try to remove one of the When clause in the query, its working fine else it is giving the error ORA-00939 Too many arguments for functions.
Can any one tell me the solution for this and what is the maximum number of when clauses allowed inside case statemen in oracle 10g.
Thanks in advance
Regards
Karthikit should not have worked in 9iR2... it is correct according to the doc to return an error message when using more than 255 expressions...
SQL> select version from v$instance;
VERSION
9.2.0.7.0
SQL> select case 1
2 when 2 then 3
3 when 4 then 5
4 when 6 then 7
5 when 8 then 9
6 when 10 then 11
7 when 12 then 13
8 when 14 then 15
9 when 16 then 17
10 when 18 then 19
11 when 20 then 21
12 when 22 then 23
13 when 24 then 25
14 when 26 then 27
15 when 28 then 29
16 when 30 then 31
17 when 32 then 33
18 when 34 then 35
19 when 36 then 37
20 when 38 then 39
21 when 40 then 41
22 when 42 then 43
23 when 44 then 45
24 when 46 then 47
25 when 48 then 49
26 when 50 then 51
27 when 52 then 53
28 when 54 then 55
29 when 56 then 57
30 when 58 then 59
31 when 60 then 61
32 when 62 then 63
33 when 64 then 65
34 when 66 then 67
35 when 68 then 69
36 when 70 then 71
37 when 72 then 73
38 when 74 then 75
39 when 76 then 77
40 when 78 then 79
41 when 80 then 81
42 when 82 then 83
43 when 84 then 85
44 when 86 then 87
45 when 88 then 89
46 when 90 then 91
47 when 92 then 93
48 when 94 then 95
49 when 96 then 97
50 when 98 then 99
51 when 100 then 101
52 when 102 then 103
53 when 104 then 105
54 when 106 then 107
55 when 108 then 109
56 when 110 then 111
57 when 112 then 113
58 when 114 then 115
59 when 116 then 117
60 when 118 then 119
61 when 120 then 121
62 when 122 then 123
63 when 124 then 125
64 when 126 then 127
65 when 128 then 129
66 when 130 then 131
67 when 132 then 133
68 when 134 then 135
69 when 136 then 137
70 when 138 then 139
71 when 140 then 141
72 when 142 then 143
73 when 144 then 145
74 when 146 then 147
75 when 148 then 149
76 when 150 then 151
77 when 152 then 153
78 when 154 then 155
79 when 156 then 157
80 when 158 then 159
81 when 160 then 161
82 when 162 then 163
83 when 164 then 165
84 when 166 then 167
85 when 168 then 169
86 when 170 then 171
87 when 172 then 173
88 when 174 then 175
89 when 176 then 177
90 when 178 then 179
91 when 180 then 181
92 when 182 then 183
93 when 184 then 185
94 when 186 then 187
95 when 188 then 189
96 when 190 then 191
97 when 192 then 193
98 when 194 then 195
99 when 196 then 197
100 when 198 then 199
101 when 200 then 201
102 when 202 then 203
103 when 204 then 205
104 when 206 then 207
105 when 208 then 209
106 when 210 then 211
107 when 212 then 213
108 when 214 then 215
109 when 216 then 217
110 when 218 then 219
111 when 220 then 221
112 when 222 then 223
113 when 224 then 225
114 when 226 then 227
115 when 228 then 229
116 when 230 then 231
117 when 232 then 233
118 when 234 then 235
119 when 236 then 237
120 when 238 then 239
121 when 240 then 241
122 when 242 then 243
123 when 244 then 245
124 when 246 then 247
125 when 248 then 249
126 when 250 then 251
127 when 252 then 253
128 when 254 then 255
129 when 256 then 257
130 end x from dual;
X
SQL> select version from v$instance;
VERSION
10.2.0.2.0
SQL> select case 1
2 when 2 then 3
3 when 4 then 5
4 when 6 then 7
5 when 8 then 9
6 when 10 then 11
7 when 12 then 13
8 when 14 then 15
9 when 16 then 17
10 when 18 then 19
11 when 20 then 21
12 when 22 then 23
13 when 24 then 25
14 when 26 then 27
15 when 28 then 29
16 when 30 then 31
17 when 32 then 33
18 when 34 then 35
19 when 36 then 37
20 when 38 then 39
21 when 40 then 41
22 when 42 then 43
23 when 44 then 45
24 when 46 then 47
25 when 48 then 49
26 when 50 then 51
27 when 52 then 53
28 when 54 then 55
29 when 56 then 57
30 when 58 then 59
31 when 60 then 61
32 when 62 then 63
33 when 64 then 65
34 when 66 then 67
35 when 68 then 69
36 when 70 then 71
37 when 72 then 73
38 when 74 then 75
39 when 76 then 77
40 when 78 then 79
41 when 80 then 81
42 when 82 then 83
43 when 84 then 85
44 when 86 then 87
45 when 88 then 89
46 when 90 then 91
47 when 92 then 93
48 when 94 then 95
49 when 96 then 97
50 when 98 then 99
51 when 100 then 101
52 when 102 then 103
53 when 104 then 105
54 when 106 then 107
55 when 108 then 109
56 when 110 then 111
57 when 112 then 113
58 when 114 then 115
59 when 116 then 117
60 when 118 then 119
61 when 120 then 121
62 when 122 then 123
63 when 124 then 125
64 when 126 then 127
65 when 128 then 129
66 when 130 then 131
67 when 132 then 133
68 when 134 then 135
69 when 136 then 137
70 when 138 then 139
71 when 140 then 141
72 when 142 then 143
73 when 144 then 145
74 when 146 then 147
75 when 148 then 149
76 when 150 then 151
77 when 152 then 153
78 when 154 then 155
79 when 156 then 157
80 when 158 then 159
81 when 160 then 161
82 when 162 then 163
83 when 164 then 165
84 when 166 then 167
85 when 168 then 169
86 when 170 then 171
87 when 172 then 173
88 when 174 then 175
89 when 176 then 177
90 when 178 then 179
91 when 180 then 181
92 when 182 then 183
93 when 184 then 185
94 when 186 then 187
95 when 188 then 189
96 when 190 then 191
97 when 192 then 193
98 when 194 then 195
99 when 196 then 197
100 when 198 then 199
101 when 200 then 201
102 when 202 then 203
103 when 204 then 205
104 when 206 then 207
105 when 208 then 209
106 when 210 then 211
107 when 212 then 213
108 when 214 then 215
109 when 216 then 217
110 when 218 then 219
111 when 220 then 221
112 when 222 then 223
113 when 224 then 225
114 when 226 then 227
115 when 228 then 229
116 when 230 then 231
117 when 232 then 233
118 when 234 then 235
119 when 236 then 237
120 when 238 then 239
121 when 240 then 241
122 when 242 then 243
123 when 244 then 245
124 when 246 then 247
125 when 248 then 249
126 when 250 then 251
127 when 252 then 253
128 when 254 then 255
129 when 256 then 257
130 end x from dual;
when 16 then 17
ERROR at line 9:
ORA-00939: too many arguments for function
SQL> del 129
SQL> /
X
---------- -
Query works on Oracle 9i, but fails on Oracle 10g - puzzling...
In porting an application from Oracle 9i to Oracle 10g, I hit a problem that for a while I assumed was some bug of mine. But I eventually isolated the problem and can reproduce this using a single sql script and then a single delete. The amazing thing is that it works fine on Oracle 9i (always) and fails on Oracle 10g (always).
Have I found a bug? (I would be pretty amazed).
Here's the situation. I have four tables and a trigger set on one of those tables.
The tables are configured so that there is the "parent" table (A). Table B has a foreign key dependency on A's primary key, with "on delete cascade". Table B also has a trigger that runs on the delete. Table C (which has no data) has an integrity constraint on A's primary key. Table D holds information used by the trigger to determine if/when table C should be dropped. (I have a script that sets all this up).
After setting up the tables and the few data records needed, I delete a record from Table A. This causes the records in Table B to be deleted. That fires the trigger, which determines that Table C can be dropped, so the trigger drops Table C. Then, Oracle decides it still needs to check the integrity constraint on Table C (after all, C depended on A and we have deleted a record in A). Oracle then issues a query against table C, but of course table C has already been dropped and an error results.
The exact same script followed by the delete works fine on Oracle 9i. Is this a bug or is this a documented change in behavior? Any known workarounds? Unfortunately, the application needs all the integrity constraints that are present in the schema and also runs on SQL Server, so modifications in the integrity constraints are probably not what I am seeking).
Thanks so much!
RBI wasn't sure how to post the script, but it is short enough to include below. Many thanks for the quick response.
To connect the script below to my original post, the names are:
Table A = OT_AW_PROCESSDEF
Table B = OT_AW_PROCESS_APPDATADEF
Table C = OT_AW_AD_OneLoop_1
Table D = OT_AW_APPDATA_TABLEINFO
The trigger is also included in the script. After running this script, the command:
delete from OT_AW_ProcessDef where processdefId = 101
will cause the failure on Oracle10g, but succeeds on Oracle 9i.
Thanks again!
RB
/* *********************** CLEAN UP ********************************** */
/* Order the dropping of objects in reverse of creation */
DROP TABLE OT_AW_AD_OneLoop_1 CASCADE CONSTRAINTS
DROP TABLE OT_AW_PROCESS_APPDATADEF CASCADE CONSTRAINTS
DROP TABLE OT_AW_APPDATA_TABLEINFO CASCADE CONSTRAINTS
DROP TABLE OT_AW_PROCESSDEF CASCADE CONSTRAINTS
/* ******************* DATA TABLES *********************************** */
/* OT_AW_PROCESSDEF(Process Definition) Table */
/* ********** NOTE: OT_AW_PROCESSDEF and AW_PROCESS TABLES SHOULD ALWAYS HAVE THE SAME SET OF COLUMNS ********* */
create table OT_AW_PROCESSDEF (
processDefId NUMBER /* Id for the process definition */
, processDefName NVARCHAR2(255) /* Name of the process definition */
, CONSTRAINT OT_AW_PROCESSDEF_PK PRIMARY KEY(processDefId)
insert into OT_AW_PROCESSDEF (
processDefId, processDefName
values (
1, 'ADHOC'
/* OT_AW_APPDATA_TABLEINFO(List of all application Data tables in the system) Table */
create table OT_AW_APPDATA_TABLEINFO (
namespace VARCHAR2(65) NOT NULL, /* name of the namespace to which it belongs */
tableName VARCHAR2(128) , /* Name of the appdata table */
adLevel NUMBER(38) NOT NULL /* Appdata table level: 0=>PROCESS, 1=>CONVERSATION */
, CONSTRAINT OT_AW_APPDATA_TABLEINFO_PK PRIMARY KEY ( tableName )
, CONSTRAINT OT_AW_APPDATA_TABLEINFO_UNQ UNIQUE( namespace, tableName, adLevel )
/* OT_AW_PROCESS_APPDATADEF(Process level application data definition) Table */
create table OT_AW_PROCESS_APPDATADEF (
processDefId NUMBER NOT NULL /* Id for the process definition */
, name VARCHAR2(65) NOT NULL /* Name of the application data field, This name may be pointing to a shared namespace field */
, tableName VARCHAR2(128) /* Name of the table that holds the value for the field, may be same as local namespace table name */
, namespace VARCHAR2(65) NOT NULL /* Name of the namespace to which this field belongs */
, mappedNamespace VARCHAR2(65) null /* Name of the shared namespace to which this field is mapped, if there is any mapping */
, CONSTRAINT OT_AW_PROCESS_APPDATADEF_PK PRIMARY KEY (namespace, processDefId, name)
, CONSTRAINT OT_AW_PROCESS_APPDATADEF_FK FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) on delete cascade
CREATE TABLE OT_AW_AD_OneLoop_1(processDefId number , processId number ,FromRole number null, ToRole number null, Anyone number null,
CONSTRAINT OT_AW_AD_OneLoop_1_FK1 FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) )
/* TRIGGERS */
CREATE OR REPLACE TRIGGER OT_AW_PROCESS_APPDATADEF_DEL
AFTER DELETE ON OT_AW_PROCESS_APPDATADEF
FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
tableName_var OT_AW_PROCESS_APPDATADEF.tableName%TYPE;
tempStr_var varchar2(128) :=null;
deletedId OT_AW_PROCESS_APPDATADEF.processDefId%TYPE;
deletedMNsp OT_AW_PROCESS_APPDATADEF.mappedNamespace%TYPE;
numReferences number :=-1;
tableExists number :=0;
CURSOR ADPTable_cursor
IS
SELECT apa.tableName, apa.processDefId, apa.mappedNamespace
FROM OT_AW_PROCESS_APPDATADEF apa
WHERE apa.tableName = :old.tableName
AND apa.processDefId = :old.processDefId;
BEGIN
dbms_output.put_line('Starting TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
OPEN ADPTable_cursor;
LOOP
FETCH ADPTable_cursor
INTO tableName_var, deletedId, deletedMNsp;
EXIT WHEN ADPTable_cursor%NOTFOUND;
BEGIN
IF (deletedMNsp IS NULL) THEN
BEGIN
select count(*) into numReferences from OT_AW_PROCESS_APPDATADEF where tableName = tableName_var
and processDefId <> deletedId;
IF ( numReferences = 0 ) THEN
BEGIN
SELECT count(*) INTO tableExists FROM OT_AW_APPDATA_TABLEINFO where
tableName=tableName_var;
IF (tableExists > 0) THEN
BEGIN
--dbms_output.put_line('About to alter first table');
-- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK1';
--dbms_output.put_line('About to alter second table');
-- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK2';
dbms_output.put_line('About to drop table named: ' || tableName_var);
tempStr_var := 'DROP TABLE ' || tableName_var;
EXECUTE IMMEDIATE tempStr_var;
dbms_output.put_line(tempStr_var);
dbms_output.put_line('Table dropped');
--dbms_output.put_line('Not dropping table now');
END;
END IF;
delete from OT_AW_APPDATA_TABLEINFO where
tableName=tableName_var;
dbms_output.put_line('OT_AW_APPDATA_TABLEINFO updated');
END;
END IF;
END;
END IF;
END;
END LOOP;
dbms_output.put_line('Loop ended');
CLOSE ADPTable_cursor;
dbms_output.put_line('Cursor closed');
COMMIT WORK;
dbms_output.put_line('Work committed');
dbms_output.put_line('Ending TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
END;
show errors;
/* Set up data to simulate the creation of OT_AW_AD_OneLoop_1 */
insert into OT_AW_PROCESSDEF (
processDefId, processDefName
values (
101, 'OneLoop'
insert into OT_AW_PROCESS_APPDATADEF (
processDefId, name, tableName, namespace
values (
101, 'FromRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
insert into OT_AW_PROCESS_APPDATADEF (
processDefId, name, tableName, namespace
values (
101, 'ToRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
insert into OT_AW_APPDATA_TABLEINFO (
namespace, tablename, adlevel
values (
'OneLoop', 'OT_AW_AD_OneLoop_1', 0
/ -
Oracle 11g- Straing behaviour of query after importing from Oracle 10g
Hi,
I have a table in Oracle 10g as follows:
Create Table xyz (col1 varchar2(50), col2 varchar2(50));
With following Data
Col1 Col2
A 320
A 110
A 290
A 380
B ABC
B 256
B LMN
I am running following Query
select * from xyz
Where Col1='A' and Col2=110
It works fine. But when I export this table and import it in Oracle 11g. It says invlid identifier.
But if I enclose 110 in single quotes. It works fine.
Also If I recreate this table in Oracle 11g like
Create table xyz1
as select * from xyz;
Now alos I am able to run this query smoothly.
select * from xyz1
Where Col1='A' and Col2=110
What is wrong exporting this table from 10g to 11g.
Any comments/suggestion??
AarbiThe check in your where clause
Col2=110Is comparing a string (Col2 is defined as a VARCHAR) with a numeric literal, so there will be an implicit conversion taking place from character to number. The query then fails due to the B LMN row when 'LMN' fails number conversion.
I'm guessing there was there an index on the table in your 10g installation which would allow the query to be satisfied without checking the B ABC or B LMN rows but is not present or not used in the 11g installation so a full table scan results in an attempt to convert 'ABC' and 'LMN' to a number. Check the explain plans.
Or it could even just be a difference in the order in which the two conditions in the where clause are evaulated between the two versions.
The solution, as you have already found is to do a string comparision
Col2='110'Edited by: Cyn on Dec 7, 2009 12:38 PM -
Oracle 10g vs Oracle 11g query performance
Hi everyone,
We are moving from Oracle 10g to Oracle 11g database.
I have a query which in Oracle 1g takes 85 seconds to run, but when I run the same query in Oracle 11g database, it takes 635 seconds.
I have confirmed that all indexes on tables involved are enabled.
Does anyone have any pointers, what should I look into. I have compared explain plans and clearly they are different. Oracle 11g is taking a different approach than Oracle 1g.
ThanksPl post details of OS versions, exact database versions (to 4 digits) and init.ora parameters of the 10g and 11g databases. Have statistics been gathered after the upgrade ?
For posting tuning requests, pl see these threads
HOW TO: Post a SQL statement tuning request - template posting
When your query takes too long ...
Pl see if the SQL Performance Analyzer can help - MOS Doc 562899.1 (TESTING SQL PERFORMANCE IMPACT OF AN ORACLE 9i TO ORACLE DATABASE 10g RELEASE 2 UPGRADE WITH SQL PERFORMANCE ANALYZER)
HTH
Srini -
SQL QUERY to create new schema in Oracle 10g Express
Can anyone provide the SQL query to create a new schema in Oracle 10g Express edition.
Can anyone provide a SQl query to create a
schema/user named 'test' with username as 'system'
and password as 'manager'system user is created during database creation, it's internal Oracle admin user that shouldn't be used as schema holder.
In Oracle database, Oracle user is schema holder there's no seperate schema name to be defined other than username. -
APEX 3.2 -ORACLE 10G - PIVOT QUERY
Hello, i searched around the forum and i cound't find an answer to this specific matter, although i saw some replies that were close...
i need to creat a form based on a pivot query. but oracle 10g doesn't support that feature so i hope someone can help me.
my problem is that the number of columns will be variable. here's an example:
ORIGINAL TABLE
NAME KMS VEHICLE
Joe 100 AUDI
Tom 300 VW
Mark 150 FORD
Ann 250 FORD
Joe 200 VW
Tom 123 AUDI
Mark 345 AUDI
Ann 45 VW
Joe 6 FORD
Tom 67 FORD
Mark 46 VW
Ann 99 AUDI
DESIRED RESULT
Joe Tom Mark Ann Vehicle
100 123 345 99 AUDI
6 67 150 250 FORD
200 300 46 45 VW
the new columns will be the values in the old NAME column. BUT these values are variable. today its joe,tom,mark and ann tomorrow it could be silvia, tony,richard,harry , william and jane. this means the usuall replies i saw, using MAX and DECODE will not apply because i never know what values or how many values are in this column. with pivot i can get this done.... how can i do this in oracle 10g? is there a way to creat a ser function Pivot somehow? ideas?
thanks!
Mark Pereira
Edited by: 899716 on Jul 18, 2012 12:02 PMThis is the Oracle Forms forum. Post your question in the SQL forum.
Tip: check the latest Oracle Magazine (July/August 2012). There is an article by Tom Kyte about the same question.
http://www.oracle.com/technetwork/oramag/magazine/home/index.html
Maybe you are looking for
-
File Adapter - Native Format Builder
Dear All, In File Adapter - Native Format Builder exists option "Number of rows to skip". But this means how many rows from beginning of file to skip, can somebody help to define how to skip n rows from the end of file. Thanks in advance!
-
I have just had my computer fixed because of viruses and now my itunes will not open. It keeps coming up with the message 'itunes has encountered a problem etc.'. Also my library, apps etc will not open. Any suggestions please!
-
Po number as assignment number for each item in MIR4 using substitution
Hi All, Using substitution rule in GGB1 iam getting assignment number as PO number only for GL documents. But i need the same PO number as assignment number for cleared item documents... iam getting YYYYMMDD field as assignment number for each line i
-
Checking for duplicates in my library and an external photo collection?
Hi So I have imported a large amount of my photo collection into Aperture however due to my filing system on my mac being really bad I have ended up with a large folder full of sub folders and lots of photos. Some of the photos in this folder have al
-
Suggestions for new ultrabook for audio etc
I'm shopping for a new 13" ultrabook and I wanted to see what others here are using. I am a bit unsure about whether I need to have a discrete video card in order to have the portable productivity workstation I need because I've been reading that the