Need help - multilevel nested table - create table problem
Hello
My version of oracle db: 11g
I just created a table that contains a nested multi-level table.
Here is the code:
create or replace type sdef_t_nt_empNames21 is table of the varchar2 (50);
create or replace type sdef_ot_SCmarks21 as an object (number of physics, chemistry number, number of Biology);
create or replace type sdef_t_nt_SCmarks21 is table of the sdef_ot_SCmarks21;
create or replace type sdef_ot_allsubmarks21 as an object (eid, eng, math, sc sdef_t_nt_SCmarks21 number number);
create or replace type sdef_t_nt_dep_m_info21 is table of the sdef_ot_allsubmarks21;
create the table nt_dep21
(number of fact
, dname varchar2 (50)
c_sdef_t_nt_empNames21 sdef_t_nt_empNames21
c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)
nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store
store table nested like NT_c_sdef_t_nt_dep_m_info21; c_sdef_t_nt_dep_m_info21 <-I know that the problem is here.
TRACE OF THE ERROR:
Error at startup on line: 13 in the command.
create the table nt_dep21
(number of fact
, dname varchar2 (50)
c_sdef_t_nt_empNames21 sdef_t_nt_empNames21
c_sdef_t_nt_dep_m_info21 sdef_t_nt_dep_m_info21)
nested as NT_c_sdef_t_nt_empNames21 table c_sdef_t_nt_empNames21 store
Nested table c_sdef_t_nt_dep_m_info21 (sdef_t_nt_SCmarks21) store as NT_c_sdef_t_nt_dep_m_info21
Error report-
SQL error: ORA-00904: invalid identifier
00904, 00000 - '% s: invalid identifier '.
* Cause:
* Action:
PS: I'm just solve a problem given to me by some1, is not a practical implementation, I'm just trying to get through
I'm sure that some1 could help me with this, I have searched a lot of this problem but could not find my answer, please help me.
Concerning
Rahul
SQL > create table (nt_dep21)
Did number 2,
3 dname varchar2 (50).
4 c_sdef_t_nt_empNames21 sdef_t_nt_empNames21,
c_sdef_t_nt_dep_m_info21 5 sdef_t_nt_dep_m_info21
6 )
store c_sdef_t_nt_empNames21 7 nested as NT_c_sdef_t_nt_empNames21 table
store c_sdef_t_nt_dep_m_info21 8 table nested as NT_c_sdef_t_nt_dep_m_info21)
9 table nested as NT_sc sc store
10 )
11.
Table created.
SQL >
SY.
Tags: Database
Similar Questions
-
Format an array of multilevel nested table object in a TABLE
DB: Oracle 11 g 2
Platform: client windows 7
Hello
I have a table of multilevel nested table object.
{code}
CREATE OR REPLACE TYPE OBJ_1 AS OBJECT)
NUMBER of col_1,
col_2 VARCHAR2 (56),
col_3 VARCHAR2 (256)
);
CREATE OR REPLACE TYPE ARR_1 AS TABLE OBJ_1;
CREATE OR REPLACE TYPE OBJ_2 AS OBJECT)
NUMBER of col_4
col_5 Number (15),
col_6 NUMBER (1).
col_7 NUMBER (1).
col_8 VARCHAR2 (56),
col_arr ARR_1
);
CREATE OR REPLACE TYPE ARR_2 AS TABLE OBJ_2;
{code}
I want to convert this table format - I need to feed in a program. expected release:
--------------------------------------------------------------------------------
col_4 col_5 col_6 col_7 col_8 col_1, col_2 col_3
--------------------------------------------------------------------------------
1 2 3 4 5 1 2 3
1 2 3 4 5 4 5 6
The Toad, the following query creates the output:
{code}
Select *.
table (ARR_2 (OBJ_2 (1, 2, 3, 4, '5', ARR_1 (OBJ_1 (1,2, '3'))),))
OBJ_2 (1, 2, 3, 4, '5', ARR_1 (OBJ_1 (4.5, '6')))
--------------------------------------------------------------------
col_4 col_5 col_6 col_7 col_8 col_arr
--------------------------------------------------------------------
1 2 3 4 5 (DATASET)
1 2 3 4 5 (DATASET)
{code}
Where (DATASET) is the inner nested table. So I thought I'd add a level to "function table" will do the job, but NO, mistake.
{code}
Select * from table)
Select *.
table (ARR_2 (OBJ_2 (1, 2, 3, 4, '5', ARR_1 (OBJ_1 (1,2, '3'))),))
OBJ_2 (1, 2, 3, 4, '5', ARR_1 (OBJ_1 (4.5, '6')))
);
Error: ORA-02324: more than one column in THE subquery SELECT list
{code}
Any suggestion?
Thank you.
You just need to join another TABLE operator who breast COL_ARR:
SQL > with tmp (obj) as)
2. Select (ARR_2)
OBJ_2 3 (1, 2, 3, 4, '5', ARR_1 (OBJ_1 (1,2, '3')));
4 OBJ_2 (1, 2, 3, 4, '5', ARR_1 (OBJ_1 (4.5, '6')))
5 )
6 double
7)
8. Select t2.col_4, t2.col_5, t2.col_6, t2.col_7, t2.col_8
9, t1.col_1, t1.col_2, t1.col_3
tmp 10 t
11, t2 table (t.obj)
12, t1 table (t2.col_arr)
13;
COL_4 COL_5 COL_6 COL_7 COL_8 COL_1, COL_2 COL_3
---------- ---------------- ----- ----- -------- ---------- -------- -------
1 2 3 4 5 1 2 3
1 2 3 4 5 4 5 6
-
Error in initialization of multilevel nested table type
Hello
Database version: Oracle 11 g R2
I am creating a complex process I need to create complex nested table types and use them in code.
{code}
CREATE or REPLACE TYPE ws_data_compare_rt
AS AN OBJECT
(
external_web_service_id NUMBER (10),
service_code VARCHAR2 (30),
ws_bridging_id NUMBER (10),
ws_attribute_name VARCHAR2 (64).
ws_attribute_value VARCHAR2 (32767).
in_source_attribute VARCHAR2 (30),
in_source_value VARCHAR2 (32767).
comparison_rule VARCHAR2 (100)
);
CREATE or REPLACE TYPE ws_data_compare_tt IS TABLE OF THE ws_data_compare_rt;
CREATE or REPLACE TYPE ws_data_compare_master_rt
AS AN OBJECT
(
key_attribute_1 VARCHAR2 (30),
NUMBER of key_attribute1_value
key_attribute_2 VARCHAR2 (30),
NUMBER of key_attribute2_value
m_ws_data_compare_tt ws_data_compare_tt
);
/
CREATE or REPLACE TYPE ws_data_compare_master_tt IS TABLE OF THE ws_data_compare_master_rt;
{code}
The objects have been created successfully. However when I use it in my code, I need to initialize them, but I get an error for the variable of ws_data_compare_master_tt type initialization.
{code}
...
g_ws_data_compare_rt ws_data_compare_rt: = ws_data_compare_rt (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
g_ws_data_compare_tt ws_data_compare_tt: = ws_data_compare_tt();
g_ws_data_compare_master_rt ws_data_compare_master_rt: = ws_data_compare_master_rt (NULL, NULL, NULL, NULL, g_ws_data_compare_tt);
g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();
...
{code}
I'm unable to initialize the variable g_ws_data_compare_master_tt of type ws_data_compare_master_tt that I get the below error.
For PACKAGE BODY UTL compile errors. PKG_WS_UTIL
Error: PLS-00222: no function with name 'WS_DATA_COMPARE_MASTER_TT' does exist in this scope
Line: 28
Text: g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();
Error: PL/SQL: ignored element
Line: 28
Text: g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();
Can someone help me to find out what is the problem?
Thanks in advance.
Kind regards
Natarajan
Ah, I found the problem on my own. It was because of a bad statement similarly variable g_ws_data_compare_master_tt in a table in the specification of the package that was trouble. However I wonder the error returned Oracle was not fully exposed.
Kind regards
Natarajan
-
Hi all
I have a task to insert data in a nested table. First, I'll explain the scenario.
I have 2 table (of patients) and (tumors) that contain medical data on patients with cancer.
The table (of patients) contain the basic information about patients. The table (tumors) contain information about the tumors. each record in the table (the patients) may have one or more records in the table (tumors) using the column (patient_id). I want to transfer data from (of patients) and (tumors) tables to a new table (cancer_patients) that contains a nested table column. so I did the following codeCREATE TABLE "DSS2_MINING"."PATIENTS" ( "PATIENT_ID" VARCHAR2(10 BYTE) NOT NULL ENABLE, "REGISTRY_ID" NUMBER(10,0), "RACE" VARCHAR2(2 BYTE), "SEX" VARCHAR2(1 BYTE), "BIRTHDATE_YEAR" NUMBER(4,0), "NUMBER_OF_PRIMARIES" NUMBER(1,0), "VITAL_STATUS_RECORD" VARCHAR2(1 BYTE), "CAUSE_OF_DEATH" VARCHAR2(5 BYTE), "SURVIVAL_TIME" VARCHAR2(4 BYTE), "SURVIVAL_TIME_FINAL" NUMBER, "SURVIVAL_VARIABLE" VARCHAR2(1 BYTE), CONSTRAINT "PATIENTS_PK" PRIMARY KEY ("PATIENT_ID"); CREATE TABLE "DSS2_MINING"."TUMORS" ( "TUMOR_ID" NUMBER NOT NULL ENABLE, "PATIENT_ID" VARCHAR2(10 BYTE), -- FK "SEER_RECORD_NUMBER" NUMBER, -- This column contain a sequance number of the records for each patients "MARITAL_STATUS" VARCHAR2(1 BYTE), "AGE" NUMBER, "DATE_OF_DIAGNOSIS" DATE, "HISTOLOGY_GROUP" VARCHAR2(2 BYTE), "BEHAVIOR" VARCHAR2(1 BYTE), "GRADE" VARCHAR2(1 BYTE), "DERIVED_AJCC_STAGE_GROUP" VARCHAR2(2 BYTE), "STAGE_OF_CANCER" VARCHAR2(2 BYTE), "RADIATION" VARCHAR2(1 BYTE), "CS_SCHEMA" VARCHAR2(2 BYTE), "FIRST_PRIMARY_IND" VARCHAR2(1 BYTE), "TUMOR_SIZE" NUMBER(4,1), "TUMOR_EXTENSION" VARCHAR2(2 BYTE), "LYMPH_NODES" VARCHAR2(1 BYTE), "NODES_POSITIVE" NUMBER, "ESTROGEN" VARCHAR2(3 BYTE), "PROGESTERONE" VARCHAR2(3 BYTE), "SURGERY" VARCHAR2(2 BYTE), CONSTRAINT "TUMORS_PK" PRIMARY KEY ("TUMOR_ID");
So my problem on the transfer and inserts data, I tried to use the associative array to keep the rows in the table of tumors, but it didn't work. I think that the main problem is that each record in the patient table have multiple records in the table of tumors.create or replace type tumor_object AS object( tumor_id VARCHAR2(1), marital_status VARCHAR2(1), age NUMBER(3), date_of_diagnosis DATE, cs_schema VARCHAR2(2), histology_group VARCHAR2(2), behavior VARCHAR2(1), grade VARCHAR2(1), first_primary_ind VARCHAR2(1), tumor_size NUMBER(4, 1), tumor_extension VARCHAR2(2), lymph_nodes VARCHAR2(1), nodes_positive NUMBER(4), surgery VARCHAR2(2), radiation VARCHAR2(1) ); create or replace type tumor_table as table of tumor_object; CREATE TABLE "DSS2_MINING"."CANCER_PATIENTS" ( "PATIENT_ID" VARCHAR2(10 BYTE) NOT NULL ENABLE, "RACE" VARCHAR2(2 BYTE), "SEX" VARCHAR2(1 BYTE), "NUMBER_OF_PRIMARIES" NUMBER(1,0), "TUMORS" "DSS2_MINING"."TUMOR_TABLE" , "VITAL_STATUS_RECORD" VARCHAR2(1 BYTE), "CAUSE_OF_DEATH" VARCHAR2(5 BYTE), "SURVIVAL_TIME_FINAL" NUMBER, "SURVIVAL_VARIABLE" VARCHAR2(1 BYTE), CONSTRAINT "CANCER_PATIENTS_PK" PRIMARY KEY ("PATIENT_ID") NESTED TABLE "TUMORS" STORE AS "TUMORS_STOR_TABLE"
I hope that if anyone can help in this case or I you know any reference on similar cases
Thank you
A.L
Published by: user9003901 on November 26, 2010 02:48Something like:
INSERT INTO CANCER_PATIENTS SELECT PATIENT_ID, RACE, SEX, NUMBER_OF_PRIMARIES, ( SELECT CAST( COLLECT( TUMOR_OBJECT( TUMOR_ID, MARITAL_STATUS, AGE, DATE_OF_DIAGNOSIS, CS_SCHEMA, HISTOLOGY_GROUP, BEHAVIOR, GRADE, FIRST_PRIMARY_IND, TUMOR_SIZE, TUMOR_EXTENSION, LYMPH_NODES, NODES_POSITIVE, SURGERY , RADIATION ) ) AS TUMOR_TABLE ) FROM "TUMORS" T WHERE T.PATIENT_ID = P.PATIENT_ID ), VITAL_STATUS_RECORD, CAUSE_OF_DEATH, SURVIVAL_TIME_FINAL, SURVIVAL_VARIABLE FROM PATIENTS P /
SY.
P.S. This site has censorship. It replaces the word S E X with *, change it if during the test. -
Well guys I have a table which gives me positive and negative values.
I need to use this table and get 2 new tables, one is the array of positive values, the second is the table with negative values, after that I need to get 2 values of it, one is the sum of all the positive elements and I need to know how much positive elements too.
the second value is the sum of all the negatives and how much negative also.
Example:
Table: 5-12, 2, -3, 4
First table: 5,2,4
First value: 5 + 2 + 4 = 11
Number of items: 3
Second table:-12, -3
Second value:-12+(-3) = - 15
Number of items: 2
Something like that!
Thank you
Here's my version 8.6
-
Windows - WDS deployment services. Need help please for password of mystery problem
Hello
Just need help or advice about a problem that's been here recently. I'll give you the sequence of events so that you can better understand.
An audit has been ordered here where I work and as I had just started working here 3 months ago, I decided to lock the network and make sure that everything was safe.
There is no service account, and the administrator account was used to run all 3rd party applications, so you can imagine what happened when I changed the admin password.
Before I did I created service accounts and exchanged them one by one, but the only problem that remains is WDS. When we PXE boot and deploy the image it is the language selection screen and also ask the domain credentials of junction. I have setup a DomainOverlord service account, checked and done so he could join machines to the domain and replaced the old administrator username and password in the AutoUnattend.xml file but it seems not to pick up the password.
Is there something that I am missing? Is it possible to check which file AutoUnattend.xml using the WIM file? The person who told of course establish a bit messy and I can see at 8-9 AutoUnattend.xml in random places on the server. I changed the details in each one, but it is not always the image itself.
Any help would be great, the guy in front of me got me fired, I begin to understand why!
Thank you
Luke Bayley
Ask in the forum Windows Server:
http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer -
Need help with a &; quot; simple &; quot; problem :)
Hello everyone!
I would be very happy if someone could help me! I created a test with AW and it works very well. My problem is that in the file ".txt" is created (appendextfile), 'firsttrycorrect' responses continue to add themselves among the exercises. How can I do to set the meter to zero, so that each exercise has is own number of right answers? What I have to restart each time the file? !
Thanks in advance...Just to be clear: you want to use the FirstTryCorrect variable;
the FirstTryCorrect variable to reset when you access the following year? Try
Initialize (FirstTryCorrect) at the beginning of the next fiscal year.HTH;
Amy
"oukaischunomai" wrote in message
News:fmo42t$s7o$1@forums. Macromedia.com...
> Thx reading me :) I'll try to be clear, but I'm sorry that I don't know AW
7 >
> very well and my English is not good...! If I create a program:
> first
> first, the person must enter its name ("username") and a .txt file
> is
> created in his name. The person must then click on a button
> to
> choose what he or she wants to study (he or she has the choice between 3
> exercises:
(> active/passive/parent phrases). In all the exercises, the person must
> read a
> wrote the sentence and then choose the image corresponding to the sentence
> between 4
> choice and finally click on it (I created an interaction and 3 answers
> have
(> the status of 'bad' and only 1 has the 'correct' status). Then it goes to
> the
> following sentence. At the end of each fiscal year (active/passive/parent), the
> results are documented in the file .txt created previously (I put simply:)
> AppendExtFile (username ^ ".txt";) FirstTryCorrect)), so I can have a
> your comments
> on the performance of the person... I hope it is clear enough for the
> time? :) My problem is: when the person starts the 2nd exercise
> (passive).
> maintain the correct answers in addition to them from 1
> exercise
> (active). So my question is, how can I do, for the good answer «»
' > counter "is back to 0 at the beginning of each new fiscal year?
> -
I'm forced to install CentOs on my Macbook using a machine virtual (VMWare, which is what I downloaded my teacher recommended). It's for my first class of operating systems, so bare with me because I don't know anything about operating systems (except about how to use Windows and my Macbook). I am also a daughter, what makes my same technical knowledge that much more rare. However, I am eager to learn...
In any case, I downloaded them both. When I launch Fusion, I choose the file
> New> install Windows or another OS on a virtual machine> continue without disk> click on the button that says 'Operating system installation disc using image file'> then I select the appropriate iso CentOS (CentOS - 5.4 - i386-bin-1of6) file> continue> drop down lists, I choose LINUX as operating system and Red Hat Enterprise Linux 5 as my Version> continue-> finish (no customization settings). It appears the screen of CentOS and I am invited by a text asking me if I want to install in text or graphics mode. (Don't know what to do here, but I select the graph). A bunch of white text scroll a screen of black background, then a blue screen shows up saying: 'Welcome to CentOS' at the top and a gray screen that says "to start testing CD media before installation OK press. Choose Ignore to ignore the media test and launch the installation. "I click on the red button (even once, if it is incorrect, let me know). A few rows of white text on black background (from anaconda... something on a video card...) then a nice graphic display of CentOS which I click NEXT. I then select English as my tongue (twice) and I gives me the message:"The partition table on device sda (VMware, VMware Virtual S 20473 MB) was unreadable. To create new partitions, it must be initialized, cauing the loss of all DATA on this drive. This operation will replace all choice on what players to ignore previous installation. You would like to initialize this drive, erasing all THE DATA? »
I have no idea what to do here. I googled the message and others have been too, but they can talk about some hard file (and I have no idea what it is, and I can't seem to find mine).
I can't lose what's on my hard drive (my school, music, photos, applications, files etc.). Clicking YES will erase my HD? I'm terribly afraid. I need to get this thing installed so I can do my operating systems class work, but I don't know if I did the installation correctly so far and especially, what to click at this point. Can someone help me out please (I spent 4 hours on this one today. "I have no one else to ask)? Finally, the installation is almost done after this step?
Any help at all would be so greatly appreciated.
I do not use Fusion, but I have VMware Workstation on Windows. I went through the same process that you went through. The answer to your question is that when you choose the operating system you install and you choose the option for the installation disc, it creates a virtual hard drive for you, size 20 GB. When they ask you to erase the hard drive, it's clear that virtual you create, not your actual computer hard drive. You can check by looking at the properties of the hard drive on your computer. It's probably 250 GB or 500 GB or something big like this. The CentOS WARNING speaks of a 20 GB hard drive, which is the size of the disk that VMware Fusion (and Workstation) create for CentOS.
-
Need help with graph/table
Heey everybody,
I am currently using a Spider8 and Labview to get data from the sensors, after I use Labview to process the data in charts or graphs. Alltough I have 2 small problems using a table/chart:
1: for some graphics I want to use 1 y axis (example: volts or current) and 1 x-axis, time. I want this time to be like clockwork that counts only the seconds (example: 0-100 sec), using absolute time or relative, for formatting is not an option because they rely much too strong/fast. There is an example of this type of charts in the Appendix: measurement of time current vs.
2: for most of the other tables/graphs I want to use several axis y (example for a motor: current, RPM and torque) and I want to use a category axis that may go 'back' (example for a motor: rotations). There is an example of this type of charts in the Appendix: measurement of torque.
I have no idea how to make good sense, so your help is welcome
Thank you!
Hi grasman,.
have you read jcarmodys message on how to apply a trace on a scale there?
See the attachment on how to draw 2 curves on a xy chart and attach each parcel on a scale. I strictly followed the message context help chart and jcarmodys...
I would also say to stay away from express screws: they tend to make more problems than to provide aid. You are more involved in conversions of type (to/from DDT) - using simple son gives you simply more to control what's happening in your code!
-
Need help with a table, someone pls help8-)
The problem I have right now is that I want to display variable myblock low 10 times and then test it for collison,.
I use the variable to store the blocks, pls I apologize because I am new to this, if I put manally the variable i of lets say 1 and 2
for collison, and then test it works, but when I use the loop for, it only detects that an object in the table, I think that there is something
simple probably missing an additional variable, for example as you can see in the code that I am trying to use the 'i' to replace for example addChild(blockarray[1]);
I put it manually to display two blocks in the code below, collison detection works, but when I want to use a loop to view and test the collison
It takes only one of the blocks, don't know if it's because that variable i figure to 0 in the loop for, any help would be greatly appreciated, this is my first post here, as I'm new to Actionscript, ty for reading8-)
var thehero:BlueBlock = new BlueBlock;
Thehero.x = 20;
Thehero.y = 20;
addChild (thehero);
var blockarray = new Array()for (var i: Number = 0; i < 10; i ++)
This is where I place my blocks
{
var myblock:BlueBlock = new BlueBlock;
[i] blockarray = myblock;
blockarray [i] .x = Math.random () * 500;
blockarray [i] there = Math.random () * 400;
trace (blockarray [i]);
blockarray.push (MyBlock);
addChild (blockarray [i]);
}
addChild(blockarray[1]);
addChild(blockarray[2]);Look for the keyboard events such as you pressed the arrow keys
stage.addEventListener (KeyboardEvent.KEY_DOWN, myKeyDown);
stage.addEventListener (Event.ENTER_FRAME, blockcollision);function myKeyDown (e:KeyboardEvent) {}
If (e.keyCode == Keyboard.LEFT) {}
Thehero.x-= 5;
}If (e.keyCode == Keyboard.RIGHT) {}
Thehero.x += 5;
}If (e.keyCode == Keyboard.UP) {}
Thehero.y-= 5;
}If (e.keyCode == Keyboard.DOWN) {}
Thehero.y += 5;
}
}
function blockcollision(e:Event):void {}
If (thehero.hitTestObject(blockarray[1]))
{
trace ("hit");
}
If (thehero.hitTestObject(blockarray[2]))
{
trace ("hit");
}
}Try this:
function blockcollision(e:Event):void { for (var prop:String in blockarray) { if (thehero.hitTestObject(blockarray[prop])) { trace("Hit", blockarray[prop]); } } }
-
Paging query needed help for large table - force a different index
I use a slight modification of the pagination to be completed request to ask Tom: [http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html]
Mine looks like this to extract the first 100 lines of everyone whose last name Smith, ordered by join date:
The difference between this and ask Tom is my innermost query returns just the ROWID. Then, in the outermost query we associate him returned to the members table ROWID, after that we have cut the ROWID down to only the 100 piece we want. This makes it MUCH more (verifiable) fast on our large tables, because it is able to use the index on the innermost query (well... to read more).SELECT members.* FROM members, ( SELECT RID, rownum rnum FROM ( SELECT rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate ) WHERE rownum <= 100 ) WHERE rnum >= 1 and RID = members.rowid
The problem I have is this:
It will use the index for the column predicate (last_name) rather than the unique index that I defined for the column joindate (joindate, sequence). (Verifiable with explain plan). It is much slower this way on a large table. So I can reference using one of the following methods:SELECT rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate
SELECT /*+ index(members, joindate_idx) */ rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate
Whatever it is, it now uses the index of the column ORDER BY (joindate_idx), so now it's much faster there not to sort (remember, VERY large table, millions of records). If it sounds good. But now, on my outermost query, I join the rowid with the significant data in the members table columns, as commented below:SELECT /*+ first_rows(100) */ rowid as RID FROM members WHERE last_name = 'Smith' ORDER BY joindate
As soon as I did this join, this goes back to the use of the index of predicate (last_name) and perform the sort once he finds all the corresponding values (which can be a lot in this table, there is a cardinality high on some columns).SELECT members.* -- Select all data from members table FROM members, -- members table added to FROM clause ( SELECT RID, rownum rnum FROM ( SELECT /*+ index(members, joindate_idx) */ rowid as RID -- Hint is ignored now that I am joining in the outer query FROM members WHERE last_name = 'Smith' ORDER BY joindate ) WHERE rownum <= 100 ) WHERE rnum >= 1 and RID = members.rowid -- Merge the members table on the rowid we pulled from the inner queries
My question therefore, in the query full above, is it possible that I can get to use the ORDER of indexing BY column to prevent having to sort? The join is what makes go back to using the predicate index, even with notes. Remove the join and just return the ROWID for these 100 records and it flies, even over 10 millions of documents.
It would be great if there was some generic hint that could accomplish this, such as if we change the table/column/index, do not change the indicator (indicator FIRST_ROWS is a good example of this, while the INDEX indicator is the opposite), but any help would be appreciated. I can provide explain plans for the foregoing, if necessary.
Thank you!
-
Need help with performance tables very very huge...
Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production.
My DB has many tables and which I am interested in getting sales and product data.
Select / * parallel 32 * / count (1))
Select / * parallel 32 * / separate product pd, s sale prod_code
where pd.prod_opt_cd is NULL
and s.sales_id = pd.sales_id
and s.creation_dts between to_date ('01-07-2012', "YYYY-MM-DD") and
TO_DATE ('2012-07-31', "YYYY-MM-DD")
);
More information-
Total of lines in the sales table - 18001217
Total of lines in the product table - 411800392
creation_dts don't have clue on this subject.
I started the query in the background, but after 30 hours, I saw the error saying-
ORA-01555: snapshot too old: rollback segment 153 with name number
Is there another way to get over the optimized data?>
Select / * parallel 32 * / count (1))
>
If you try to use a PARALLEL index and then useselect /*+parallel (32) */count(1) from (
See section PARALLEL to the doc of the SQL language indication
http://docs.Oracle.com/CD/E11882_01/server.112/e26088/sql_elements006.htm#sthref669 -
Update sql need help for hierarchy table
I'm trying to update the raw field based on each unit Qty is the appearance of the table.
slevel | Manager | seller | unit_qty | gross Qty
0 | Mary | Mary | 1. 1
.1 | Mary | Lynn | 3. null
.1 | Mary | Betty | 2. null
.1 | Mary | Alice | 2. null
.. 2. Alice | Susan | 1. null
.1 | Mary | Amy | 4. null
I'd like the table to look like this after the update, with the values
slevel | Manager | seller | unit_qty | gross Qty
0 | Mary | Mary | 1. 1
.1 | Mary | Lynn | 3. 3 * 1 = {color: #ff0000} 3 {color}
.1 | Mary | Betty | 2. 2 * 1 = {color: #ff0000} 2 {color}
.1 | Mary | Alice | 2. {color: #008000} 2 * 1 {color} = {color: #ff0000} 2 {color}
.. 2. Alice | Susan | {color: #0000ff} 1 {color} | {color: #008000} 2 * 1 {color} {color: #0000ff} * 1 {color} = {color: #ff0000} 2 {color}
.1 | Mary | Amy | 4. 4 * 1 = {color: #ff0000} 4
{color}
It is the SQL, I've tried to use unsuccessfully.
Update table set gross_qty = unit_qty * ({color: #ff0000} select gross_qty from table {color})
({color: #ff0000} where Manager = seller {color})
where slevel & gt; 0
This is not the same thing?
UPDATE vendor s1
SET s1.gross_qty =
(CASE
WHEN s1.slevel = 0 THEN s1.unit_qty
WHEN s1.slevel > 0 THEN
S1.unit_qty * (SELECT SELLER s2 WHERE s2.client = s1.manager s2.gross_qty)
(END);I wrote here a basis of hierarchical queries:
http://blog.mclaughlinsoftware.com/hierarchical-queries-basics/
It could be that useful...
-
Need help! How to create a new page?
Hello
I'm in the middle of creating a business presentation and I need to chain it all carefully in adobe reader8, the problem is, I have no idea how to create new pages on this subject, and can therefore show coverage of said presentation. Help, please?
Not possible with Adobe Reader.
-
Need help to understand the security sandbox problem after changing Web host
I am trying to switch my Web host 1 & 1 shared hosting to an IP address with a small company that specializes in Drupal sites and doesn't know much about flash dedicated.
1 & 1 is always the Registrar for my domain, but I 'tidied up' YourGods.com on holistic servers and "stressed" my site DomainNameServers holistic rather than servers 1 & 1.
After doing this, my Flash site (which is based on the Gaia framework) has stopped working, and the Flashplayer debugger, gave me the following errors:
Error: Cannot load the xmlsocket://127.0.0.1:5800 policy file
Error: Request for resource at the xmlsocket://127.0.0.1:5800 by the http://www.yourgods.com/bin/main.swf applicant failed because the server is not reachable.
Security Sandbox Violation
Connection to 127.0.0.1:5800 broken - not allowed to http://www.yourgods.com/bin/main.swf
Someone to help me on another thread thought 127.0.0.1:5800 could mean that the problem had to do with my ways and I tried to access something on my local computer, rather than being a matter of cross-domain standard where one server was attempting to access files on another server without report.
If anyone can clarify this?
I googled 127.0.0.1:5800 and found some stuff on the loops between a server and the original computer, but I don't really know how to put it all together.
Is it possible (with the flash debugger or other software) to step through my code actionscript with periodic break points so I can understand which line is causing the problem?
Or a way to find out if there is a problem between holistic and my local or holistic computer and the 1 & 1 servers?
Thanks for any help.
127.0.0.1 is your local development server. It seems that your application is trying to access this IP address and unable to. You need to look at the source and find where it accesses to this and replace it with the IP address.
Maybe you are looking for
-
15 - inch MacBook Pro or iMac?
Hi, I bought a new MacBook Pro a few months back for use with logic, I also bought a 27 "Thunderbolt display. Now I'm worried if I should have opted for the maxed on high spec iMac 27 with 32 GB of RAM? I will have no problem, but I recorded only 2 o
-
display raster scan of the 2D array
Hi all I am very new to LabVIEW and I was just wondering how to make a raster scanning of a given 2D array. Normal passage of table 2D via loops nested sequential indexing results and show items on an indicator gives 1st line column 1 in the end... 2
-
How can I change the settings on my inspiron1750 to close automatically after one minute
Well, the screen goes black
-
Power off the computer problems
Shut down the computer, and then become a computer restart. And not close to turn the computer off by pressing the CPU instead. How about the problems?
-
Driver IDT audio in Windows 8.1 for DV6-6140us
Hi brothers! i cant find IDT audio driver Windows 8.1 for DV6-6140us in the website of hp, I'm from Argentina. all solutions? I have no sound in my laptop.