How to compare the structure of multiple tables ..have only TOAD & PUTTY
Hi,
Many times i get a request to load some tables' data from one schema to another . But before doing that i need to compare the structures of the tables in the source & target schema.
How can i do that? The list of tables keep on changing every now & then. In TOAD there is no option to compare a selected list of tables. Comparing the whole schemas is not a option before me as the schemas are too huge and it takes a lot of time to do the schema level comparision.
Note this is a client machine and we are not allowed to install any s/w.
I am working on making a unix script which does that for me. But that may take some time considering the hectic work schedule and my poor knowledge of unix scripting.
Can someone suggest some way to do it?
Regds,
Kunwar
i need to compare the structures of the tables in the source & target schema.SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_TYPE_MOD, DATA_TYPE_OWNER, DATA_LENGTH, DATA_PRECISION, DATA_SCALE FROM DBA_TAB_COLUMNS WHERE OWNER = 'SOURCE'
MINUS
SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_TYPE_MOD, DATA_TYPE_OWNER, DATA_LENGTH, DATA_PRECISION, DATA_SCALE FROM DBA_TAB_COLUMNS WHERE OWNER = 'TARGET'
UNION
SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_TYPE_MOD, DATA_TYPE_OWNER, DATA_LENGTH, DATA_PRECISION, DATA_SCALE FROM DBA_TAB_COLUMNS WHERE OWNER = 'TARGET'
MINUS
SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_TYPE_MOD, DATA_TYPE_OWNER, DATA_LENGTH, DATA_PRECISION, DATA_SCALE FROM DBA_TAB_COLUMNS WHERE OWNER = 'SOURCE'
Similar Messages
-
How to rearrange the structure of a table by using a view?
At wits end: I need to reorganize the structure of a table into a new structure - either as a view or actually moving the data from the old structure to the new structure (using a view).
The old structure is:
TESTNAME, SCHOOL_ID, PTILE1, PTILE2, PTILE3 ... PTILE99
Test1,0001,18,19,20...
Test1,0002,23,24,28...
Test1,0003,20,21,26...
Test2,0001,48,52,55...
Test2,0002,50,54,54...
Test2,0003,60,62,64
The new structure is:
SCHOOL_ID,PTILE,TESTNAME1,TESTNAME2...
1,0001,Score1,Score2...
1,0002,Score1,Score2...
1,0003,Score1,Score2...
2,0001,Score1,Score2...
2,0002,Score1,Score2...
2,0003,Score1,Score2...
99,0001,Score1,Score2...
99,0002,Score1,Score2...
99,0003,Score1,Score2...
What this data shows are the percentiles for test scores for different tests for each school who took the tests.
It seems like creating a view to arrange the data through a bunch of selects and unions would work, but I can't figure out how.Tricky.
When confronted with a problem like this I try to write out an algorthm in pseudocode to work out what I want to do. If you have more than 2 or 3 tables to merge I'd consider going with a new structure; otherwise the view approach might be a good idea. Remember that if you go with a new structure you can insert once and update the other values later, something like
foreach school insert row
update testname1
update testname2
Good luck. -
How I compare the columns of 2 tables
Hi, what's the query I use to compare all the columns of 2 tables, or how I use the result of COLUMN_NAME in the DBA_TAB_COLS?
Tnks for helping...
MnkI have this select:
SELECT D.COLUMN_NAME AS CFINAL
FROM DBA_TAB_COLS D,
(SELECT A.COLUMN_NAME AS C1
FROM DBA_TAB_COLS A
WHERE (A.OWNER LIKE '%TEL_USJ07%' AND
A.TABLE_NAME = 'BOLETOS')) F
WHERE D.COLUMN_NAME = F.C1
AND D.OWNER LIKE '%TEL_USJ07%'
This will return the column's name where tabel_name LIKE BOLETOS.
I want use this result in another select where the table have this columns and more, but I want to see all the results in the second table where the columns came from the first select.
For example: the first select bring to me the columns: cod_tipo_bol and cod_tipo_corte, I want to see in the second select only the results of this 2 columns.
THIS IS THE COLUMNS OF THE SECOND TABLE I WANT TO USE:
cod_tipo_bol
cod_frente_corte
num_carga
cod_caminhao
cod_motorista
lib_numero
cod_enc_frente
cod_div2
cod_div3
cod_div4
bol_data
cod_carregadora1
cod_oper_carreg1
cod_carregadora2
cod_oper_carreg2
cod_colhedora1
cod_oper_colhed1
cod_colhedora2
cod_oper_colhed2
cod_colhedora3
cod_oper_colhed3
cod_trat_reb
cod_oper_trat_reb
cod_trat_transb1
cod_oper_transb1
cod_trat_transb2
cod_oper_transb2
cod_trat_transb3
cod_oper_transb3
cod_julieta_sm_reboque
bol_status
-------- -
How to find the relevant query if I have only bookmark ID ?
Hi Gurus,
I have an issue now, I have only a Bookmark ID and want to know the corresponding query, can you tell me the methods ?
Thanks
LeonHi Leon,
when you are giving Bookmark ID corresponding to that query properties will display there you can check the technical name of your respective querey.
Try this it will works.
Regards
Suresh B.G. -
Copy the structure of a table to another with another table name.
how to copy the structure of a table to another with another table name.
ie. i want a emp table with same values/structure to be copied to another table called my_employee.
how can this be done?create table my_emp as select * from emp;
If you do not want the data to be copied then do the following:
create table my_emp as select * from emp
where 1=2;
Avanti. -
How to find the structural difference between two tables
Hi all,
How to find the structural difference between two tables .
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for 32-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Thanks,
P Prakashyou could try something similar to this, for each table pair that you want to compare:
SELECT 'TABLE_A has these columns that are not in TABLE_B', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
) DIFF
UNION
SELECT 'TABLE_B has these columns that are not in TABLE_A', DIFF.*
FROM (
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_B'
MINUS
SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH
FROM all_tab_columns
WHERE table_name = 'TABLE_A'
) DIFF;that's assuming, column_name, data_type and data_length are all you want to compare on. -
How to get the data from multiple nodes to one table
Hi All,
How to get the data from multiple nodes to one table.examples nodes are like A B C D E relation also maintained
Regards,
IndraHI Indra,
From Node A, get the values of the attributes as
lo_NodeA->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = ls_attributesA ).
Similarily get all the node values from B, C, D and E.
Finally append all your ls records to the table.
Hope you are clear.
BR,
RAM. -
How to find the structure fields data in database tables?
how to find the structure fields data in database tables?
Your question doesn't appear to be Web Dynpro ABAP related. Please only post questions in this forum if they are directly Web Dynpro ABAP related. There are several other more general ABAP related forums.
-
How to compare the contents of two different tables
hello. can somebody give me an idean on how to compare the contents of two different tables in mysql?
example, i have a table named Main List and a table named New List.
The contents of the New List should be compared to the contents of the
Main List, to check if they are equal. I don't have any idea how to manipulate
this data. Hoping for your help. Thanks.it is better to comapre it using java.. try get the resultset first and store that in collections then comapre the two collections
-
How to Compare the Version of the mara table in Quality & Production
Hi...
I'm in need of comparing the Version of Mara Table in Quality & Production.. I like to Know the Difference between them..
Can anyone help me with a Solutions.
With Regards,
AAHBHA.Moderator message - Cross post locked
-
How to get the StatusText from XMII_JCOMESSAGES Table
Hi all,
I need to show the Status as well as StatusText from XMII_JCOMESSAGES table for a particular message in a custom User Interface. I have checked through Read Message action block and Query Message action block. Read Message action block returns two XML structure like JCOMessage and MessageDocumentXML. JCOMessage xml does not contain the StatusText field. The structure of JCOMessage is like
<JCOMessage>
<MessageId/>
<JcoServerName/>
<MessageName/>
<Category/>
<MessageType/>
<Status/>
<DocNumber/>
<DocCount/>
<Function/>
<PacketID/>
<ProcessingTimeStamp/>
<ReceivedTime/>
</JCOMessage>
But I have checked the XMII_JCOMESSAGES table from NWA and the structure of XMII_JCOMESSAGES table is
MESSAGEID
RECEIVEDDATETIME
JCOSERVERID
MESSAGETYPE
MESSAGENAME
PROCESSINGDATETIME
DOCNUMBER
DOCXML
CATEGORY
PACKETID
STATUS
STATUSTEXT
SERVER
So, how can I fetch the STATUSTEXT field. Can anybody help me.
Thanks in advance
ChandanAside from the Update Message block status text (integer values 1 - 4 coincide with the options in the drop down box on the configure dialog) that you can see in the link editor, you may need to use the Message Monitor status flag on the web page to determine what the number means in relation to friendly status text.
Probably worth logging a ticket for consideration to add this into the actions. I would assume this string might be translated into a local languague for the user but I'm not sure. -
In ADF how can i insert data in multiple table if they have foreign key
I have started working on ADF and can anybody inform me in ADF how can i insert data in multiple table if they have foreign key,please?
Thnak you very much.Hello,
Still no luck.I am surely doing silly mistakes.Anyway,Here are my workings-
1> student_mst (id(pk),studentname) and student_guard_mst(id(fk),guardianname)
2> created EO from both of the tables,made id in both EO as DBSequence and an association was also generated.
3> i made that association composite by clicking the checkbox
4> i created 2 VO from 2 EO.
5> put those VO in Application Module.
6> dragged and dropped 2 VO on my jspx page and dropped them as ADF Form.
Now what to do please? -
How to delete the data from partition table
Hi all,
Am very new to partition concepts in oracle..
here my question is how to delete the data from partition table.
is the below query will work ?
delete from table1 partition (P_2008_1212)
we have define range partition ...
or help me how to delete the data from partition table.
Thanks
Sree874823 wrote:
delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
How the table implements its structure is a physical design consideration.
Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
This is a crucial concept to understand and get right. -
How to use the structure in the EXIT_SAPMM06E_013 function module
Hello Experts,
Please guide me how to use the structure defined in function modules under table tab in the driver program for smart form to fetch the data. Please post some sample code if available.
Best Regards,
Sandesh.SreyamshCan you please elaborate little bit more what is the actual requirement?
-
How to retrieve the values from a table if they differ in Unit of Measure
How to retrieve the values from a table if they differ in Unit of Measure?
If no data is read
- Insure that you use internal code in SELECT statement, check via SE16 desactivating conversion exit on table T006A. ([ref|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa0122493111d182b70000e829fbfe/frameset.htm])
If no quanity in result internal table
- There is no adqntp field in the internal table, so no quantity is copied in itab ([ref|http://help.sap.com /abapdocu_70/en/ABAPINTO_CLAUSE.htm#&ABAP_ALTERNATIVE_1@1@]).
- - Remove the CORRESPONDING, so quantity will fill the first field adqntp1. ([ref|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm])
- - Then loop at the internal table and move the quantity when necessary to the 2 other fields.
* Fill the internal table
SELECT msehi adqntp
INTO TABLE internal table
FROM lipso2
WHERE vbeln = wrk_doc1
AND msehi IN ('KL','K15','MT').
* If required move the read quantity in the appropriate column.
LOOP AT internal_table ASSIGNING <fs>.
CASE <fs>-msehi.
WHEN 'K15'.
<fs>-adqnt2 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
WHEN 'MT'.
<fs>-adqnt3 = <fs>-adqnt1.
CLEAR <fs>-adqnt1.
ENDCASE.
ENDLOOP.
- You could also create another table with only fields msehi and adqntp and then collect ([ref|http://help.sap.com/abapdocu_70/en/ABAPCOLLECT.htm]) the data to another table.
Regards,
Raymond
Maybe you are looking for
-
"Error downloading purchased music. Disk could not be read or written to.
I just purchased an album. It downloaded 23 of the 25 tracks until it gave me this error: "There was an error downloading your purchased music. The disk could not be read from or written to." I double checked my hard drive space and found I had about
-
Need help - stuck in extraction of PS CS6 Extended - free trial
I am waiting on a response from someone regarding the trial version of PS CS6 Extended that is stuck in "extracting" and cannot be cleared. This is tying up my system and I have other software I need to install asap. I installed the Download Assist
-
Unaligning background behind text
I put a background behind my headline text, but when i preview, the background jumps about 4 rows away from the text, whats going on I had initially applied character style before dropping the coloured box behind.
-
Hi! I got my new Ipod classic 80g today and have been playing around with the different things which my old ipod mini and ipod nano couldn't do. Synchronizing my playlist was no problem, nor was downloading and syncing podcasts. The only thing that w
-
Pipe Line Material Scenario- interesting
Hi Gurus, I have a very genuine scenario but not getting any SAP standard solution. Scenario is, my plant A (power plant) is producing material POWER as FERT and my another plant B consuming ELECTRICITY as pipe line material. So having two plants (