START WITH and CONNECT BY in Oracle SQL (hierarchical)
Hi, the original table as belowCustomer_ID Account_ID Paying_Account_ID Parent_Account_ID Company_ID
158 158 158 158 0
159 159 158 158 0
160 160 158 158 0
181 181 181 181 0
183 183 183 183 0
24669 24669 24669 24669 0
24671 24671 24671 24669 0
24670 24670 24670 24669 0
3385127 3385127 3385127 24670 0
To identify the hierarchical relationship of the data, which are PARENT_ACCOUNT_ID & ACCOUNT_ID, here's the query I used. select lpad(' ', 2*level) || A.ACCOUNT_ID AS LEVEL_LABEL, CONNECT_BY_ISCYCLE "Cycle", LEVEL, A.* from ACCOUNT A
START WITH parent_account_id = account_id
CONNECT BY NOCYCLE PRIOR A.ACCOUNT_ID = A.PARENT_ACCOUNT_ID
AND account_id != parent_account_id
;
It is the result of the queryLevel_Label Level Cycle Customer_ID Account_ID Paying_Account_ID Parent_Account_ID Company_ID
158 1 0 158 158 158 158 0
159 2 0 159 159 158 158 0
160 2 0 160 160 158 158 0
181 1 0 181 181 181 181 0
183 1 0 183 183 183 183 0
24669 1 0 24669 24669 24669 24669 0
24671 2 0 24671 24671 24671 24669 0
24670 2 0 24670 24670 24670 24669 0
3385127 3 0 3385127 3385127 3385127 24670 0
My question is how can I changed the query to calculate the values for:My_Total_PR - number of my accounts to child PR which do not include himself.
Total_PR - Total number of accounts PR in the overall structure
My_Total_NPR - number of my accounts of child NPR which do not include himself.
Total_NPR - Total number of accounts NPR in the overall structure
* PR stand for responsible for payment, for example the responsible account payment 158 158 (Paying_Account_ID), therefore the Total_PR to 158 is 3 (158, 159, 160)
* NPR stand responsible for Non-payment, for example the responsible account payment 159 is 158 (Paying_Account_ID), so the Total_NPR for 159 1
This is the expected result, any advice appreciated. Thank you
Level_Label Level Cycle My_Total_PR Total_PR My_Total_NPR Total_NPR Paying_Account
158 1 0 2 3 0 0 158
159 2 0 0 0 0 1 158
160 2 0 0 0 0 1 158
181 1 0 0 1 0 0 181
183 1 0 0 1 0 0 183
24669 1 0 0 1 3 3 24669
24671 2 0 0 1 0 0 24671
24670 2 0 0 1 1 1 24670
3385127 3 0 0 1 0 0 3385127
Published by: user11432758 on February 14, 2012 01:00Published by: user11432758 on February 14, 2012 07:05
Hello
user11432758 wrote:
Hi here is the statement DDL, thank youCREATE TABLE "SYSTEM"."ACCOUNT" ...
Do not create your own objects in the diagram of the SYSTEM or any scheme that comes with the database. Create a separate schema and place your items. You'll have fewer security problems, and the migration to a new database will be easier.
Here's a way to can get the aggregates you want:
WITH got_descendants AS
(
SELECT CONNECT_BY_ROOT account_id AS ancestor_id
, paying_account_id
, LEVEL AS lvl
FROM account
CONNECT BY NOCYCLE PRIOR account_id = parent_account_id
AND account_id != parent_account_id
)
SELECT ancestor_id
, COUNT (CASE WHEN lvl > 1
AND ancestor_id = paying_account_id THEN 1 END) AS my_total_pr
, COUNT (CASE WHEN ancestor_id = paying_account_id THEN 1 END) AS total_pr
, COUNT (CASE WHEN lvl > 1
AND ancestor_id != paying_account_id THEN 1 END) AS my_total_npr
, COUNT (CASE WHEN ancestor_id != paying_account_id THEN 1 END) AS total_npr
FROM got_descendants
GROUP BY ancestor_id
;
Output:
` MY_ MY_
TOTAL TOTAL TOTAL TOTAL
ANCESTOR_ID _PR _PR _NPR _NPR
----------- ----- ----- ----- -----
158 2 3 0 0
159 0 0 0 1
160 0 0 0 1
181 0 1 0 0
183 0 1 0 0
24669 0 1 3 3
24670 0 1 1 1
24671 0 1 0 0
3385217 0 1 0 0
This gives the correct numbers, but how can bring us in an order that reflects the hierarchy, with the columns (for example lvl) that come from the hierarchy?
A solution would be to make two CONNECT BY queries; a service without START WITH clause (like the one above) who collects the aggregates and the other with a START WITH clause (as your original query), which is in the right order and columns such as level_label and level. We could join result sets and get exactly what we want. I'll leave that as an exercise.
Here is another way, which gets good results with only one CONNECTION PER request:
WITH got_descendants AS
(
SELECT CONNECT_BY_ROOT account_id AS ancestor_id
, paying_account_id
, account_id
, LEVEL AS lvl
, CONNECT_BY_ISCYCLE AS cycle
, CASE
WHEN CONNECT_BY_ROOT account_id
= CONNECT_BY_ROOT parent_account_id
THEN ROWNUM
END AS r_num
FROM account
CONNECT BY NOCYCLE PRIOR account_id = parent_account_id
AND account_id != parent_account_id
ORDER SIBLINGS BY account_id -- Optional
)
, got_o_num AS
(
SELECT got_descendants.*
, MIN (r_num) OVER (PARTITION BY account_id) AS o_num
, MAX (lvl) OVER (PARTITION BY account_id) AS max_lvl
FROM got_descendants
)
SELECT LPAD ( ' '
, 2 * (MIN (max_lvl) - 1)
) || ancestor_id AS level_label
, MIN (max_lvl) AS "Level"
, MIN (cycle) AS "Cycle"
, COUNT (CASE WHEN lvl > 1
AND ancestor_id = paying_account_id THEN 1 END) AS my_total_pr
, COUNT (CASE WHEN ancestor_id = paying_account_id THEN 1 END) AS total_pr
, COUNT (CASE WHEN lvl > 1
AND ancestor_id != paying_account_id THEN 1 END) AS my_total_npr
, COUNT (CASE WHEN ancestor_id != paying_account_id THEN 1 END) AS total_npr
, MIN (paying_account_id) AS paying_account
FROM got_o_num
GROUP BY ancestor_id
ORDER BY MIN (o_num)
;
Output:
` MY_ MY_
TOTAL TOTAL TOTAL TOTAL PAYING_
LEVEL_LABEL Level Cycle _PR _PR _NPR _NPR ACCOUNT
--------------- ----- ----- ----- ----- ----- ----- --------
158 1 0 2 3 0 0 158
159 2 0 0 0 0 1 158
160 2 0 0 0 0 1 158
181 1 0 0 1 0 0 181
183 1 0 0 1 0 0 183
24669 1 0 0 1 3 3 24669
24670 2 0 0 1 1 1 24670
3385217 3 0 0 1 0 0 3385217
24671 2 0 0 1 0 0 24671
That's exactly what you asked for, except that you have posted the line with level_label =' 24671' before the line with level_label = "24671 '. You may not care about who comes first, but if it's important, explains why these lines should be in descending order of account_id, while "159 and 160" are in ascending order. You will need change the ORDERBY brothers and SŒURS clause accordingly.
Tags: Database
Similar Questions
-
START WITH and CONNECT BY PRIOR
Hello
Database: Oracle 11g
1.
SELECT ename, empno, mgr
WCP
START WITH empno = 7839
CONNECT BY PRIOR MGR = EMPNO
Result set:
EMPNO, ENAME MGR
-------- ---------- ----------
KING 7839
2.
SELECT empno.ename, Bishop
WCP
START WITH mgr = 7839
CONNECT BY PRIOR MGR = EMPNO
Result set:
EMPNO, ENAME MGR
-------- ---------- ----------
7566 JONES 7839
7698 BLAKE 7839
7782 CLARK 7839
KING 7839
KING 7839
KING 7839
My questions are:
Q1. What is actually happening in the result defines two queries. I'm not able to grasp the difference when I use START WITH empno = 7839 and START WITH mgr =. 7839
Q2. What is the difference between
CONNECTION BY MGR PRIOR = EMPNO and
CONNECT BY PRIOR EMPNO = MGR?
can someone please help me here?
Thank you
Hello
A CONNECT BY query looks like an operation UNION ALL of the data of different levels, numbered 1, 2, 3 and more.
Level 1 is filled with the START WITH clause.
If there are data on level N, then N + 1 level is filled, using the CONNECT BY clause, which generally refers to something on the N level via the PRIOR operator. Another way to put it is that level N + 1 is filled by a self-join with lines that have already chosen the level N.
If there is no data on the level of N, the query stops.
Let's see how this applies to your queries.
Level being such an important concept in CONNECT BY queries, you might want to see in all your CONNECT BY queries all test and debug the.
1 query, including the level are:
SELECT ename, empno, mgr
LEVEL
FROM scott.emp
START WITH empno = 7839
Empno = mgr PRIOR CONNECTION
;
You will notice that I have re-arranged the CONNECT BY clause. I find it a little more clear medium. Of course, it never changes the results just if you say "x = y" or "y = x.
The results, including the level, are:
LEVEL OF ARCHBISHOP EMPNO, ENAME
---------- ---------- ---------- ----------
7839 KING 1
What happened to produce these results?
First level 1 has been met using the START WITH clause. Level 1 is identical to the results of
SELECT ename, empno, mgr
AS LEVEL 1
FROM scott.emp
WHERE empno = 7839 - same as your START WITH clause
;
It happens to be only 1 row in the table scott.emp who met the empno = 7839 condition, and we show a few columns of this line.
That's all that need the level 1. Something has been on level 1, so we're trying now to complete level 2, using the CONNECT BY condition.
Any line that is included in the level 2 meets the empno = mgr PREREQUISITE condition, where the PREVIOUS operator refers to a line of level 1. In this case, there is only 1 row at level 1, this line gets to have a NULL mgr. Given that PRIOR mgr is NULL in this case, the condition to connect BY
EmpNo = mgr BEFORE equals
EmpNo = NULL and who obviously won't be true for any line, so nothing is added to level 2, and ends the query.
Now let's look at application 2. I'll add another column of debugging, called path, which I'll describe later:
SELECT ename, empno, mgr
LEVEL
, SYS_CONNECT_BY_PATH (empno, "/") AS path
FROM scott.emp
START WITH mgr = 7839
CONNECT BY PRIOR Mgr = empno
LEVEL CONTROL
path
;
Output:
EMPNO, ENAME MGR LEVEL PATH
---------- ---------- ---------- ---------- ---------------
7566 7839 1 7566 JONES
7698 7839 1 7698 BLAKE
7782 7839 1 7782 CLARK
7839 KING 2/7566/7839
7839 KING 2/7698/7839
7839 KING 2/7782/7839
Again, we'll study how people got 1 level. It happens to be 3 scott.emp lines that meet this condition START WITH, so there are 3 lines in the game at level 1.
Given that the data on the level 1, the test of the query to complete level 2, referring to some PRIOR line on level 1. Any line that meets the condition to connect BY, with a line any level 1 in the PREVIOUS line, will appear at level 2.
Let's look at the line at level 1 where ename = 'JONES '. Are there lines in sccott.emp that met the empno = mgr PREREQUISITE condition, where mgr PREREQUISITE is the column of Archbishop of the line with "JONES"? Yes, there are one, the line with ename = 'KING', so that the rank is included at level 2.
Let's look at the line at level 1 where ename = 'BLAKE '. Are there lines in sccott.emp that met the empno = mgr PREREQUISITE condition, where mgr PREREQUISITE is the column of Archbishop of the line with "BLAKE"? Yes, there are one, the line with ename = 'KING', so that the rank is included at level 2.
Let's look at the line at level 1 where ename = 'CLARK '. Are there lines in sccott.emp that met the empno = mgr PREREQUISITE condition, where mgr PREREQUISITE is the column of Archbishop of the line with 'CLARK '? Yes, there are one, the line with ename = 'KING', so that the rank is included at level 2.
There are thus 3 rows at level 2. They happen to all be on the same line of the table emp; It is correct. Remember, CONNECT BY is like a UNION ALL (not just a UNION). It is a UNION of
lines that are at level 1, because him meets the condition to BEGIN WITH, and
lines that are at level 2 because puts it CONNECT BY condition regarding the 'JONES', and
lines that are at level 2, because they meet the condition to connect BY regarding the "BLAKE", and
lines that are at level 2, because they meet the condition to connect BY regarding the "CLARK".
SYS_CONNECT_BY_PATH can enlighten us on that. SYS_CONNECT_BY_PATH (empno, ' / ') shows the empno of each level that caused this line appears in the result set. It's a delimited list /, where the nth element (i.e. the empno after bar oblique nth) is the empno who found the N level.
Since there were data at level 2, the quert now trying to complete level 3.
Is there all the rows in the table that satisfy the CONNECT BY condition (mgr PRIOR = empno) with respect to any line level 2? No, Bishop is be NULL on all lines of level 2, so no line can satisfy this condition CONNECT BY, no lines are added at level 3, and ends the query.
I hope that answers the question:
Q1. What is actually happening in the result defines two queries. I'm not able to grasp the difference when I use START WITH empno = 7839 and START WITH mgr =. 7839
I'll try to not be so detailed answering
Q2. What is the difference between
CONNECTION BY MGR PRIOR = EMPNO and
CONNECT BY PRIOR EMPNO = MGR?
These 2 CONNECT BY conditions are different where you put the PRIOR operator. The operator PRIOR to switching as it change the direction, upward or downward, which move you through the tree you get from level to level.
Bishop PRÉALABLE = empno means the employee on level N + 1 will be the same as the Manager of level N. This means that higher level numbers will be the most senior people in the hierarchy. This is called a query from the bottom up. (Both of the queries that you have posted this same CONNECT BY exact state; both are requests from bottom to top).
Mgr = empno PREREQUISITE or equivalent
PRIOR empno = mgr means exactly the opposite. When you move from level N to level N + 1 in the query, you will move to an older person, to a junior position in the hierarchy. This is called a query from top to bottom. The employee level N will be the Manager of wover is a level N + 1.
-
Join the two trees connect by prior Start With and return only common records?
Oracle 10g Release 2 (10.2)
I have two tables which have structured data. The results, when running queries individually are correct, but I need to join tree a tree two to get only the common records between them.
-Trees a
SELECT ip_entity_name, entity_code, hier_level, entity_parent
Of ip_hierarchy
WHERE hier_level > = 3
CONNECT BY PRIOR Entity_code = entity_parent
START WITH entity_code = "MEWWD";
-The two tree
SELECT ip_entity_name, entity_code, hier_level, entity_parent
Of ipt_hierarchy
WHERE hier_level > = 3
CONNECT BY PRIOR Entity_code = entity_parent
START WITH entity_code = "IPNAM";
If I understand correctly, the joints can not work with CONNECT BY / START WITH queries?
A WITH clause is an option?
If possible, I don't want to put a selection in a database to display object and join against other queries.
Thank you.Hello
jtp51 wrote:
Oracle 10g Release 2 (10.2)
...
If I understand correctly, the joints can not work with CONNECT BY / START WITH queries?Before Oracle 9 it was true. Since you're using Oracle 10, you can if you wish; but I'm guessing that you don't want in this case.
A WITH clause is an option?
If possible, I don't want to put a selection in a database to display object and join against other queries.
Yes, a WITH clause that is an option. Viewed online, as Zhxiang has shown, are another option. Either way gives you a regular display effect without creating a database object.
You did not show a sample and the results, so no one can tell if a join is really what you want. Other possibilities include INTERSECT or an IN subquery.
-
Hierarchical connect by and start with and joined?
I have an Employees table and a table of identifiers. The table of identifiers is hierarchical, with parents and children. Each employee has one or more identifiers, but that a unique identifier is considered to be the "primary" or root for each employee identifier. Unfortunately, the employee table can point to one of the children identifier lines and not the root. I need a quick query to reach employees with their most recent ID (root).
Here's the code to define the problem.
What I want is to put the parent node above realids for each line of employees...create table employees (employeeid varchar2(8), fakeNationalID varchar2(9), empname varchar2(30)); insert into employees (employeeid, fakeNationalID, empname) values (1,'001000001','John Smith'); insert into employees (employeeid, fakeNationalID, empname) values (2,'002000002','James Jones'); create table realids (realidkey NUMBER, fakeNationalID VARCHAR2(9) not null, realNationalID VARCHAR2(9) UNIQUE, parent_realidkey number); insert into realids (realidkey, fakeNationalID, realNationalID, parent_realidkey) values (1,'001000001','111111111',3); insert into realids (realidkey, fakeNationalID, realNationalID, parent_realidkey) values (2,'002000002','222222222',null); insert into realids (realidkey, fakeNationalID, realNationalID, parent_realidkey) values (3,'003000003','333333333',null); commit; create or replace function get_parentid (fakeID in VARCHAR2) return varchar2 is tempid VARCHAR2(9); begin select realNationalID into tempid from ( select realNationalID, fakeNationalID from realids start with fakeNationalID = fakeID connect by nocycle prior parent_realidkey = realidkey order by level desc) where rownum = 1; return tempid; exception when NO_DATA_FOUND then return NULL; when others then raise; end; select get_parentid('001000001') from dual; -- returns 333333333 because its linked to a parent select get_parentid('002000002') from dual; -- returns 222222222 because there is only one child select get_parentid('003000003') from dual; -- returns 333333333 because it is the parent
It works, but it is NOT very effective:
You can imagine what it would be like with 100K lines or more. It takes about 3 minutes to run.select employeeid, get_parentid(fakeNationalID) realid, empname from employees; employeeid realid empname ---------- ----------- ------------ 1 333333333 John Smith 2 222222222 James Jones
It seemed like a good way to do it, but with a sub query.
Unfortunately, it produces an invalid identifier on e.fakenationalid (in the beginning with the clause).select e.employeeid, e.fakenationalid, e.empname, sub.realnationalid from employees, (select realidkey, fakenationalid, realnationalid, parent_realidkey from realids r start with r.fakenationalid = e.fakenationalid connect by prior r.parent_realidkey = r.realidkey) sub
Anyone has any ideas on how to get top most parent node of the realids for each row in the employees table? In real life, there are 6 or more employees tables across multiple remote instances of what children in the realids table and how much to the parents. We always want the highest parent of the page realid. Any help would be appreciated.Hello
Thanks for posting the sample data in a convenient form!
It is always useful to post your version of Oracle, too, especially when it comes with CONNECT BY queries.What follows is what you asked for in Oracle 10:
WITH got_roots AS ( SELECT CONNECT_BY_ROOT fakenationalid AS leaf_id , realnationalid FROM realids WHERE CONNECT_BY_ISLEAF = 1 START WITH fakenationalid IN ( SELECT fakenationalid FROM employees ) CONNECT BY realidKEY = PRIOR parent_realidkey ) SELECT e.employeeid , r.realnationalid , e.empname FROM employees e JOIN got_roots r ON r.leaf_id = e.fakenationalid ;
In any query, call a function defined by the user for each line is going to be slow. Fortunately, Oracle now has the built-in functions and operators that can take the place of get_parentid. The CONNECT_BY_ROOT operator, which was introduced in Oracle 10, is the key to the problem. In Oracle 9, you can get the same results using SYS_CONNECT_BY_PATH.
It is generally faster to CONNECT BY query separately, and then join some other tables you need for results.
You had a good idea in your last query. The problem was that void and employees were equal tables in the FROM clause, and you cannot establish a correlation between equals. You can only correlate a subquery to its Super application. You could make to this general idea work by changing void in a scalar sub-requete, which can be connected to the employees, but I think it would be much less effective than what I posted above.
-
SatelliteU300 will not start with power connected and fully charged battery
I just bought a U300-13U. It works fine when charging the battery and AC is connected. However, if left to recharge completely it does not start with connected AC. Unpluging the power or remove the battery and running on AC make it work very well. Is a 'feature' to stop an overload or overheating of the battery, or just a problem with this machine. I want to run with AC and battery than both connected all the time like I did with all my other laptops.
Any help appreciated.
Hello Andy
Of my friends has this small U300 and everything works well. I got it a few weeks ago to test the family Windows XP Setup and it works perfectly.
Please test again very carefully and if the same thing happen again once I recommend you contact the Service partner in your country. They check your laptop. I have to be honest and say that describes the problem of strange sounds to me and please, don't wait too long. Contact the service as soon as possible.
Bye and good luck!
-
BlackBerry 8250 new smartphones does not start with the connected SIM card
I'm having a problem with my new Blackberry of Virgin Media (mobile). I just got it and when I have a connected SIM card I only get the loading screen timer and the blackberry does not start. If I have no connected SIM card the device starts in the operating system, but was told that there is just no SIM connected (obviously). Once I put the SIM card in again once it is stuck on the loading screen. As you probably already figured out that I did many resets hard with the battery pull and it has not solved the problem. A consultant because it would be greatly appreciated because the only advise I got support was remove the boot of sim and put it back and start again duh!
Carrier - Virgin Media / Vodafone
Model - 8520
Version of the OS - 4.6.1
Free space - 130679088 bytesBT device - I have the details as HDW - 22736-002 Rev 1 Ver 2 4509 (is that correct?)
Apps & free space - nothing installed new device installation is not complete.
Blackberry 4.6.1 Basic application
Basque 4.6.1
Galician 4.6.1
softwqare system BlackBerry 4.6.1
1.0.1.20 Application Center
Attachment Service 4.6.1
4.6.1 cards
Messenger 4.6.0
BrickBreaker 4.6.1
browser 4.6.1
documents to go 1.003.018
configuration of e-mail application 4.6.1
help 4.6.1
Klondike 1.4.8
4.6.1 Memopad
password keeper 4.6.1
Phone 4.6.1
Sudoku 1.0.11
4.6.1 tasks
King of hold'em Texas 2.3.0
Word Mole 4.6.11 is the news provider's SIM card?
Old to another device?
2. do not place you a memory card in the camera?
New media card?
or from another device? What device?
-
Laptop does not start with the connected usb device
Hello
Voila, I have a Sp6100 Pro Satellite, when I try to start whith a usb printer is connected, the laptop does not start. I have the latest version of the bios 1.90.THX,
Barzot @+.Hello
What you mean with start won t at all? Is there any kind of reaction if you press the power button / stop?
-
7 does not start with a connected external Western Digital hardrives.
I have two external hardrives WD, connected to a pc to the bridge under windows7. When the hard drives are connected, Windows7 does not start. It hangs on the black screen. Without the disks attached, it starts very well. Anyone know what I can do to not having to pick up leads outside whenever I want to start?
Solved.
Use Windows Update to install the update from Western Digital Technologies WD SES device released by Microsoft in January 2011.My system hangs is no longer with USB Legacy Support set to 'Auto '. -
Laptop does not start with LCD connected via an HDMI cable
I have a laptop Toshiba A660 running windows 7 Home Premium. I use and external LCD connected via an HDMI cable. If I leave the cable connected to the computer when I turn it on most of the time it does not start. It hangs at the windows from logo. The only way I can boot is power off (by operating switch for a while) and remove the HDMI cable.
Hello
To update the display driver, following the steps outlined in the article below:
Updated a hardware driver that is not working properly
http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly
Update drivers: recommended links
http://Windows.Microsoft.com/en-us/Windows7/update-drivers-recommended-links
See the articles on how to set up two monitors:
http://support.Microsoft.com/kb/976064
http://www.Microsoft.com/athome/organization/twomonitors.aspx#fBid=f5W9Hvf07IV
I hope it helps
-
Start - and connect SQL to the lowest level in the tree or the hierarchy
Hello
In a tree structure as shown below how can I get all the child (tree) level lowest records as a - E, H, G, and D.
A a B, C, D to level 2
B E and F at level 3, and C G at level 3
F a H level 4
A
| l | l | l
B C D
| l | l | l
E F G
| l
H
I have used start with and coonect by to give all levels of the tree as follows: -.
SELECT task_id, parent_task_id, top_task_id, level
OF pa_tasks
WHERE project =: p
START WITH parent_task_id IS NULL
CONNECT BY PRIOR task_id = parent_task_id
Thank you
Published by: user10648285 on October 17, 2011 23:42
Published by: user10648285 on October 17, 2011 23:42
Published by: user10648285 on October 17, 2011 23:42
Published by: user10648285 on October 17, 2011 23:43Oracle a [url http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/pseudocolumns001.htm#i1009313] nickname for hierarchical queries:
SELECT task_id,parent_task_id, top_task_id,level FROM pa_tasks WHERE project_id = :bind_variable and connect_by_isleaf = 1 START WITH parent_task_id IS NULL CONNECT BY PRIOR task_id = parent_task_id
-
Minor bug with node connections in SQL dev. 2.1 EA1
This is minor compared to some other issues found EA1.
When I expand the Connections node by clicking on the '+' I can't collapse when you click on the ' - '. This produces both during the migration of 1.5.5 settings and starting own, without migration of settings, then creating new connections. (I deleted the folder 'system2.1.0.62.61' between tests). I tried this by running "+ < install_dir > \sqldeveloper\sqldeveloper.exe +" and "+ < install_dir > + \sqldeveloper\sqldeveloper\bin\sqldeveloper.exe" to open a console window. (The only messages I saw in the console window has occurred when I opened a connection).
Here is the 'About' and 'Version' News:
On
-----
Oracle SQL Developer 2.1.0.62
Version 2.1.0.62
Build a HAND - 62.61
Copyright © 2005,2009 Oracle. All rights reserved.
The IDE version: 11.1.1.2.36.54.96
Product ID: oracle.sqldeveloper
Product version: 11.1.1.62.61
Version
-------
Version of the component
========= =======
Java (TM) Platform 1.6.0_14
Oracle IDE 2.1.0.62.61
Support versioning 2.1.0.62.61
FWIW, I can collapse and expand the Connections node in 1.5.5 with no problems.
Hrsg.:.Thank you, the bug is that the +/-is even planned. I put something in there to prevent the collapse of this since there is nothing when it's collapse.
-kris
-
Oracle SQL Developer Data Modeler start error
Hi all
I just downloaded Oracle SQL Developer Data Modeling (2.0.0.57.0) [released July 1, 2009] by selecting the option ' Oracle SQL Developer Data Modeler for Windows (this zip file contains the JRE).
After that I installed the same and tried to start clicking on datamodeler.exe, I get the following error message
"Failed to create an instance of the JVM on the path:... \jdk\jre\bin\client\jvm.dll.
On the same machine, I can successfully run the SQL Oracle program without error. My machine is having Windows XP Professional SP3.
Any ideas? If there is a problem with Java, that of the Oracle SQL Developer should also not run. But as I said it runs with any error, but the Oracle SQL Developer Data Modeler gives the above error.
Kind regards
JAA149Hey Jawad,
you wrote you have 960 MB of RAM - how did you do a test with 1.5 MB of RAM and 2 MB of RAM?
No doubt this is a problem of memory - memory change in the datamodeler.conf file option:
-There 'AddVMOption-Xmx768M"by default; to take
-"AddVMOption-Xmx512M" or never, making it suitable for your configuration - you can check the available free memory first.Philippe
-
Windows does not start with the second internal HDD connected
Hi all, I recently got around a few major problems with a new buuild, but I found another issue. Windows does not start with my connected storage disk.
hard drive 500 GB of important data that I can't save on it and need access. It is a hitachi drive, which works fine on other systems but usually works in this one. any suggestions are appreciated, thanks in advance
fixed the problem of swapping of sata ports and reconnect the cables, thanks for the advice but
-
START WITH causing no rows to return
When I run the following query, I get no line.
However, when I comment on the START WITH, I get 120 planned lines, including six rows with pred = 1.
Am I missing something obvious?select pred, succ from ( with q as ( select 1 as n from dual union all select 2 as n from dual union all select 3 as n from dual union all select 4 as n from dual union all select 5 as n from dual union all select 6 as n from dual union all select 7 as n from dual ) select q1.n AS pred, q2.n AS succ from q q1 join q q2 on q2.n > q1.n ) connect by prior succ = pred start with pred = 1;
-DonLooks like a bug in factoring clause, if it is replaced by a table, it does not (as you said), but also if you move the clause factoring on top of the query:
SQL> select pred, succ from 2 ( 3 with q as 4 ( 5 select 1 as n from dual 6 union all select 2 as n from dual 7 union all select 3 as n from dual 8 union all select 4 as n from dual 9 union all select 5 as n from dual 10 union all select 6 as n from dual 11 union all select 7 as n from dual 12 ) 13 select q1.n AS pred, q2.n AS succ 14 from q q1 15 join q q2 on q2.n > q1.n 16 ) 17 connect by prior succ = pred 18 start with pred = 1; no rows selected SQL> SQL> with q as 2 ( 3 select 1 as n from dual 4 union all select 2 as n from dual 5 union all select 3 as n from dual 6 union all select 4 as n from dual 7 union all select 5 as n from dual 8 union all select 6 as n from dual 9 union all select 7 as n from dual 10 ) 11 select pred, succ from 12 ( 13 select q1.n AS pred, q2.n AS succ 14 from q q1 15 join q q2 on q2.n > q1.n 16 ) 17 connect by prior succ = pred 18 start with pred = 1; PRED SUCC ---------- ---------- 1 2 2 3 3 4 {...} 1 7 63 rows selected.
I think you could take a look at metalink or raise a SR.
Nicolas.
tested on 10.2.0.4
Edited by: N. Gasparotto June 9, 2009 17:20 -
All files generated by a coil in sqlplus receive ownership of oracle: dba instead of the user of the BONE started sqlplus and run the script. There's a file with users owners of BONES of the coil.
Script launched in until OS user 'A' on the 'A' server which launches sqlplus, then connects to a remote database through a service of tnsnames.ora as another user of the database and the results of this script are spoulées on the server "A".
The file queued on the old server is written with rw-rw-r: read write user, group read the writing, reading and possession header that is the user of the OS. The file queued on the new server is written to rw-r-r user: reading writing, reading group, public reading and ownership oracle: dba.
"" The user then has no privileges to modify the file and continue the process of transmitting the file, editing and deleting the file for the next set of commands. This allows us to keep the possibility to migrate to the new server we are unable to process orders.
$ORACLE_HOME/bin/sqlplus - s user/password@prd1 @./script/CustomScript/R12_OM_UFPC-oracle.sql
Background: old server running 4.8, Oracle 10.2.0.4 OEL
New server running OEL 6.5, Oracle 11.2.0.4
Tested so far:
File and update umask to 0002 instead of 0022 is now generated as rw-r-r. However, the property is still oracle: dba.
Update of ownershipt of $ORACLE_HOME/bin/oracle.exe of oracle: oracle (edi added the user to the oracle group) and chmod 6751 oracle.exe. This created several problems where crucial scripts, that is to say of sqlplus failed to run.
Added! chmod 755 output.file.name - OS user 'A' is not allowed to change to mod.
Added! command cp MV output file and that generated the file as a user of the operating system: oracle. It is a potential work around in case of emergency, but the developer would have to rewrite the countless scripts.
Any ideas?
I have reproduced the behavior of the old server and am able to spool a file via sqlplus under OS user. No changes have been made on the remote database server. All the changes have been on the new server hosting a small 11.2.0.4 database on a server running OEL 6.5 32 - bit OS.
(1) removed the sticky bit $ORACLE_HOME/bin/sqlplus using chmod u-s, g-s, o - s suggestion of Billy ~ Verreynne
(2) modified the main group for the 'oracle' user match the user operating system applications, while maintaining membership in the groups 'oracle' and 'dba '.
-We are dealing with here EDI processes, so the Group was called edi.
(3) modified property of the files tnsnames.ora and listener.ora for oracle: edi
(4) restart the receiver
(5) disconnect / reconnect
Script runs as expected, the output file contains the correct ownership and permissions.
Thank you all for taking a look and offering options.
-Josh
Maybe you are looking for
-
Pavilion 500-339 usb 3 does not
downgraded win8 to win7prof. USB 3 notworking despite downloading the drivers from the hp site
-
Photosmart C6380: Blue do not work on on my C6380 photopapers after Win10
Prints OK on plain paper, but on blue photo paper does not work well. UNO
-
I lost all the games with the exception of Freecell on my computer
I lost all the games with the exception of Freecell on my Dell 8200 Windows XP computer. I followed the guidelines to reinstall using Add/Remove Programs, Windows Components and it said: everything is fine, but the games are never as far as I can tel
-
I just bought the HP Color Laserjet CP2025 and trying to print 2 powerpoint slides per page and FILL the page with the slides, without white margins that surround them with 2 slides shriveled in the middle. My Epson injet done automatically, so do th
-
"Adobe Application Manager to start your trial, is missing or damaged."
What should I do when I encounter an error saying: "Adobe Application Manager to start your trial, is missing or damaged."?