Selecting a set of records with diff docs but with same docno
Dear Oracle Gurus
Consider the following Data
DocNo Doctype
===== ======
1021 PJ
1021 TJ
1022 TJ
1022 TJ
1022 PJ
1023 TJ
1024 PJ
1025 PJ
1026 PJ
1026 TJ
1027 PJ
1028 PJ
1028 TJ
As specified there will be transactions involving Doctype PJ alone . and also for certain transactions Doctype PJ and TJ wll be recorded.
I would like to Select those Docno where there are both PJ and TJ are there leaving out records with doctype PJ alone
Kindly guide me in this regard. I got confused
With warm regards
ssr
Hi, and Happy New Year!
Max gave a good solution for the problem you posted. If, in your real data, (docno, doctype) is not unique, why not post some sample data where that combination is not unique?
You can modify Max's solution to count each doctype only once:
SELECT docno
FROM mytab
WHERE doctype IN ('PJ', 'TJ')
GROUP BY docno
HAVING COUNT (DISTINCT doctype) = 2
;The WHERE clause is necessary only if, unlike your sample data, there are other doctypes besides 'PJ' and 'PT'.
Similar Messages
-
New info record with same details as archive one.
Hi Experts,
Due to some issue we want to archieve some standard info record which are created on vendor / material group / plant basis.My query is does system allows to create new info record with same vendor / material group / plant combination after archiving earlier record which is on same basis.
Thnaks & Regards
VinayHi Jurgen,
Thanks for reply.
Our issue is while creating work order(IW31) having external services upon entering info record number in some cases in same client rate is picked up from info record condition but some times from last purchase order based on info update.
We have checked following points.
1.In all the cases work order type is same.
2.Info record are of standard type with same condition.info record are for vendor & material group combination.
3.Checked after changing rate in info record and in purchase order but similar issue exists
4.Compare vendor master also.
5.Their are no contract /sch.agreement for vendors.
Our requirement is to have rate from info record in all the cases in work order.So have two options.
1.Archiving info record-But will need setting in SPRO and also need to create same record again with same combination.Also as their are recent purchase order against those info record not sure whether system will allow or not.Can you please tell what are prerequiste for archiving info record.
or
2.To remove only purchase order number updated in EINE table in those info record where this issue is occuring.We have checked in development system and after removing purchase order number in EINE table it picks up rate from info record.
So thought of checking before removing order ref.from EINE table.
Thanks
Vinay -
Can anyone help me out with a master data load failure.
My request goes off red and the message looks somehow like "Record filtered in advance as error records with the same key exist", "Filter out new records with same key". I have already checked the duplicate handle record setting in DTP. Still why am i getting this error.
Would appreciate if some one could suggest me in this.Hello Shridevi M ,
When I execute my DTP, I get a master data load failure : "Record filtered in advance as error records with the same key exist" . It's the same as you get. Please tell me how did you solved this probelm?
Thanks in advance,
Abdellatif -
Duplicate record with same primary key in Fact table
Hi all,
Can the fact table have duplicate record with same primary key . When i checked a cube i could see records with same primary key combination but the key figure values are different. My cube has 6 dimentions (Including Time,Unit and DP) and 2 key figures. So 6 fields combined to form the composite primary key of the fact table. When i checked the records in se16 i could see duplicate records with same primary key. Ther are no parallel loading happening for the cube.
BW system version is 3.1
Data base is : Oracle 10.2
I am not sure how is this possible.
Regards,
PMHi Krish,
I checked the datapacket dimention also. Both the record have same dimention id (141). Except the Keyfigure value there is no other change in the Fact table record. I know this is against the basic DBMS primary key rule. But i have records like this in the cube.
Can this situation arise when same records is there in different data packet of same request.
Thx,
PM
null -
When we click on the copy botton record with same name should not be saved
Hi,
Copy button will copy the record with the same name and will save it.our requirement is when we click on the copy botton ,record with same name should not be saved
we are performing this task in custom object 12 and exposed Opportunity Name in the layout.
Records with same Opportunity Name should not save ..when we copy the record
Can we perform any field validation on Opportunity Name field?
Please help
please email me @ [email protected]
Thanks
Srinivas MeruguOpportunities that are assoicated to the same account cannot have the same name. You cannot make this unique for your whole instance. The only way that you could do this would be to create a webservice application that checks this before you save the record.
What about defaulting the name each time this could make the record unique? -
Two records with same key (Infocube)
Hi,
I was trying to do, in a update rule, an "IF" condition with two key figures.
IF Kf1 > Kf2. result = Kf1 else result = Kf2.
But the data in the source (datamart Infocube to infocube) have tow records with the same characteristics combination (the same keys)and different amount in the keyfigures, then the result of my "if" condition is not the expected because I understood in the infocube only exists one characteristics combination. :S
I was seeing those records in the manage transaction of the infocube.
Some reason for this?
Thanks and regards
Victoria LeóThis can happen with parallel loads. Two rows with same set of Char values but in different packets of the same Request, being loaded at the same time.
It really shouldn't be an issue - your update rule will make the KF change as desired. Your queries aggregate KFs based characteristic values, not Dim IDs, so you'll get the totals you expect.
Here's some more info:
There is an RSRV Test that lets you check a dimension for a cube to see if multiple DIM IDs exist for the same combination of Chars - <b>Multiple Entries in Dimensions of a (Basis) InfoCube</b>
Output looks like:
12:02:24 o'clock on 08/25/2006: Start test run for user PIZZAMAN:)
Dimension ZFM_C521: DIMID 61,215 and 61,214 have same characteristic values
Dimension ZFM_C521: DIMID 61,880 and 61,879 have same characteristic values
Dimension ZFM_C521: DIMID 61,366 and 61,365 have same characteristic values
Dimension ZFM_C521: DIMID 61,368 and 61,367 have same characteristic values
12:02:24 on 08/25/2006: Test run for user PIZZAMAN:) completed
You can run the Correct Error option to have it update fact rows to use one of the DimIDs if you want, but unless you have lots of them, I even wouldn't bother.
Here's the description of the test:
<u>Description</u>
This elementary test recognizes whether there are several lines that have different DIMIDs(dimension table key), but have the same SIDs for the selected dimension table for the InfoCube specified. (This can occur by using parallel loading jobs). This has nothing to do with an inconsistency. However, unnecessary storage space is occupied in the database.
<u>Repairs</u>
Since the different DIMIDs with the same SIDs are normally used in the fact tables, they cannot simply be deleted. Therefore, all of the different DIMIDS in the fact tables are replaced by one DIMID that is randomly selected from the equivalent ones. Before a change can be made to the database, the consent of the user is requested.
DIMIDs that have become unnecessary are deleted in the connection. In doing so, not only are the DIMDs deleted that were released in the first part of the repair, but so are all of those that are no longer used in the fact tables (including aggregates). The consent of the user is again requested before this change is made. -
Query to get the records with same last name
I need to write a single sql query to get all records with duplicate last_name's. For example, if tab1 has 4 records:
10 Amit Kumar
20 Kishore Kumar
30 Sachin Gupta
40 Peter Gabriel
then the query should return
10 Amit Kumar
20 Kishore Kumar
id, name,L_name being the 3 columns in table
Apprecite you help.
Thank you
MarySQL> create table mytable (id,name,l_name)
2 as
3 select 10, 'Amit', 'Kumar' from dual union all
4 select 20, 'Kishore', 'Kumar' from dual union all
5 select 30, 'Sachin', 'Gupta' from dual union all
6 select 40, 'Peter', 'Gabriel' from dual
7 /
Table created.
SQL> select id
2 , name
3 , l_name
4 from ( select t.*
5 , count(*) over (partition by l_name) cnt
6 from mytable t
7 )
8 where cnt > 1
9 /
ID NAME L_NAME
10 Amit Kumar
20 Kishore Kumar
2 rows selected.Regards,
Rob. -
Hi,
I have created one external content type in sharepoint designer to insert/update/delete table data.
This table contains Primary key constraint.
Then I have added this external content type to Sharepoint out of box List.
Insert/Update/Delete is working fine. But when I am trying to insert record with the same id which is already exist in table, page crashed and its giving me following error:
“Violation of PRIMARY KEY constraint 'PK_tbl_Accounts'. Cannot insert duplicate key in object 'dbo.tbl_Accounts'.
The duplicate key value is (1). The statement has been terminated.”
So I want to handle this exception. Can we show any popup message to hide this error?
Thanks & Regards
RajniAvoid entering of primary from form if possible.
if not try to customize the new form with infopath and place your custom logic there.
http://lightningtools.com/uncategorized/modifying-external-list-forms-with-infopath-2010/
http://salnikan.wordpress.com/2011/07/26/prevention-of-duplicate-entries-based-on-two-or-more-columns-in-a-sharepoint-list/
Bala -
Purchase info record with same values
Hi,
I want to create purchase info records with the same material vendor purchasing org. plant ,how can it be done.
This is required because it is possible for the same vendor to deliver material for the same plant and purchasing organisation.Is there a workaround or any reason for this.
RegardsIn SAP , this is not possible to have 2 different inforecords for the combinaiton of MaterialVendorPur orgPlantinfo record type
could you please explain more regarding the requirement ....
Regards
Mani -
Change selected file to a file with same name but different extension.
So I'm getting better at using Automator to create useful Services but still a bit of a newbie with doing powerful things with AppleScript... and I think this task requires some applescripting. Here's what I want to do:
1. Based on a selected text file I want to run a pre-existing script that converts this file into an HTML file. This new file has the same name as the text file but has the .html extension rather than the .txt extension. (This step is easy enough and it works just fine already.)
2. BUT NOW, I want to take that resulting HTML file and run another pre-existing script that converts the HTML file into an RTF file. The problem is that I basically want to change the selection from selectedfile.TXT to selectedfile.HTML so that I can proceed to this next step...
3. AND THEN, I want to launch an app with this resulting RTF file. Again, I need to change the selection to selectedfile.RTF.
Right now this requires me to run three different services, and changing the selected file between each step... But I'm sure there's an easy applescript way (or other way) to do this using just one service -- probably involves some filename parsing and some magic to change the selection??? -- or something like that...
Could anyone point me in the right direction???
Thank you thank you thank you!
~zyyyyYou can chain your scripts together - depending on the complexity of your pre-existing scripts, you could do this with either AppleScript or Automator. The workflow would just take the selected text file (from step 1), convert to both HTML (2) and RTF (3), then launch your application with the resulting RTF - no need to change any selection.
By the way, this is the Tiger Automator forum - Snow Leopard's Automator is quite a bit different, so you will probably have better luck posting in the Snow Leopard forum. -
1,000 menu items - each selection plays unique audio clip with same video
Hi all,
We're familiar with playing different audio tracks based on a menu selection - but we have a large number of clips for this project... so, here's our question:
A viewer of our 30 minute dvd throws it in the player and selects the city they live. We want to have about 1,000 city names they can choose from.
Based on their selection, (eg: Los Angeles) the DVD will play and then at 7 different points during playback, we need the name "Los Angeles" inserted/played along the main audio track. If someone selects Portland, then Portland would be spoken in that spot instead, etc.
In terms of audio files, we have the one main audio that is the same for all menu selections, except for the spots where the city goes, it is just blank.
We have recorded 1,000 unique audio clips of just the city name we want to include . (1 to 2 seconds long)
What's the best way to insert the audio where we need it during playback - or is it even possible? (non-blu ray). There is audio just before and after the point where the city name has to go, so the timing during playback is critical. (no pause or hiccup when inserting.)
We thought about outputting 1,000 unique audio tracks (each 30 minutes long) that include the full audio along with the city, but we seem limited in the number of audio tracks on the Encore timeline (at least based on our limited authoring experience - is there a way to get more clips in encore beyond the # of audio tracks it allows?)
In reading other posts, it seems we can set markers along the main audio track, dump all our city clips on a handful of audio tracks and have them pull in where needed but it seems it will cause the dvd to pause when doing this, and make for an interrupted viewing experience. Is that true?
Any ideas/thoughts are greatly appreciated...
kayLet's see if someone can tell us how this might be done, but I say the answer is "no."
First, DVDs are made for playing on TVs as programs, not as interactive media. You pick one audio track, and that is all you get. To do what you want (the main audio track with one of a thousand names spoken also), you need a thousand audio tracks.
Even if it were possible, I think the number of menu choices (max 36 buttons on a single 4:3 menu) and the max 1 gig of menu on a disk, and if not those, the max 99 vts per disk (and for Encore which uses 1 vts per timeline, a huge task to figure out how to make all those clips into chapters on timelines) etc. -
Merging Records with same or NULL values
Hi,
create table AS_ITM (id_itm NUMBER, diff_1 VARCHAR2(20), diff_2 VARCHAR2(20));
insert into as_itm values (22188212, 'J068', 'C001');
select id_itm, diff_1, diff_2 from as_itm;
output:
22188212 J068 C001
create table RK_DIFF_DESC (diff_id VARCHAR2(20), diff_type VARCHAR2(20), diff_desc VARCHAR2(20));
insert into RK_DIFF_DESC values ('C001', 'C', 'Red');
insert into RK_DIFF_DESC values ('J068', 'S', '6.8gm');
select diff_id, diff_type, diff_desc from RK_DIFF_DESC;
output:
C001 C Red
J068 S 6.8gm
Now I am writting a query to get the out put ::
SELECT i.id_itm,
i.dept_id,
CASE WHEN (DIFF.DIFF_TYPE = 'S') THEN diff.DIFF_DESC ELSE NULL END
AS SIZE1,
CASE WHEN (DIFF.DIFF_TYPE = 'C') THEN diff.DIFF_DESC ELSE NULL END
AS COLOR
FROM as_itm i
LEFT OUTER JOIN
RK_DIFF_DESC diff
ON (i.diff_1 = diff.DIFF_ID OR i.diff_2 = diff.DIFF_ID);
output:
ID_ITM DEPT_ID SIZE1 COLOR
22188212 4103 6.8gm
22188212 4103 Red
My requirement is to get a single record like this:
ID_ITM DEPT_ID SIZE1 COLOR
22188212 4103 6.8gm Red
I can do this joining RK_DIFF_DESC two times with AS_ITM using below query.
SELECT a.id_itm,
a.dept_id,
b.diff_desc size1,
c.diff_desc COLOR
FROM as_itm a
LEFT OUTER JOIN RK_DIFF_DESC b
ON (a.diff_1 = b.DIFF_ID AND b.diff_type = 'S')
LEFT OUTER JOIN RK_DIFF_DESC c
ON (a.diff_2 = c.DIFF_ID AND c.diff_type = 'C')
Is there any other way to merge the above two lines into one joining RK_DIFF_DESC only 1 time ?
..............................select id_itm, max(SIZE1) SIZE1, max(COLOR) COLOR
from
select id_itm,
case diff_type when 'S' then diff_desc end SIZE1,
case diff_type when 'C' then diff_desc end COLOR
from AS_ITM a, RK_DIFF_DESC r
where diff_1 = diff_id or diff_2 = diff_id
group by id_itm;
ID_ITM SIZE1 COLOR
22188212 6.8gm Red
1 row selected. -
While i am trying to save the existing record with same fields in cloud DTO using flex4 mxml app
hi,
i am doing flex4 web application with mxml tags,
i am having one text box and one datagrid and one save button. text box having one company name, data grid having employee names.
when i click save button which is placed in outside the datagrid it will save all the details in cloud DTO.
Now my requirement is text box having the same company name and when i enter same employee name in datagrid and click save button means it wont
allow to save that record, and through msg box with some alerts.
this is my code:
private function saveRecord():void
refreshRecords();
model.employeeDetailsReq=new EMPLOYEEDETAILS_DTO();
var lengthindex:uint=model.employeeDetailsReqRecordsList.length;
var i:int;
for (i = 0; i < lengthindex; i++)
if((model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employee name==customerdet.selectedItem.employeename)&&
(model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employeeNumber==customerdet.s electedItem.employeeID)){
Alert.show("you cannot Add Same CustomerName and Invoiceno again");
(when this line come the error through like this: Index '8' specified is out of bounds.
else
var dp:Object=employeedet.dataProvider;
var cursor:IViewCursor=dp.createCursor();
var employeename:String = employeename.text;
model.employeeDetailsReq.employename = employeename;
model.employeeDetailsReq.employeeNumber=cursor.current.employeeID;
var sendRecordToLocID:QuickBaseEventStoreRecord = new
QuickBaseEventStoreRecord(model.employeeDetailsReq, new
KingussieEventCallBack(refreshList))
sendRecordToLocID.dispatch();
<mx:Button id="btnAdd" x="33" y="419" enabled="false" label="Add" width="65" fontFamily="Georgia" fontSize="12" click="saveRecord()"/>
employeename and employeeID are datafields of datagrid. datagrid id=customerdet
employeeDetailsReqRecordsList---recordlist of save records
please help .
any suggession or snippet code welcome
B.venkatesansorry but you question is not very clear...are you trying to show the item clicked on the datagrid on the input box? with an alert? you should look at "listevent" if thats the case?... sorry i just dont follow.
Miguel -
Getting Multiple Records with Same Key throws Access Violation
Are there any known issues with PInvoke Signatures for GET .. Im gettign consistently AVL's when attempting to read Multiple Values under single key ..
Error doesn't happens while debugging in VS 2007 , Tried turning off optimizations with no luck ..
Im using VS 2010 and .NET 4.0 ( WIN XP) . I do have a repro. ( Im using latest bits from Oracle site as of 9/10/2010 )
Unhandled Exception: System.AccessViolationException: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at BerkeleyDB.Internal.libdb_csharpPINVOKE.db_strerror(Int32 jarg1)
at BerkeleyDB.DatabaseException..ctor(Int32 err) in C:\Users\gmf\db\db-5.0.26
\csharp\DatabaseException.cs:line 78
at BerkeleyDB.DatabaseException.ThrowException(Int32 err) in C:\Users\gmf\db\
db-5.0.26\csharp\DatabaseException.cs:line 34
at BerkeleyDB.Internal.DB.get(DB_TXN txn, DatabaseEntry key, DatabaseEntry da
ta, UInt32 flags) in C:\Users\gmf\db\db-5.0.26\csharp\Internal\DB.cs:line 187
at BerkeleyDB.BaseDatabase.Get(DatabaseEntry key, DatabaseEntry data, Transac
tion txn, LockingInfo info, UInt32 flags) in C:\Users\gmf\db\db-5.0.26\csharp\Ba
seDatabase.cs:line 900
at BerkeleyDB.Database.GetMultiple(DatabaseEntry key, Int32 BufferSize, Trans
action txn, LockingInfo info) in C:\Users\gmf\db\db-5.0.26\csharp\Database.cs:li
ne 494
at helloworld.Program.Main(String[] args) in C:\bdm\helloworld\helloworld\Pro
gram.cs:line 53
Appreciate any help.
Thanks
Nirmal
Edited by: user8050299 on Sep 10, 2010 3:29 PM
Updated with OSseems like oracle .NET bindings doesnt work for new CLR . It works fine with .NET 2.0
May be Oracle folks will release new version for 4.0 -
Hi all
SYSTEM GIVES AN ERR MESSAGE " THE CONDITION IS BEING PROCESSED IN THE CURRENT SESSION">
Our company wants to maintain different prices for different packages of same material.
i.e REQUIREMENT IS TO MAINTAIN DIFFERENT PRICES FOR SAME MATERIAL WITH DIFFERENT UNIT OF MEASURE (UOM)
Material Amount Uniit per Unitof Measure Valid from Valid to
XYZ 1000 inr 1 Z1 01/11/2010 29/11/2010
XYZ 500 inr 1 Z2 01/11/2010 30/11/2010
where Z1 = 1 litre
Z2 = 1 mililitre
System does not accepts the second line, saying the condition is being processed in the current session. Could anyone please give a solution for this.Hi,
You cannot maintain different prices for the same material based on UoM. You have to create different materials based on the pack size.
Regards,
Palani
Maybe you are looking for
-
10.4.6 AFP & PhotoShop CS2 crashes
Hello all, I'm trying to save PhotoShop files to a Windows 2003 AFP (ExtremeZ-IP) volume and PhotShop occasionally will crash, but after saving the file. It doesn't crash all the time. What I've tried: I've updated the ExtremeZ-IP application running
-
Win7ProSP1, 64Bit Intel i5 CPU, [email protected] 3.3GHz, 4GB RAM installed. Flash working fine until about a month ago. Then started getting script errors and hangups and bogged down firefox. Tried updating firefox and flash, cleaning computer, vir
-
Can the Apple Store see my Internet history when I go to fix my ipod screen?
I'm going to with my dad to fix my ipod screen but can they see the internet history? I wasn't looking at anything bad, but I accidently clicked it. Can they see my internet history from my ipod on their computer even though I restored it (The IPOD)
-
Problem with the HDMI cable.
Hi folks. I was living in another country where I have had my TV and MacBook Pro Retina there with the Samsung TV via HDMI cable I was watching movies. Everything was perfect. Recently moved to another country, I brought with my of course my MacBook
-
"the firefox application is not allowed to access the graphics hardware"
I would like to ask for help the following phenomenon: "the firefox application is not allowed to access the graphics hardware" This error message appears, at times, and then restart the browser once in a while it's all good.Do not use any accessory.