How to check which column data differs from master table and archive table
Hi All,
i have two tables, table a (a1 number,a2 varchar2,a3 varchar2) and table b (b1 number,b2 varchar2,b3 varchar2).
how to check the data in both the table are same( including all columns).
data in a.a1 is same as b.b1 and a.a2 is same as b.b2 like that.
if they not same , i need to know which field differs.
Kindly Share ur ideas.
887268 wrote:
thanks Sven W. ,
above reply clearly shows what my question is.
one column must be primary key, based on that key i need to find out which are the fields having different data..
im strugling with this, i tried the following already, but not able to get.
select the columns from a MINUS select the columns from b.
-- from this i can find whether the difference occurred or not.
but i cant able to get which are the fields value changed.Good. Then you would match the rows using the PK column and need to compare the columns
Instead of a MINUS + UNION ALL + MINUS we can now use a FULL OUTER JOIN
It is a little task to write out all column names, but 40 columns can be handled.
This statement would show you both tables with matching rows on the same line.
select a.*, b.*
from a
FULL OUTER JOIN b on a.id = b.idNow filter/check for mismatches
select case when a.col1 != b.col1 then 'COL1 value changed'
when a.col2 != b.col2 then 'COL2 value changed'
when a.col3 != b.col3 then 'COL3 value changed'
end as compare_result
,a.*, b.*
from a
FULL OUTER JOIN b on a.id = b.id
/* return only non matching columns */
where (a.col1,a.col2,a.col3) != (b.col1,b.col2,b.col3) You might need to add nvls to take care of null values. Test this!
Another way could be to group upon the primary key
select *
from (
select id
,count(distinct col1)-1 cnt_col1
,count(distinct col2)-1 cnt_col2
,count(distinct col3)-1 cnt_col3
from
select 'A' source, a.*
from a
UNION ALL
select 'B' source, b.*
from b)
group by ID
/* only records with differences */
where 1 in (cnt_col1, cnt_col2, cnt_col3)
;The count columns will hold either 1 or 0. If it is 1 then this column has a difference.
Similar Messages
-
How can I use a date/time from a cursor and insert it into a table later?
I have a cursor which retrieves data from a table which includes a date column, which has date and time.
I want to insert this value into a table which has another date column but when I do, it is dropping off the time data and putting in 00:00:00.
I am using execute immediate and trapped the SQL I am executing:
insert into ifsapp.GSCDB_TRANS_DTL_TAB values (
'GSCDB_COMPANY',to_date('01-DEC-06',3,0 )
and so you can see the date has no time.
The plsql is:
v_sql := 'insert into ifsapp.GSCDB_TRANS_DTL_TAB values ( '''||r_gscdbio.name||''','''||r_gscdbio.last_exec_time||''','||v_count||',0 )';
Any help appreciated, I feel I need to use to_date and/or to_char but my head is spinning!
Thank youWhy are you using EXECUTE IMMEDIATE for this? And why are you not using bind variables? It'll be much easier (and more efficeint, easier to debug, etc) to just have static SQL
INSERT INTO table_name
VALUES( r_gscdbio.name, r_gscdbio.last_exec_time, v_count, 0 );Additionally, you'll want to explicitly specify the column list for your INSERT statement. Otherwise, if you add another column to the table, your code will break.
Justin -
How to check which RFCs causing issues in the system and RFC response times
Hi,
We have an issue with the RFC response times in CRM and need investigstion. We need to know which Which RFCs causing issues and how we can solve the problems.
RegardsHi,
chek the below code
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-* MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF W_RESULT IS INITIAL.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
EXPORTING
DIRECTORY = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
IF W_RESULT = 'X'.
RC = '1'.
ELSE.
RC = '0'.
ENDIF.
reward if helpful.
Regards,
nagaraj -
How to check if Oracle Data Access Components is installed?
How to check if Oracle Data Access Components is installed and version on my computer?
Also How to check if Oracle Data Provider is installed and version?
TIA
Steve42Regedit HKLM->Software->Oracle. See what's there...
At the very least, that can give you paths and can check file versions from there. -
How can I get the data back from my game
How can I get the data back from minecraft if I deleted the app and bought with a different Apple ID
No, they are tied to the ID that purchased them, and cannot be transferred to anyone else.
-
How to find the Column data type changes in table
Hi All,
I need to find out the column data type changes where made recently in table .
How do i check past changes in column data type. Any data dictionary are there to find out the data type changes in the column .
Thanks in advance..<FONT FACE="Arial" size=2 color="2D0000">
You have the answer on hand (user_arguments / all_arguments)!
SQL> desc user_arguments
Name Null? Typ
OBJECT_NAME VARCHAR2(30)
PACKAGE_NAME VARCHAR2(30)
OBJECT_ID NOT NULL NUMBER
OVERLOAD VARCHAR2(40)
ARGUMENT_NAME VARCHAR2(30)
POSITION NOT NULL NUMBER
SEQUENCE NOT NULL NUMBER
DATA_LEVEL NOT NULL NUMBER
DATA_TYPE VARCHAR2(30) --> Data Type
DEFAULT_VALUE LONG
DEFAULT_LENGTH NUMBER
IN_OUT VARCHAR2(9) -->Argument direction (IN,OUT,or IN/OUT)
DATA_LENGTH NUMBER
DATA_PRECISION NUMBER
DATA_SCALE NUMBER
RADIX NUMBER
CHARACTER_SET_NAME VARCHAR2(44)
TYPE_OWNER VARCHAR2(30)
TYPE_NAME VARCHAR2(30)
TYPE_SUBNAME VARCHAR2(30)
TYPE_LINK VARCHAR2(128)
PLS_TYPE VARCHAR2(30)
CHAR_LENGTH NUMBER
CHAR_USED VARCHAR2(1)
Look for Data_Type where IN_OUT say OUT. That will be the data type retruned by that function.
Edited :
or POSITION in argument list,or null for function return value
-SK
</FONT> -
Customize Which Column to Display from UDT in UDF when Linked to UDT
Problem:
I have a UDF that links to a UDT. The problem is that when I select the UDF, it only displayes the columns from the UDT Code & Name. And for our purposes Code & Name are meaningless data points.
Question:
Can I choose which column is displayed from the UDT in the UDF?
Please see the attached image. THANKS!Hi,
This is SAP B1 standard behavior, But you can change name as terminal code. Other wise you can detach the UDT from UDF and then assign one FMS in the UDF for serach terminal code instead of code and name.
Hope this will work.
Regards
Sridharan -
How is the largest cde point differs from UTF-8 to UTF-16
how is the largest cde point differs from UTF-8 to UTF-16
the largest code point is 10FFFF for both of them then how is differ from the fromat
thank you,
Regards,
Jagrut BharatKumar ShuklaIn this specific case there are no differences for code points storing character data because used character set is the same.
But what is your Oracle 4 digits version ?
Are you sure that database character set and national character set are the same ?
In recent Oracle versions, database character set and national character set are different. For example:
SQL> select * from nls_database_parameters where parameter like '%SET%';
PARAMETER VALUE
NLS_CHARACTERSET AL32UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16Edited by: P. Forstmann on 28 sept. 2011 18:51 -
How to schedule Job for data uploading from source to BI
Hi to all,
How to schedule Job for data uploading from source to BI,
Why we required and how we do it.
As I am fresher in BI, I need to know from bottom.
Regards
Pavneet RanaHi.
You can create [process chain |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502b2998-1017-2d10-1c8a-a57a35d52bc8?quicklink=index&overridelayout=true]for data loading pocess and schedule start process to any time/date etc ...
Regadrs. -
How do i move a data file from my pc to my ipad
How do I move a data file from my computer to my ipad? It is my product catalogue and it would help if it were on my ipad.
Plug the iPad into iTunes and you can use file sharing to move it into an app that supports file sharing and that document format.
see http://support.apple.com/kb/ht4094
Or, use an online storage service (iCloud, dropbox, box, google drive, sugarsync, etc) and upload the file to that. Then on the iPad, from within the app you plan to use the file with, link to that service and download the file.
The app will again have to work with that file type, and support the particular service you used. -
How can I delete an Apple ID from one device and replace it with a different ID on that same device?
Tthe brute force method: start with Settings > iCloud and turn off Find My (you will need the password), then change the iCloud ID, then go to the apps such as Messages, FaceTime, etc, and delete the Apple ID and enter the new one.
-
how to check which version of hyperic is installed , hyperic 32 bit or 64 bit version on solaris
If you have only a single home, the quickest/easiest way is probably just to check the properties of %ORACLE_HOME%\odp.net\bin\2.x\oracle.dataacess.dll
Or are you asking how to check it at runtime?
If you want to see externally what is actually loaded by an app you can use process explorer
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
If you want to check it in the app itself:
http://stackoverflow.com/questions/383686/how-do-you-loop-through-currently-loaded-assemblies
Hope it helps,
Greg -
Production finish date differs from basic finish date in backward schedulin
Hi, experts.
When i do scheduling the planned order,
production finish date differs from basic finish date in backward scheduling as below.
Scheduling: Backward
Basic finish date : 2010.01.22
Basic start date : 2010.01.21
Production finish date : 2010.01.23 09:00:00
Production start date ; 2010.01.22 03:57:09
*GR time : 0.
*Scheduling Margin key : 0.
I don't know why production finish date set in 2010.01.23 09:00. ( Basic finish date +1 day)
Please reply me.
Thanks.Dear Jong,
1) what is the parameter used in MRP run, Basic scheduling or lead time scheduling
2) you must find a exception Mssg for that plan order in MD04
3) basic scheduling take the time from material master & lead time scheduling will take time
from Routing
Regards
Madhu -
How we can automate the data loading from BI-BPC
Dear Guru's
Thanks for watching this thread,my question is
How we can load the data from BI7.0 to BPC.My environment is SAP-BI 7.0 and BPC is 7.5 MS version and 2008SQL.
How we can automate the data loading from BI- BPC Ms version.Is manual flat file load is mandatory in ms version.
Thanks in Advance,
Srinivasan.Here are some options
1) Use standars packages and schedule them :
A) Openhub masterdata file into a flat file/ BPC App server and Schedule the package - Import Master Data from a Data File and other relevent packages.
2 ) Using Custom Tasks in Custom Packages ( SSIS)
Procedure
From the Microsoft SQL Server Business Intelligence Developer Studio, open the Microsoft SSIS folder.
Create a new package, or select an existing package to modify.
Choose Task Register Custom Task .
In the Task Location field, browse for the target .dll file.
Note
By default, the .dll files are stored in BPC/Websrvr/bin.
End of the note.
Enter a task description, select an appropriate icon, then click OK.
Drag the icon to the designer window. Enter data as required.
Save the package. -
How to decide which adapter to use from IDOC and RFC?
Hi All,
When interating XI with an SAP system,
How to decide which adapter to use from IDOC and RFC?
Thanks.Hi,
you can also consider to use ABAP Proxy if you are working with Systems based on SAP Web AS 6.40.
Here some useful links:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/02/265c3cf311070ae10000000a114084/content.htm">ABAP Proxy Runtime</a>
ABAP Proxies in XI(Client Proxy)
/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
ABAP Server Proxies
/people/siva.maranani/blog/2005/04/03/abap-server-proxies
How do you activate ABAP Proxies?
/people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
XI: Reliable Messaging EOIO in ABAP Proxies
/people/arulraja.ma/blog/2006/08/18/xi-reliable-messaging-150-eoio-in-abap-proxies
More links for proxy:
proxies and performance...
Hope this help
Francesco
Maybe you are looking for
-
Creation of Hierarchial datasource in 7.0
Hello, I want to create an extractor ( 7.0 ), for loading hierarchy into an infoobject. I came to know that its not possible to create Hierarchial datasource in 7.0 flow ( possible only in 3.X). still is it possible to create one through RSA2 transa
-
"Back Up Disk Image cannot be mounted" AEBS and Time Machine
Hi all, I am hoping someone can help me. I recently purchased an Airport Extreme and was able to connect a G Tech Hard Drive to it and use it as the Backup Disc in Time Machine (thanks to help from other users in the forum). Until yesterday, the back
-
Any problems having Admin Optimization and Proactive caching run concurrently
Hi, We've recently enabled proactive caching refreshing every 10 minutes and have seen data in locked versions changing after Full Admin Optimization runs. Given how the data reverts back to a prior submitted number, I suspect having proactive cachin
-
Oracle xe (windows) and netca
Hi, I need to create a service. Where did the netca, but in xe is not? What should I do? Thanks.
-
Is there any way to keep the keyboard in the same location in iOS6?
Is anyone else having the same problem with iOS6 on the iPhone 5, where the keyboard changes locations? I have some apps that are not optimized for the iPhone 5. When I type in these apps, the app is centered on the screen, which raises the keyboar