Select non matching records
version 10.2.0.2
Create table A (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),update_date sysdate)
Create table A (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),sp_key vrachar2(2),update_date sysdate)
insert into a values ('a123','fdds','sas','sdss',sysdate)
insert into a values ('a124','fdsds','fsas','sds',sysdate)
insert into a values ('a125','pqx','dll','com',sysdate)
insert into b values ('a124','fdsds','fsas','sds','C',sysdate)
output table
Create table A_out (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),update_date sysdate)
output set :
a123,fdds,sas,sdss,sysdate
a125,pqx,dll,com,sysdate
please note joininh will be done on f1...so so i need to select the non matching receords only present in table a.
Hi,
Also, test (and, if necessary, correct your CREATE TABLE and INSERT statemnets before you post them.
1003545 wrote:
Create table A (f1 varachar2(10),f2 varachar2(10),f3 varachar2(10),f4 varachar2(10),update_date sysdate)Maybe you meant to use the data types VARCHAR2 and DATE.
... please note joininh will be done on f1...so so i need to select the non matching receords only present in table a.If you're going to use a join (and a join is one good way to solve this problem) make it an OUTER join.
Similar Messages
-
Regular expression to select non-matching pattern
Hi All,
I am having question on regular expressions
I want to select lines containing non-matching pattern.
For example if we consider following cities:
London
NewYork
Delhi
Mountainview
If above are the given then how to select all cities except "Delhi"
Please suggest. Thanks.Hi,
You need to explain what actually you need to get out. As all these cities are in expression [a-z, A-Z]. Some more input required.
Kuldeep Jangra -
Problem with non-matching records
I have 3 tables - TBL1 is a list of Conditions; TBL2 contains collected data; and TBL3 contains referenced details on the data in TBL2.
TBL2 contains some matching values from TBL1.
Ex.
TBL1
Condition
01 Test A
02 Test B
03 Test C
TBL2
Name, Condition, Value
Host101, 01 Test A, Yes
Host101, 02 Test B, No
Host101, 03 Test C, Yes
Host102, 01 Test A, No
Host102, 03 Test C, Yes
I have them linked TBL1 Left Outer to TBL2 and TBL2 Left Outer to TBL3.
My desire is to get the complete list of Conditions in TBL1 for each record in TBL2, even where there is no matching TBL1 value in TBL2 - so the report results of the above table data would be:
Host101
01 Test A Yes
02 Test B No
03 Test C Yes
Host102
01 Test A No
02 Test B
03 Test C Yes
So even though there is no data returned in TBL2 for Host102, 02 Test B, the record for that entry in TBL1 is still returned in the report.
Currently I have the report structured as follows -
{TBL2 Name}
TBL1 Condition TBL2 Value
Seems quite simple, but I must be missing something somewhere, as I am only able to get the data where the records match, so, in the example above, I am getting only -
Host102
01 Test A No
03 Test C Yes
Any assistance would be much appreciated. Thanks!
Also, I tried doing a simple new report using just TBL1 & TBL2 and still get the same results (also tried a Full Outer join as well).
Frustrating .......
Edited by: Dragon77 on May 17, 2010 2:05 PMAs I said, I have even tried removing TBL3 to make things even simpler - TBL1 & TBL2 Left Outer joined on the common field.
I have tried every combination that I can think of. We're talking on 4 fields in the report -
Group Header 1 = {TBL2 Name}
Group 2 = {TBL2 Unique Field}
Detail = TBL1 Condition TBL2 Value
Group Header 1 = {TBL2 Name}
Group 2 = {TBL2 Unique Field}
Group 3 = {TBL1 Condition} {TBL2 Value}
Detail Suppressed
No matter what I try, I only get matching records.
I've gone so far as to just have the minimal 3 fields
Group Header 1 = {TBL2 Name}
Group 2 = {TBL2 Unique Field}
Detail = TBL1 Condition
Group Header 1 = {TBL2 Name}
Group 2 = {TBL2 Unique Field}
Group 3 = {TBL1 Condition}
Detail Suppressed
The tables only have the 1 field in comon {TBL1, TBL2 - Condition)
This just doesn't make sense. {TBL1 Condition} should have ALL of its entries returned along with any matching records from {TBL2 Condition} - not just where they are equal. -
Function to return in case of non matching records
Hi
CREATE TABLE [dbo].[DeptMaster](
[DeptId] [int] NULL,
[DeptName] [nvarchar](50) NULL
) ON [PRIMARY]
Insert into DeptMaster values
(1,'HeadOffice'),
(2,'BranchOffice'),
(3,'')
CREATE FUNCTION [dbo].[GetDepartmentId]
@DepartmentNameIn nvarchar(128)
RETURNS int
AS
BEGIN
DECLARE @DepartmentId INT
SELECT @DepartmentId = [DeptId] from DeptMaster where LTRIM(RTRIM([DeptName])) = @DepartmentNameIn
If @DepartmentId <0
BEGIN
SELECT @DepartmentId = [DeptId] from DeptMaster where LTRIM(RTRIM([DeptName])) = ''
END
RETURN @DepartmentId
END
select dbo.GetDepartmentId ('BranchOffice') -- will return 2, correct
select dbo.GetDepartmentId ('DivisonalOffice') --- expected 3 ... need to alter my Function so that 3 is returned.
select dbo.GetDepartmentId ('SubOffice') --- expected 3 ... need to alter my Function so that 3 is returned.
-- Reason, Whenever i get data which is not passed, i need to return the 3
kindly suggest how to pass into the If @DepartmentId <0
as i get 0 records if no data is found matching
ShanmugaRajALTER FUNCTION [dbo].[GetDepartmentId]
@DepartmentNameIn nvarchar(128)
RETURNS int
AS
BEGIN
DECLARE @DepartmentId INT ,@flag int
SELECT @DepartmentId = [DeptId] from DeptMaster where LTRIM(RTRIM([DeptName])) = @DepartmentNameIn
If @@ROWCOUNT != 0
BEGIN
set @flag=1
END
ELSE
BEGIN
set @flag=0
END
if (@flag = 0)
begin
set @DepartmentId=3
end
RETURN @DepartmentId;
END -
UPDATE statement converting non matching records to null
Hi
I am trying to update a table that contains the columns partnerkey, timekey and is_current. At present the is_current field is set to 'N' for all records. I want to update this to 'Y' where the timekey is most recent, and leave the others as 'N'.
I wrote the following update statement:
UPDATE d_partner_all_time d
SET d.is_current =
(SELECT 'Y'
FROM (select partnerkey, max(timekey) timekey from d_partner_all_time group by partnerkey) pl
WHERE d.partnerkey = pl.partnerkey
AND d.timekey = pl.timekey
While this did update all the latest timekey records to have an is_current value of 'Y', all the other values that were previously 'N' have now been changed to null.
Can anyone explain why this is and what i should change to prevent it?
ThanksSQL> CREATE TABLE D_PARTNER_ALL_TIME
2 (
3 IS_CURRENT CHAR(1),
4 PARTNERKEY NUMBER,
5 TIMEKEY DATE
6 );
Table created.
SQL> INSERT INTO D_PARTNER_ALL_TIME VALUES ('N',1,TO_DATE('01/01/2009','DD/MM/YYYY'));
1 row created.
SQL> INSERT INTO D_PARTNER_ALL_TIME VALUES ('N',1,TO_DATE('02/01/2009','DD/MM/YYYY'));
1 row created.
SQL> INSERT INTO D_PARTNER_ALL_TIME VALUES ('N',1,TO_DATE('03/01/2009','DD/MM/YYYY'));
1 row created.
SQL> INSERT INTO D_PARTNER_ALL_TIME VALUES ('N',2,TO_DATE('01/01/2009','DD/MM/YYYY'));
1 row created.
SQL> INSERT INTO D_PARTNER_ALL_TIME VALUES ('N',2,TO_DATE('02/01/2009','DD/MM/YYYY'));
1 row created.
SQL> INSERT INTO D_PARTNER_ALL_TIME VALUES ('N',3,TO_DATE('03/01/2009','DD/MM/YYYY'));
1 row created.
SQL> commit;
Commit complete.
SQL> select * from D_PARTNER_ALL_TIME;
I PARTNERKEY TIMEKEY
N 1 01-JAN-09
N 1 02-JAN-09
N 1 03-JAN-09
N 2 01-JAN-09
N 2 02-JAN-09
N 3 03-JAN-09
6 rows selected.
SQL> UPDATE
2 D_PARTNER_ALL_TIME D
3 SET IS_CURRENT = 'Y'
4 WHERE
5 TIMEKEY =
6 (SELECT MAX(TIMEKEY) FROM D_PARTNER_ALL_TIME A
7 WHERE
8 A.PARTNERKEY = D.PARTNERKEY
9 GROUP BY PARTNERKEY);
3 rows updated.
SQL> select * from D_PARTNER_ALL_TIME;
I PARTNERKEY TIMEKEY
N 1 01-JAN-09
N 1 02-JAN-09
Y 1 03-JAN-09
N 2 01-JAN-09
Y 2 02-JAN-09
Y 3 03-JAN-09
6 rows selected. -
URGENT: Selecting only 25 records at a time from a table
URGENT !!!!
Hi,
Im having a RFC which selects records from a table (say table_A) and depending on these selected records, further processing is done within that RFC.
Now my problem is, this table_A contains around 200 matching records. Due to this entire logical processing consumes lot of time. Hence my RFC is taking huge time to produce result. (apprx 10 mins).
Can i select these matching records in batch of 25 and display result for these 25 records??
I'll give this batch size as input to RFC?
Do anybody have any idea about how to tackle this situation and reduce response time?
If u hav any better solution than this then pls pls let me know ASAP..
Regards,
AmeyAmey Mogare ,
Do One thing , create a new importing parameter in your RFC , say current_trans_id. NOw on the first call pass the initial value for current_trans_id.
then inside the logic .. change the select to
select upto 25 rows where trnascation id > current_trans_id.
next time when u call teh rfc.. send the last selected id as a value for current_trans_id.
i think you can some how use this logic
Regards
Sarath -
Default Import Action in the Match records tab in Import Manager
Hi All,
In one of the requirements, I tried importing the data to MDM system from a source XML. The map was already existing and I used the same to work out the import. The same is working fine in the other environment however Development shows some different behaviour.
I got following Default import actions after selecting the matching fields.
4 of 4 Single None Skip - Changed to Create
0 of 0 Single Exact Skip - Updated (All mapped values)
0 of 0 Multiple Exact Skip [I want to make this field as update(all mapped values). However I am only getting two options to be selectied here "Skip" & "Replace". how can I enable the other two options to be selected in Default import action and save the updated map]
I am currently on MDM7.1 SP05.
I tried verifying the field and value mapping, configuration options and it is same as in the othe systems in the environment.
Can someone help me resolve this asap?
Thanks & Regards
RahulHi Kanstantsin, Adrivit
you are right. My Dev and Preprod are in Sp5 and Prod is in SP3 at the moment.
However there's no need for me now to use replace since the intended functionality is met with the earlier two option.
Hi Adrivit,
Well I have the complete data being refreshed in everyday import so it is showing for me the multiple records with exact matching.
In any case, thans for your opinions/suggestions.
I am closign the thread now. -
Import Manager Match Records question
Hi
I am following the below file
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0a9cee4-9cd1-2a10-62b6-ea2acb06a5a3
Till 5.2 I have done it successfully
while proceeding through the match records
i.e.
In Import Manager, Match Records------> Default Import Action
is not active to create Records
35 of 35 ->None->None--->SKIP (its inactive)
pls check this screen shot
http://www.flickr.com/photos/11212307@N08/2555733854/
why it is inactive , where should I have to check
Any Help pls
Thanks
manianHi,
i have got your Problem, you could come to know if you try this
Create an Excel file as below
Category Type Attribute Value
PC Text A 10
PC Text B 11
Now during import this Taxonomy:
First Map your Source Category Field with your Target Name Field when Select Categories as Destination Table
So in MDM Data Manager: when select Categories as destination Table you will GET PC as Value there.
Noe 2nd step Select Categories( Attributes) as your Destination Table here Map Source Attribute and Type Fields with corresponding Target Destination fields.
If you skip this 2nd step and just go for Saelcting Categories(Text Values) as your Destination table , the problem you describe is come into picture.coz that attributes are not available into MDM data Manager.thats why even for Update All Update Options it is showing 0 Record.
Hope it will clear your doubt,
Rewards if useful.....
Mandeep Saini
Edited by: Mandeep Saini on Jun 6, 2008 9:51 AM -
Match Records - Import manager
Dear Experts,
When there is a table with NO DATA init, the match records options work diffrently.
This could be because matching record allways tries to compare source with destination values.
As here the destination table is blank i guess this could be the reason i am not able to judge the outcome.
Lets say i have 3 fields.
name dept cost
adapter IT 20
adapter IT 20
when i try to import the above data..
matching fileds : name
active match type default import action
2 of 2 NONE CREATE
Now if i chk the DM i can see only 1 record.
Is this behaviour correct!!! please educate me if i am missing something.
I would like to know how matching records work on a empty table.
Kind Regards
EvaHi Eva,
if 2 fileds selected INDIVIDIALLY.
1st field values are duplicated and second field does not have duplicate.
all the records where 1st field duplicates are present ARE NOT IMPORTED.
Yes, your understanding is partial correct, i mean new record will not imported(gets created into MDM) but it can be imported with updated fields with conditions (Partial or conflict) only
Now, when i need to push some data to a table which has data already.
-> it first chks the Matching fields comparision 'within' source fields data first.
-> then it compares the result data and Destination data
See as suggested above, if you select matching field as single field or Multiple fields selection with combined option then it worka as single match for these records if it finds already existing match for the combination of these fields only in that case you will able to update else result in newly created records.
If you go mutliple fields selection with Individual Option, I mean you will able to create new record only if all of these records fields has distinct values e.g. Suppose
Existing record in MDM
Name dept rating
adapter elec 30
will create new record only if your source file has below record.
Name dept rating
adapter1 elec1 40
else if you have any of the record for which any of the fields has same value it will only update the records based on condition as below:
Exact. All the individual value matches are Equal. e.g. source file has values adapter elec 30
Partial. At least one value match is Equal and at least one Undefined; e.g source file has values adapter 20
here one value is equal adapter, one value is not defined value for dept is null in your source file
Partial. At least one value match is Equal and no value matches are Not Equal e.g source values as adapter elec1 40
Conflict. At least one value match is Equal and at least one value match is Not Equal. e.g. Src value as adapter elec 40
@Sudhanshu, M i right or not. Your understanding is correct. Imported records would be only one of these 1 a d, 1 a z , 2 a b
For more understanding Please refer page 347-348/432 of import Reference guide
http://help.sap.com/saphelp_nwmdm71/helpdata/en/4b/72b8e7a42301bae10000000a42189b/MDMImportManager71.pdf
Figure 220. Multiple matching fields (SKU and UPC) and Figure 221. Multiple matching fields (SKU and Mfr. & PartNo.)
Hope it clarifies both of you.
Regards,
Mandeep Saini -
How get all record from master and matching record from detail
hi master
sir i have master detail table
i have many record in master table but some record in detail table how i get
all record from master and matching record from detail
such as
select m.accid,m.title,d.dr,d.cr from master m, detail d where m.accid=d.accid
this query not work that get only related record i need all record from master
please give me idea
thanking you
aamirhi master
sir i have master detail table
i have many record in master table but some record in
detail table how i get
all record from master and matching record from
detail
such as
select m.accid,m.title,d.dr,d.cr from master m,
detail d where m.accid=d.accid
this query not work that get only related record i
need all record from master
please give me idea
thanking you
aamir
select m.accid,m.title,d.dr,d.cr
from master m, detail d
where m.accid=d.accid (+)The outer join operator (+) will get you all the details from master and any details from the detail if they exist, but the master details will still be got even if there are not details.
Note: Oracle 10g now supports ANSI standard outer joins as in:
select m.accid,m.title,d.dr,d.cr
from master m LEFT OUTER JOIN detail d on m.accid=d.accid -
No matching record found 'G/L Accounts'
Hello,
When I try to copy an A/P Credit memo from an A/P invoice, the following error message appears: "No matching record found 'G/L Accounts' (OACT)[ODBC 2028]"
This message appears only when I select some lines from the credit memo. If I choose all lines, the credit memo is created.
SAP 8.8 PL 18
Any idea please?Hi NADIA BENLAMLIH,
Check This Link.
http://forums.sdn.sap.com/search.jspa?threadID=&q=Nomatchingrecordfound%27G%2FL+Accounts%27&objID=f264&dateRange=all&numResults=15&rankBy=10001
Generaly this type Error occured for the G/L Account Determination check it.
Thanks,
Srujal Patel -
No Matching Record Found 'CRD1' at the time of Purchase Order Creation
Hi !
I have transferred business partners record through DTW 2005.0.17 in SAP B1. Now when I go to make purchase order, at the time of selecting business partner, It gives error msg. No matching record found 'CRD1'. I have checked the table CRD1, there the data exists. And when i modify business partner's address through business partner form, the problem is solved. I am not able to trace which value i am missing at the time of data transfer.
can anyone help?
Anupam Negi
[email protected]thanks jimmy,
I tried as per your suggestion, i deleted the following tables OCRD,ACR1,ACRB,ACR3,CRD1,ACRD,ACR2,CRD2,CRD5,CRD3,CRD7, then again imported the BP records. Its still giving the same error. I have imported the Business Partner Main template & Business partner Address template. Is it neccassary to import all other templates i.e. BPNankAccount,BPPaymentDate,BPPaymentMethod,ContactEmployees -
Import Manager - Match records clarification
Hi
In the Import Manager, Match records I would like to have two different fields as match criteria, where I want to gave OR condition betweeen them, how do I achieve the same.
quick response would be appreciated.
thanks & regards
AlexanderIn the Import Manager under the tab "Match Records" all possible matching fields are listed in the "Mapped destination fields" box. With double click you can define them as matching fields, they show up then in the "Matching fields" box. An "OR" combination of fields exists, when each entry is displayed in a separate line, an "AND" combination of fields exists, when two entries are displayed in the same line. You can acchieve this by marking entries and pressing then the buttons "Combine" => two entries in one line or "SPlit" => each entry in one line.
After changing the entries, the matching is started again. In the matching results, you can see then, whether records have a 100% match (each of the selected fields) or a partial/conflict match. Partial and conflict matches mean, that at least one of the compared fields match.
This is described in detail in the Data Manager Guide.
Hope, this helps, Klaus -
Payment wizard -No matching records found 'Bank Codes' (ODSC) (ODBC -2028)
Hello dear experts,
I'm trying to execute the payment wizard to receive a payment from a vendor
The invoice appears in the recommendation report but the payment isn't added when i execute the payment run.
It appears after that in the Non-Included transactions with the following error message :
No matching records found 'Bank Codes' (ODSC) (ODBC -2028)
Can you solve this problem?
Thank youHi,
Could you find the followings regarding bank information and check if all the settings are correctly defined
1. Define payment run defaults > Payment method
Check payment method details from Administration > Setup > Banking
> Define payment methods
Payment method which is linked to BP > payment means - Bank transfer
2. ODSC table, Bank Code (just to check bank codes are stored well)
3. BP master data > Payment terms > BP Bank accounts
4. BP master data > Payment system > House bank.
Also Check Note no [971105|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0000971105].
Regards
VIkas
SAP Business One Forums Team -
Hello All,
I need to develop a query for "Non Matched PO receipts" with the fo;;woing columns
Supplier Code
Spplier Name
quantity received (NOT MATCHED)
unit price
currency
exchange rate
receiving date
payment term (assigned to PO)
so i have wrtiten the following query but it is not returing data is my query correct
select pv.vendor_type_lookup_code Supplier_code,
pv.vendor_name Supplier_name,
rsl.quantity_received,
aida.unit_price,
aida.Exchange_rate,
aia.invoice_currency_code,
att.name Payment_term
from AP_Invoices_All aia,
aP_invoice_distributions_all aida,
PO_vendors pv,
AP_TERMS_TL att,
rcv_transactions rt,
rcv_shipment_lines rsl
where aia.vendor_id=pv.vendor_id
and aia.invoice_id=aida.invoice_id
and aida.po_distribution_id is null
and aia.terms_id=att.term_id
and aida.rcv_transaction_id = rt.transaction_id
and rt.shipment_line_id = rsl.shipment_line_id
Thanks,
KumarHi,
Whenever you need help on this forum, post:
(1) The version of Oracle (and any other relevant software) you're using
(2) A little sample data (just enough to show what the problem is) from all the relevant tables
(3) The results you want from that data
(4) Your best attempt so far
Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
Formatted tabular output is okay for (3). Type {code} before and after the tabular text, to preserve spacing.
You've already done (4), but it would be better if you could use {code} tags around that, too: it's hard to read without any formatting.
Maybe you are looking for
-
Another "there was an error opening this document. this file cannot be found"-question
Hello people, as the title suggests, i have another question regarding the "there was an error opening this document. this file cannot be found" error. I have searched on Google and on these forums but i havent found an answer to my particular case (
-
I want to change my icloud id on my iPhone, but it won't let me now that i have upgraded. I no longer have the password and the problem is It is using an old id which the email isn't valid and the security question does not think my birthday is vali
-
Prevent "*" modification image with filter plugin
Hi, it is possible prenvent " * " modification image, near name, when plugin read only input data ? I don't change nothing in the image, I just read pixel data from FilterRecord::inData. Franco
-
SOA 12C Enterprise Deployment - Clustered
We are currently implementing 12c with OSB(Oracle Service Bus), OTD (Oracle Traffic Director) and SOA AS you can imagine the build has a number of SOA composites. IN our Test and Production environments, we have 2 nodes per cluster, and we have separ
-
Maintaining WebUI Business Roles in PFCG/Infotype 1263
Hello there, we are migrating from CRM 4.0 to CRM 7.0 and have to maintain the Business Roles for our users in the organization modell (PPOMA_CRM). Usually we have to assign the business role to the position. All users under this position will get th