SQL & PL/SQL :: Connect To Get Parent And Supervisor Details In Oracle
Oct 15, 2013
I have a table like below:
EMP_ID MGR_ID EMP_NAME EMP_ROLE EMP_HIERARCHY
10 9 John Developer 7,8,9,10
9 8 Charlie Manager 7,8,9
8 7 Bruce GL 7,8
7 King CEO 7
20 18 Jack Developer 7,16,17,18,20
18 17 Adam Teamlead 7,16,17,18
17 16 Erik Manager 7,16,17
16 7 David GL 7,16
We can see that the for each employee, there is a corresponding Manager tagged except for CEO of the company. Now, I want the output to be like below
EMP_ID EMP_NAME EMP_ROLE MGR_ID MGR_NAME MGR_ROLE SUPERVISOR_ID SUPERVISOR_NAME SUPERVISOR_ROLE
Here, MGR_ID is nothing but the MGR_ID from the same row and Supervisor_id is nothing but the MGR_ID of MGR_ID
Ex:- For 10 EMP_ID, the MGR_ID = 9 and Supervisor_id = Mgrid of 9 i.e., 8
For 8, the Mgr_id = 7 and Supervisor_id = Mgrid of 7 which is none. etc.,
The same logic applies for Mgr_name, Mgr_Role , Supervisor_name and Supervisor_role too. I could not format the data in a tabular format due to some formatting issues.
View 12 Replies
ADVERTISEMENT
Jun 13, 2012
I have a parent table EMPLOYEE which includes columns (sysid, serviceno,employeename...) sysid is Primary key, serviceno is Unique key and I have child table DEPENDENT includes columns (sysid,employee_sysid,name,dob...) here again SYSID is primary key for DEPENDENTS table, employee_sysid is Foreign key of EMPLOYEE table.
Now I want to change SYSID (using sequence) in EMPLOYEE table which need to be update in DEPENDENTS table as well
Note: I have 10000 records in EMPLOYEE table as well as I have 5 more child tables which need to update new SYSID.
View 5 Replies
View Related
Aug 17, 2010
I have installed oracle developer 6i. in sqlplus i want to put my username and password but nothing in the connect string field.
View 1 Replies
View Related
Oct 6, 2010
I have the following computer/setup:
Acer laptop, Intel Processor w/ Windows 7 Professional (64-bit)
Delphi 2010 Professional
Oracle XE (+ the Oracle XE client that comes with it)
I cannot can't to the Oracle database from Delphi. The error I keep getting is:
Alias is not currently opened. [Oracle][ODBC][Ora]ORA-12154:TNS: could not resolve the connet identifier specified.
Here's what I've done:
1. Create an ODBC connection to my Oracle database
- run C:WindowsSysWOW64odbcad32.exe to open the ODBC administrator.
- Data source name: bt_user
- TNS Server Name: localhost/xe
- user bt_user
- Clicked "test connection" -- Success.
2. Open Delphi and drop a TDatabase component on my main form.
- Set the Alias Name property to "bt_user" (the alias I set up in ODBC)
- Set database name to "bt_user".
- Checked "connected".
Alternatively, I tried using the Delphi ADO components (the dbGo components).
- Drop TADOConnection component on my form.
- Select "connection string" and open the dialog.
- Click "build string".
- Select "Microsoft OLE DB Provider for ODBC Drivers" from the selection.
- In "use data source", select "bt_user" from the drop-down list (my ODBC connection from #1)
- Click "test connection".
Again the same error.
My questions are:
1. Can Delphi work with Oracle XE (Express Edition)?
2. If so, then do I need to install the "Instant Client"?
3. Will the instant client for Oracle 10g work with Oracle 10g XE?
4. Do I need to install any additional ODBC driver(s)?
5. Why was I successful in creating the ODBC connection in Windows, but it failed in Delphi?
6. Will Visual Studio.NET (C#) work with Oracle XE, and what are the steps for setting that up?
View 2 Replies
View Related
May 14, 2010
I have data in a table which don't have parent child relation ship. Can I display the data in that table in hierarchical tree item in a form.
Is it a must that data should have parent child relationship to display them in hierarchical tree item in a form.
View 1 Replies
View Related
Jun 4, 2012
A coworker of mine asked if there was any documentation from Oracle that listed all of the parts of the AWR report and what each meant. I was taken back because I don't think there is. There are third party books that talk about AWR reports and their predecessor Statspack reports.
Oracle has some notes on their support site about reading an AWR or Statspack report. All I found in the official documentation was some basic information about how to run an AWR report and an overview of what it was. It would be nice to have some sort of documentation that lists out each section and explains the units and purpose.
View 3 Replies
View Related
Apr 11, 2011
in My remote system oracle 10g installed and i don't know the login Credential details. i.e username, password,database name.
View 12 Replies
View Related
Mar 7, 2007
I am trying to connect to Oracle from another server that does not have any Oracle applications on it.
I tried Perl, PHP, Java but each require parts of Oracle installed.
View 2 Replies
View Related
Jul 7, 2012
I have been troubling with this issue for the last two weeks...tried so much, but could not able to resolve....
sqlplus username/password@IPAddress:port/ServiceName
I am able to connect to DATABASE from SQLAssistant only when I provide string like ABOVE........If I dont mention the SERVICE, m unable to connect to DB.Now the biggest issue is with SQL Developer.....m not at all able to connect to DB using SQL Developer.
View 3 Replies
View Related
Nov 26, 2012
I've stucked with a query. Let me explain the situation: I have a table that i store the IDs of logically equal records.
For example;
A = B
B = C
X = Y
Z = Y
My query must return all equivalent records. If you call the query with parameter 'A', the result set must contain B and C. And if you call the query with parameter 'Y', the result set will contain X AND Z. I have thought that i can write the query wity using start with connect by statement. But the query does not work as i expected. Here is my code and sample data:
create table temptable (ID1 number,ID2 number);/
insert into temptable values(11,12);/
insert into temptable values(12,13);/
insert into temptable values(13,14);/
insert into temptable values(13,15);/
SELECT distinct ID1 from
(
SELECT * FROM temptable
START WITH ID1 = 13 OR ID2 = 13
CONNECT BY NOCYCLE
[code]...
In my sample the equality definitions is;
11 = 12
12 = 13
13 = 14
13 = 15
When i call the query with parameter 13, i'm expecting to get 11,12,14,15. But it returns only 12,14 and 15.
View 4 Replies
View Related
Jul 17, 2012
OS: RHEL 5.7 64 bit
DB: 11.2.0.2 SE 64 bit
We have a scenairo in which we have two servers one is a Oracle server and the other is SQL server and we need to enable automated Emails from the oracle DB server. As the Oracle server is not whitelisted and we have a SQL server which is already whitelisted so is it possible to connect from Oracle server to Sql server so that the automated emails will be generated from the sql server (as it is whitelisted) and we do not want to whitelist the oracle server.
View 3 Replies
View Related
Apr 1, 2013
I am upgrading an application from 9i to 11g and I've been told that the connect by prior sql is broken. While I am waiting for the example and the error message, is 11g pickier about looping than 9i was? some documentation on 10 or 11 changes to hierarchical queries?
View 1 Replies
View Related
Oct 19, 2012
I am trying to develop a web application with C # VS.net, my application is to connect to an Oracle database on a server (LAN), the problem I want to connect to the database without install oracle or ODP on my client machine.
View 1 Replies
View Related
Apr 18, 2008
Is it possible to connect to 10g oracle server from 9i client?
View 1 Replies
View Related
Apr 26, 2009
i've been trying to connect to the Oracle DB with Oracle SQL Developer.I get a message
State: Test Failed - IO Exception "The network adapter could not establish the connection"
When i go try tnsping 1521 It detects a connection by Oracle Database.And finally i get TNS-03505: Failed to resolve name
When i went into the "services.msc" and tryed to run the "OracleOraDb10g_home1TNSListener"
Got a message: "Error 3: The sytem could not find the specified path"
View 9 Replies
View Related
Jul 27, 2010
i want to know how can i connect c builder application with oracle 10g express ? which components i have to use?
View 1 Replies
View Related
Jul 19, 2010
I have created an Oracle database on my Windows XP system but cannot connect from a php script
CODE
<?php
if (!$db = @ocilogon("big", "big", "s7s"))
{
$error = ocierror();
printf("Error was: %s", $error["message"]);
die();
}
$stmt = ociparse($db,"SELECT count(*) FROM members");
ociexecute($stmt);
?>
When I created the database the connection I used was s7s but whether or not I include that name or just use the ID/password that script will not connect.
View 2 Replies
View Related
Jul 23, 2013
Web Server(port80) and SSH Server(port 212) and Oracle client with sqlplus (192.168.137.2)
||
||
SSH client (192.168.137.1/128.21.31.111)
||
||
Oracle Server (port 1521) (128.21.31.112)
my php program have to access the db on oracle server, and then i do this on my SSH client
ssh -p 212 user@192.168.137.2 -R 1521:128.21.31.112:1521
View 1 Replies
View Related
Jul 28, 2010
I have installed Oracle 10g XE in my laptop having Windows 7 home 64 bit OS..I have created some users in the oracle and iam able to connect these users through cmd prompt..But the issue is that iam unable to connect to the database through TOAD..
I have given the user name and password and database as XE and connect using as : XE but still iam getting the error as "TNS could not resolve the connect identifier (XE).
View 12 Replies
View Related
Jan 4, 2011
Unable to connect in TOAD in ORACLE 11g through sys user.
I am using Toad for ORACLE version 9.0.0.160 and ORACLE 11gR2 (11.2.0.1).
I make the FALSE to "sec_case_sensitive_logon" parameter hence not able to login through sys user. I can logged in through system user without any issue.
View 4 Replies
View Related
Mar 21, 2011
i installed Oracle 11.2.0 64bit & Oracle SQL developer 2.1.1.64 on Windows-7 64bit
i try to connect to database like this:
username: scott
password: tiger
role : sysdba
hostname: localhost
port : 1521
sid : ORCL
and i got this error: `ora-01017 invalid username/password; logon denied`
View 3 Replies
View Related
Feb 22, 2011
i need the crystal report application to try to get some reporys from the database .
and i am new to crystal reports and want to know how to connect to oracle database 11g .
wher to get CR 8 and step by step how to connect it to my database
View 1 Replies
View Related
Jun 22, 2013
Recently i have installed oracle 10g.2 in my laptop under Win-7 64bit. But cannot connect oracle from Windows form [C#], Office application[Excel] and odbc. Showing error[Tns could not resolve the connect identifier specified Drivers SQLSetconnectAttr failed ]
Though I can connect oracle from toad and sqlplus and form 6i.
View 17 Replies
View Related
Sep 17, 2008
My OS is Linux and I installed Oracle 10.2. Everything is fine.I can use sqlplus, exp, imp etc with no problem.Now I have created another linux user test in /home/test. I unzipped basic-10.2xxxxxx.zip (/home/test/instantclient_10_2) and exported LD_LIBRARY_PATH.I guess I have installed instant client in this way.
My testOra.cpp:
#include <occi.h>
int main()
{
return 0;
}
This test.cpp would not compile. It cannot find occi.
View 8 Replies
View Related
Sep 24, 2010
I just want to know whether Oracle forms 11g supports other databases like DB2, SQL Server etc.
Also does Oracle forms 11g supports Oracle database 9i or 10g apart from 11g?
View 1 Replies
View Related
Aug 24, 2010
I am having a problem understanding the relationship between users and databases within Oracle. I have a user "big" that logs on successfully on another machine to database "s7s" but on a different machine fails to connect.
The following may be interesting:-
<?php
$SGMDBUsername = "big";
$SGMDBPassword = "big";
$SGMDBName = "s7s";
$conn=OCILogon($SGMDBUsername, $SGMDBPassword, $SGMDBName);
[code].......
If I on the new machine issue the command sqlplus big/big. I successfully connect and see the tables I am looking for.
View 12 Replies
View Related
Dec 8, 2011
how to connect oracle database through online
View 8 Replies
View Related
Jun 24, 2012
I have installed oracle 10g database in the my local laptop ( Windows 7) . This laptop is in LAN. I am not able to connect from other machines in LAN. When i open sqlplus, SQL Developer from the same machine, i was able to login to the instance.
But when i want to login from the other machines in LAN. I was not able to connect. I was able to ping the server on which the database was installed from other machines. why i am not able to connect ?
View 8 Replies
View Related
Aug 20, 2013
I am trying to connect to database remotely. I have installed Oracle client on my local machine(Windows 7) and trying to connect to db.
I am able to do tnsping. Below is the log.
But when i try to connect i am getting ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA error.
Below is the complete log.
C:\Windows\System32>tnsping DEVDB
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-AUG-2
013 14:18:42
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
D:\app\swanand_kulkarni\product\11.2.0\client_1\network\admin\sqlnet.ora
Used EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTO
COL=TCP)(HOST=10.111.0.121)(PORT=1521)))
OK (560 msec)
C:\Windows\System32>sqlplus test1/********@devdb
SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 20 14:18:47 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
View 8 Replies
View Related
Jan 30, 2012
I have, for example, two tables: COMPANIES and EMPLOYEES. COMPANIES has a primary key on column COMP_ID. EMPLOYEES has a foreign key EMP_COMP_ID. I always do query COMPANIES with WHERE clause on COMP_ID and COMP_ADDRESS. What indexes on COMPANIES should I create in this case? First unique on COMP_ID, second composite on COMP_ID and COMP_ADDRESS? Or one unique index on COMP_ID and COMP_ADDRESS will be enough?
View 5 Replies
View Related