PL/SQL :: Copying A Tree Structure
Oct 4, 2012
I have a hierarchy tree i query using connect by. The primary key is the up level to other parts. I need to copy the entire tree structure as a new structure.
This will mean renaming the IDs to new unique ID yet keeping the up levels correct.
i.e.
ID DESC UPLEVEL
1 TOP
2 desc2 1
3 desc3 1
4 desc4 3
5 desc5 4
6 desc6 1so if i coped this i would expect
7 TOP
8 desc2 7
9 desc3 7
10 desc4 9
11 desc5 10
12 desc6 7
View 5 Replies
ADVERTISEMENT
Sep 8, 2012
Explain the following query to me:
in particular Lpad (' ', Level-1)*3.
select lpad(' ' , (level-1)*3) || emp_last_name employee
from emp
connect by supervisor_emp_id = prior emp_id
start with supervisor_emp_id is null;
View 1 Replies
View Related
Apr 5, 2011
I want to know how to create tree structure in forms6i. This should be created as " Control-block". For example when user expand department it shows all department names in college as sub tree. Note: I have no table for department..Just display manually..
View 1 Replies
View Related
Jun 26, 2012
How to create one complex query. here what I have in my table.
DELIVERABLESPRECURSORS
------------ -----------
4 15
15 332
15 26
26 332
29 4
29 15
224 26
224 274
224 259
259 29
274 15
288 259
288 26
288 274
916 27
917 27
918 27
I need a query which run against this table and bring me the following result.
4 > 15 > 332
15 > 332
15 > 26 > 332
26 > 332
29 > 4 > 15 > 332
..... and so on
In theory, I need query which will track DELIVERABLES'S PRECURSOR and PRECURSOR's of there PRECURSOR'S.
View 16 Replies
View Related
Jul 14, 2012
what command is used to create a table by copying the structure of another table including constraints ?
View 2 Replies
View Related
Mar 1, 2013
I have one table test_pc :
EVENT_IDPARENT_EVENT_ID
2001
2002 2001
1001 2002
1002 1001
1004
1003 2005
1006
Scripts are mentioned below :
create table test_pc
(event_id number(10), parent_event_id number(10));
insert into test_pc values(2001,null);
insert into test_pc values(1006,null);
insert into test_pc values(1004,null);
insert into test_pc values(2002,2001);
insert into test_pc values(1001,2002);
insert into test_pc values(1002,1001);
insert into test_pc values(1003,2005);
In order to derive parent child relationship I have ran the following query :
select *
from test_pc
start with parent_event_id is null
connect by nocycle prior event_id = parent_event_id;
It is giving all the records except the last one (i.e. event_id = 1003 and parent_event_id = 2005), because the parent_event_id does not exists in the table.
But my requirement is to show all the record, i.e. if the parent_child relationship is present then show accordingly and also show the rest of the records where the parent_child does not exists even the parent_event_id exists.
View 5 Replies
View Related
Sep 3, 2012
I am struck in a requirement to show the organization structure in a Top Down Organizational structure.
Is there any way we can make the well structured report OR form?
View 4 Replies
View Related
Nov 28, 2011
I am a software developer for a small company with a parts inventory. We develop a Java program that is an add on to our inventory management software.
The inventory management software recently got upgraded from a Firebird platform to an Oracle platform, so to continue developing our software I need to upgrade our development environment. This environment is a separate environment (more specifically, my laptop) so I am trying to get a copy of the database onto my machine.
The software vendor pointed me to a DMP file that he said I could use to import the data onto my machine. However, using impdp has been a headache. I ran it with the parameters supplied from the software vendor and I received a flood of errors (already exists errors, data too big errors, parent key not found errors). After waiting several hours for impdp to do its thing, the result is that the user I am trying to import to is still empty.
Is DMP the best way to accomplish my goal? If you were trying to get a database from machine a to machine b in Oracle, how would you do it? In Firebird, it was as easy as copying the database file and pointing the DBMS to it.
I am not looking for live sync, I plan to update the database with the live data about once every month or so.
View 3 Replies
View Related
Oct 4, 2012
When I create a new page item via copying from existing page item it fails with the below error code, if there is > or < character in the source of the existing item.Error Source contains <, > or " which are invalid characters. It works fine if I create new item using wizard and then have the same source. I use div tags in the source of my display only items.
View 3 Replies
View Related
Sep 21, 2011
1) How to copy the ARCHIVED LOG FILE from Primary to DR location. Where if the DR is having the file already, how to SKIP that Particular Archived log file?
2) I have Checked with the FILE_TRANSFER DBMS package, but it gives the error if any file existing already.
View 2 Replies
View Related
Jan 31, 2011
I am restoring Oracle rman backup from nodeA to nodeB through RMAN and I was in the middle of the process of rename the redo log files to new location where I suddenly got the below mentioned error:
RMAN> SQL "alter database rename file 'E:oracleproduct10.2.0oradatadbadeepakREDO01.LOG' to 'E: est_rman estrmanREDO01.LOG'";
sql statement: alter database rename file 'E:oracleproduct10.2.0oradatadbadeepakREDO01.LOG' to 'E: est_rman estrmanREDO01.LOG'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 01/31/2011 12:53:04
[code]....
View 6 Replies
View Related
Feb 5, 2013
I have made one form and trying to pick up the data available on the form by pressing a copy button and want to take all the date into clip board. for an example I'm just picking one field at the moment named as p213_que_item_ref
following code is defined as application_process getquerydet (process point ondemand)
declare
item_ref varchar(30);
begin
item_ref = :p213_que_item_ref
HTP.prn (item_ref)
End;
In the header of the form querydetailsregion following code has been added
<script language="JavaScript" type="text/javascript">
function f_copytoCB ()
{
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getqueryDet',0);
//var get = $v('P213_QUE_ITEM_REF')
get.add($v('P213_QUE_ITEM_REF'))
gReturn = get.get();
copy gReturn;
}
</script>
AND in the button URL added the following code
javascript:f_copytoCB();
But it is still not working .......
what is wrong with it.
View 2 Replies
View Related
May 11, 2010
I am trying to install Oracle 11g Release 2 on Redhat Enterprise Linux 5.2 (vmware image) but after 50% installation it through errors while copying files on the server. I also tried on Windows 2003 Server R2 (physical m/c as well as vmware image) and faced same problems. I did installation of Oracle 11g Release 1 and didn't find any problems.
View 15 Replies
View Related
Aug 19, 2012
I need to copy more than 1000 database users(without objects) from orcle 9i to oracle 11g. They don't allow to use any graphical tools.which is the best way to complete this task? does conventional export /import works for only users only ?
View 2 Replies
View Related
Sep 17, 2013
I have a translated application in Apex, my Apex version is 4.2.1.00.08. The application is in production version, many people are using it on daily basis. The application's primary language is English, and it has translations for 5 languages. Everything is working fine now; even if there are minor changes in the application, we are able to seed it, download the XLIFF files and than publish the modifications into all translations. Simple so far. My problem is that I wanted to 'clone' the application including its translations to a new one since I plan to rebuild some parts of it. I want to keep the current version untouched, not to bother users. The new application should be in the same workspace, with a new ID. I have tried a couple of approaches: Copy the primary application enabling the option 'copy translation' - this creates a new app, and also seems to create new translated applications, which are empty (not seeded, not published). Export the primary application and than import it with a manually defined new application ID. Than do the same with the translated applications and set the proper IDs in the translation mapping part of Shared components > Translation. When I try to run the primary application, it is working, but for translated versions... Only an error saying that the application page does not exist. The purpose is to clone the whole thing by keeping the connection between the primary and the translated applications, so that if I change something in the primary application, it can be seeded into the translated ones later. In the same time I want to keep translations as well, since there are thousands of strings...
View 2 Replies
View Related
Feb 7, 2013
--this for txn details
CREATE TABLE txn_det(
txnid NUMBER PRIMARY KEY,
amount NUMBER,
status varchar2(50),
cust_id NUMBER);
----this for customer details
CREATE TABLE cust_det(
cust_id NUMBER PRIMARY KEY,
cust_name VARCHAR2(50),
cust_acc number(15));
--data to insert for customer table
INSERT INTO cust_det VALUES(101,'Miller','12345');
INSERT INTO cust_det VALUES(201,'Scott','45678');
----data to insert for txn table
INSERT INTO txn_det VALUES('tx0045',123.00,'success',101);
INSERT INTO txn_det VALUES('tx0046',4512.50,'success',101);
insert into txn_det values('tx0049',78.12,'success',101);
INSERT INTO txn_det VALUES('tx0055',123.12,'success',201);
Now THE problem IS cust_det TABLE's cust_id coulmn may contain duplicate.So I thought OF adding THE txn_id COLUMN TO THE cust_det table but I know that encourgaes redundancy.
View 30 Replies
View Related
Jul 11, 2012
How to take table structure in oracle? Actually I got it through this command "SELECT dbms_metadata.get_ddl(a.object_type,a.object_name) FROM user_objects a where object_type != 'PACKAGE BODY'"
any other way to get it? I need like table name field name datatype
View 11 Replies
View Related
Sep 4, 2008
The output below is looked mass..
1) the capital letter is the name of column
2) consists 8 data for each column name
Quote: STATISTICS_DATE INSTANCE_NAME GENESIS_PORT
-------------------- ---------------------------------------------------------------- ------------
COUNT TOTAL_TIME MAX_TIME MIN_TIME AVERAGE_TIME
--------- ---------- --------- --------- ------------
03-AUG-08 MatlMgr_UpdateInstance140028
35 6.8685906 .83870006 .06330299 .19624545
View 2 Replies
View Related
Jun 4, 2012
I am working in a reporting project.We have different environments.After migration of data base script from one server to another we always need to crosscheck whether newly added columns have been properly migrated or not.
any database script to address the same thing. Last but not the least we have servers with TNS entries. how we can connect to different server while present in one specific server.
View 5 Replies
View Related
Mar 16, 2011
We are trying eliminate/minimize the downtime for our application. As part of new code deployments sometimes we need to modify DB Structure also. As it is taking time to backup current DB and apply new DDL, the application is down.
Is there a way to eliminate the downtime, if I can leverage Data Guard, Golden Gate or RAC concepts?
View 3 Replies
View Related
Aug 27, 2010
I was trying to get the structure of mview through ALL_MVIEWS, but I was not getting the complete one.ORDER BY clause was missing.
how we can get the complete mview structure.
View 7 Replies
View Related
Mar 13, 2013
create table my_rows
(
my_envvarchar2(100),
anumber(2),
bnumber(2)
)
/
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
insert into my_rows values ('A', 10, 20);
[code]....
The first row means that the value 10 represents 40% in the couple (10,20). Meaning if I have 100 rows with the couple (10,20), 40 rows will be marked with the value 10 and 60 will be marked with the value 20. To do this, I used to create a temporary table with the same structure as the my_rows table with a new column "the_value" and I used to update this new column wth a PL/SQL for loop. But I think it is doable in a signle SQL.
View 9 Replies
View Related
Apr 21, 2010
i would like to view all table statructure of a schema in a file. i need to take print out of it for one analysys.
i did like this
exp user/pwd file=dumpfile.dmp full=y rows=n log=logfilename.log
imp user/pwd file=dumpfile.dmp full=y indexfile=indexfile.sql logfile=logfilename.log
but
its look like this i could not format
REM CREATE TABLE "SYSTEM"."DEF$_AQCALL" ("Q_NAME" VARCHAR2(30), "MSGID"
REM RAW(16), "CORRID" VARCHAR2(128), "PRIORITY" NUMBER, "STATE" NUMBER,
REM "DELAY" TIMESTAMP (6), "EXPIRATION" NUMBER, "TIME_MANAGER_INFO"
REM TIMESTAMP (6), "LOCAL_ORDER_NO" NUMBER, "CHAIN_NO" NUMBER, "CSCN"
REM NUMBER, "DSCN" NUMBER, "ENQ_TIME" TIMESTAMP (6), "ENQ_UID" NUMBER,
[Code] ..........
View 3 Replies
View Related
Aug 17, 2012
duplicate rman on new windows box with different dir structure
View 9 Replies
View Related
Jun 18, 2012
I have a question about Oracle schemas. Oracle schema is the user with its datase objects (table, index, eg) .In two different Oracle schemas, there can be two tables with same names. When the users connect to same Oracle instance they can access these tables with schema.tablename convention.
However, how is that structure handled in physical database storage. Are there two tables created with same name physically? I mean are these two tables with same name stored in different database files?
View 3 Replies
View Related
Apr 30, 2013
I am receiving two large export files from a vendor, so I have no control over the contents. I need to import these into our database. The two export files are very similar, except the one has slightly differenet columns in it. So, export file 1 may have a table:
COLUMN_A
COLUMN_B
COLUMN_C
The second file may have:
COLUMN_A
COLUMN_B
COLUMN_D
At the destination, I have a table that has:
COLUMN_A
COLUMN_B
COLUMN_C
COLUMN_D
Is there a parameter that would let me interchangably import either (or both) files into this destination table? This is my first attempt at data pump - but I know using import this has caused me issues. Not sure if the same limitations exist? Will the missing columns cause it to fail?
View 3 Replies
View Related
Nov 16, 2012
my working is relating with PUMP of oracle.
I would like to use command, for ex:
expdp hr/hr DIRECTORY=dpump_dir1 DUMPFILE=expdat.dmp COMPRESSION=ALL LOGFILE=export.log SCHEMAS=hr
But some tables in Schema HR, I don't want to export data, just only need table structure.
View 2 Replies
View Related
Oct 19, 2010
we have daily partitioned table, and for backup we are using data pump (expdp). we policy to drop partition after backup (archiving).
we have archived dump files for 1year, few days back developer made changes with table structure they added one new column to table.
Now we are unable to restore old partitions is there a way to restore partition if new column added / dropped from currect table.
View 4 Replies
View Related
Nov 9, 2010
know the process of exporting only the table structure of a Database without the actual content of it.
Note:: I don't know how many tables are present in the DB.
View 1 Replies
View Related
Jun 21, 2012
a table structure is modified every now and then because of which the few packages get uncompiled. is there any way to monitor which user has changed table structure.
View 2 Replies
View Related