Repeat Records in query
Hi Friends,
I want to create a query which will return me frameno appears more than ones.
means list of repeat jobs.
for that i have created counter as CKF summetion on jobcardno,
and applied condition as counter>1.
now my report is shows me correct count of frameno which appears more than one but if i put jobcardno in rows it shows me counter=1 and as per condition no records are displayed.
i want jobcardno also in rows. what should i do???????
cols : CKF : Counter
rows : Char : model, Frame No, Jobcard No
in short : i want to find it out repeat jobs for frameno and jobcardno wise, it should not show me non repeated frameno & jobcardno.
Regrds,
Suyash
.
Similar Messages
-
I can't build an xsd for a flat file (txt) to handle repeating records
Hi - have looked at many posts around flat file schema and they don't seem to address my question.
I have a flat file that is \n delimited
the pattern of the data is simple:
record1 - 90 characters
record2 - 20 characters
record3 - n 248 characters - each of these records is parsed into children by the positional method
record n+1 10 characters
record n+2 20 characters
so I used the flat file schema generator to generate the schema and built a map mapping the flat file schema to another xml schema. The schema looks ok - record1, record2, record n+1, record n+2 are child elements of the root. the repeating record
section is showing up as a node with the parsed children.
The transform is only mapping the children of the repeating records. When I test the map only the first repeating record gets parsed. No repeating happens (the actual flat file has 400+ repeating records). When I run the map in debug mode, the input
xml shows that record1 is read in correctly, record2 is read in correctly, record3 is read in and parsed and record4 is treated like record n+1 and record5 is treated like record n+2 and the map thinks it's all finished.
the section of the repeat part of the schema is and you can see that I set the minOccurs=1 and maxOccurs=unbounded for the node (INVOICE) and the complexType but this is not an affective syntax. I have looked at how the EDI X12 schema look and how they handle
looping and it is a lot different than what the Flat File schema wizard is doing. Is there a good set of rules published that would guide me though this? otherwise I will basically have to read in the lines from the file and parse them out with functoids -
seems so inelegant. Thanks in advance.
<xs:element minOccurs="1" maxOccurs="unbounded" name="INVOICE">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="positional" sequence_number="3" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false"
/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:annotation>
<xs:appinfo>
<groupInfo sequence_number="0" xmlns="http://schemas.microsoft.com/BizTalk/2003"
/>
</xs:appinfo>
</xs:annotation>
<xs:element name="SegmentType" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" pos_offset="0" pos_length="2" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>....... more children elements
Harold RosenkransThanks for responding
I gave up trying to parse the repeating record into fields. Instead I just loop through the repeating record section with an <xs:for-each> block in the xsl and use functoids to grab the fields.
So that works for having the two, shorter header records (structure is positional) before the section of repeating records. Now I just have to figure out how to get the schema to handle the two, shorter trailer (or footer, whatever you prefer) records after
the section of repeating records
the error I get in VS when I test the map is [BTW I changed the element names in the schema which is why you don't see INVOICE in the error]
When I declare the last element as being positional with a character length of 10 I get the error:
Error 18 Native Parsing Error: Unexpected end of stream while looking for:
'\r\n'
The current definition being parsed is SAPARData. The stream offset where the error occured is 1359. The line number where the error occured is 9. The column where the error occured is 0.
so the first record is 77 char in length and the second is 16 char and then the repeating records (5 in the file) are 248 char and the last record is 10 char
so an offset of 1359 puts it beyond the last record by 16 characters - so the stream reader is looking for the next repeating record.
if I try to declare the last element as delimited I get the error:
Error 14 Native Parsing Error: Unexpected data found while looking for:
'\r\n'
The current definition being parsed is SAPARData. The stream offset where the error occured is 597. The line number where the error occured is 5. The column where the error occured is 0.
so the first record is 77 char in length and the second is 16 char and then the repeating records are 248 char.
a stream offset of 597 puts me 8 characters into the third repeating record - at this point I have only declared one trailer record in the schema, 10 characters long.
Why is stream reader stopping at such a weird spot?
The bottom line is I still haven't discovered the correct schema to handle the trailer records. even if I set the maxOccurs="4" (for the repeat record declaration) it still gets the first error. How does it find an unexpected end of stream looking
for \r\n when the maxOccurs for the repeat record declaration should have the stream pointer in the 5th repeat record.
I unfortunately don't have any options concerning the file structure.
I have read a lot of posts concerning the trailer issue. I have seen a couple that looked interesting. I guess I'll just have to give them a try. The other option is to create a custom pipeline that will only take file lines of 248 characters.
That's just disgusting !
Harold Rosenkrans -
Mapping with repeating records
Hello,
I have once schema which has two child records out of that second child has many child fields with repeating records, but when I mapped it further I am getting that second schema only once even it has multiple.
Help me please ASAP
Thanks in advanceNilesh,
You have two options:
Option1:
Just ensure in schemas, in second child records, set the repeating child record's (repeating record under second child record) "Max Occurs" property is set to
* (or unbounded). Ensure that this property (Max Occurs =
*) is set for repeating records in both source and destination schemas. By this way, particular child record will repeat. This way gives more control on which child record you want to
set as repeatable.
Options2:
Just set the second child record (which has the repeating records under it) "Group Max Occurs" property to
* (or unbounded). By this way, all the child records of this second child, will be set to repeating record.
Also ensure that the repeating records (not just the child elements, but also the repeating records) are mapped from source to destination.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
I have SSRS parametarized report in that one data set have repeated values with query parameter . but while am mapping that query
parameter to report parameter i need to pass distinct values. How can i resolve thisHi nancharaiah,
If I understand correctly, you want to pass distinct values to report parameter. In Reporting Service, there are only three methods for parameter's Available Values:
None
Specify values
Get values from a query
If we utilize the third option that get values from a dataset query, then the all available values are from the returns of the dataset. So if we want to pass distinct values from a dataset, we need to make the dataset returns distinct values. The following
sample is for your reference:
Select distinct field_name from table_name
If you have any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
How to highlight the repeated records in a BO crystal report?
Hi ,
How to highlight the repeated records in a BO crystal report?
we want to highlight the rows for which account number is same.
thanks
sriramYou don't even need to create a group. Just sort the records on the fields that define "duplicate". Then you can just use
if {field} = PreviousValue({field}) then crYellow else crNoColor
in the format's Background Color formula. This will cause the background to be yellow on duplicates. (If you need to check more than one field in order to determine duplicates, just insert
and {field2} = PreviousValue({field2}
and so on for each field that needs to be checked.
HTH,
Carl -
Get the latest date record in Query
Hi, Expert:
Please help on this:
The requirement is to get the the latest date record in Query. For example:
Data in provider:
Plant date amount
A01 2007/04/08 30
A01 2007/06/09 70
A01 2007/12/08 30
we only want the query display:
A01 2007/12/08 30
I have tried exception aggregation, but it does not work. Any ideas are highly appreciated.Or you can model the date as a key figure after 0date_kyf and set aggregation to max, you'll get something like
select plant, amount, max(date) from ... group by plant, amount
used it for inventory reporting (materials and their last movement date, days from the last movement etc.) and worked well. -
Lock record on query for single user
Is there any way to use the on-lock trigger to lock a particular record as it is simply queried, instead of after a change has been made to it. For instance, if user A is viewing a queried record, and user b attempts to query the same record, then we would display a message to user b stating that the record is unavailable, or simply just skip it. I know that if a field in the current record is altered, forms recognizes the status of the record as 'CHANGED' and will then by default proceed to lock the record until a commit or rollback is issued. However, this is not what we are looking for. I have read a little about this, and I have seen an example through a datablock based upon a stored procedure, a ref cursor select for update statement. (NOTE: we are not basing our datablock on a stored procedure though)
We have two scenarios that require this type of locking capability. The first simply queries one distinct record, and the second queries a distinct result of records.
A select for update statement would suffice for the first scenario, i.e. if another user tries to query the same record, their query is denied; however, for the second scenario when two users perform the same query, user a is viewing record #1, and user b's program sees that record #1 is 'locked' and thus proceeds to the next record in the result .
Any suggestions? Thanks in advance.
Eric M WeissYou don't need to override on-lock you can just call the LOCK_RECORD built-in in POST-QUERY or whatever.
-
Just wondering if we need to check :system.mode = query or normal in the query for record groups or oracle forms handles it automatically
ThanksNo, you should not check System.Mode in a record group query. But then, Forms does not do that either.
Your question makes me wonder what you are doing... Record groups are usually populated only when you need to see a list of values, or use an LOV to perform an edit. -
List item - Record Group Query - Alignment improper Order
Dear All,
When am trying to concatenate two columns using record group query and displaying in the list item, the alignment is not in proper order.
E.g; Below is the columns and data's used in process:
CODE_VALUE SHORT_DESC DESCRIPTION
ROLL1 Customer - Non accidental Production, booking with other carrier, bad projection.
ROLL2 Customer - Accidental L/C, B/L draft, Customs, Samples, AMS, LAR.
ROLL3 ABC - Lack of empty Lack of empty units.
ROLL4 ABC CDE - Roll over AGR RRR decision.
ROLL5 ABC XXX - Accidental IMO or OOG refused, operational problems, Cut & Run.
ROLL6 ABC YYY - Fictive booking Equipment buffer, dummy booking.
Below is the record group query used in forms:
PROCEDURE p_when_new_form_instance
IS
GROUP_ID recordgroup;
list_id item := FIND_ITEM ('BLK_CONTROL.LI_ROLL_REASON');
rg_name VARCHAR2 (20) := 'LI_ROLL_REASONS';
status NUMBER;
l_query VARCHAR2 (4000);
BEGIN
l_query :=
'SELECT rpad(short_desc,50,'' '')||'' | ''||description description, code_value code_value FROM codes WHERE code_value IN (''ROLL1'', ''ROLL2'', ''ROLL3'',''ROLL4'',''ROLL5'',''ROLL6'')';
GROUP_ID := CREATE_GROUP_FROM_QUERY (rg_name, l_query);
status := POPULATE_GROUP (GROUP_ID);
POPULATE_LIST (list_id, GROUP_ID);
EXCEPTION
WHEN OTHERS
THEN
pl_common.when_others;
END;
Moreover i have my list item font property by default as ""MS SANS SERIF" and when i run in Forms Builder am getting the alignment as below.
Result:
====
DESCRIPTION CODE_VALUE
Customer - Non accidental | Production, booking with other carrier, bad projection. ROLL1
Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR. ROLL2
ABC - Lack of empty | Lack of empty units. ROLL3
ABC CDE - Roll over | AGR RRR decision. ROLL4
ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run. ROLL5
ABC YYY - Fictive booking | Equipment buffer, dummy booking. ROLL6
Above order is not the expected result as all the |(pipe) symbol should display in proper order as below.
Expected Result:
==========
DESCRIPTION CODE_VALUE
Customer - Non accidental | Production, booking with other carrier, bad projection. ROLL1
Customer - Accidental | L/C, B/L draft, Customs, Samples, AMS, LAR. ROLL2
ABC - Lack of empty | Lack of empty units. ROLL3
ABC CDE - Roll over | AGR RRR decision. ROLL4
ABC XXX - Accidental | IMO or OOG refused, operational problems, Cut & Run. ROLL5
ABC YYY - Fictive booking | Equipment buffer, dummy booking. ROLL6
I tried with RPAD and LPAD still the alignment issue is there; i know the issue is because of invariable length of the font.
But is there any solution to override this it will be of great help.
So please help!!!!!!!!!!!!!!!!!
Thanks..................
Regards,
Sunil.GHi Francois,
Thanks for your reply. I have tried changing the font to "Courier(Western)" it is working fine.
But as per the standards defined, it should be "Ms Sans Serif" nothing apart from that.So that is where the problem lies. :(
Regards,
Sunil.G -
ORA-00904 when use column alias in Record Group Query
Is it possible to use column aliases in Record Group Queries?
I have a query that runs fine in SQL*Developer, but gives me runtime errors when I use it as a Record Group Query.
When I use it as a Record Group Query, the Form compiles, but at runtime I receive the following errors:
FRM-40502: ORACLE error: unable to read list of values
when I use Help - Display Error, I see:
ORA-00904:"CHILDNAME":invalid identifier
The query is something like this
select decode(complex stuff here) as "childname" ....
I've tried it with and without the double quotes surrounding the alias name, and have also tried it without using the "as" keyword.
I would appreciate any suggestions or insights. I'm using Forms 9.0.4.
Thanks.It looks like this is caused by bug 725059:
"FILTER BEFORE DISPLAY" DOESN'T WORK IF LOV HAS COLUMN ALIASES (TRIAGE1098)
My LOV does have the Filter Before Display turned on. Here's the text of the bug:
IF an LOV is created with column aliases in the select statement, (eg: select ename emp_name from emp) and the LOV property "Filter Before Display" is "Yes", THEN when you attempt to filter the LOV at runtime, (eg: type '%' then press the 'Find' button) the internal WHERE clause that forms sends to the database is: WHERE column_alias LIKE '%%' This is incorrect syntax. A client-side sqlnet trace shows this. The correct syntax should be: WHERE column LIKE '%%' . The incorrect syntax results in no rows returned. However no error is displayed by forms to the user. -
Single record in query are splitted inot two record after creating the view
HI ,
We have created one query and when we execute with characteristics combinations we get some record.
we have created the view on the same query and when we execute the view ,the same record is splitted into 2 lines with some of the key figures are showing in one line and remainig are in other line.
please suggest here.Look at your source data. Keep in mind that your queries are just that.. queries. The number of rows of results is not a reflection of the number of database records you have in your infoprovide. It is what your query asked the infoprovider to give you.
For example:
You have two records. Both records have the same 'customer'. One record has document number "A", the other has document number "B". Record "A" has key figures Sales and Profit, Record "B" has key figures Quantity and Margin.
Query 1 asks for Customer, Sales, and Margin. It will return both records A and B as one row of data, with the Sales data from record A, and the Margin data from record B
Query 2 asks for Customer, Document number, Sales, and Margin. It will return two rows of data... the first showing record A and Sales but no margin, the second showing record B and Margin but no sales. -
Record Group Query - item block
I need to calculate a Record Group Query using a block item value, but when a use the query below the query didn't return rows:
SELECT OID_SIIB_FINALIDADE_TED
, F.COD_FINALIDADE || ' - ' || F.DES_FINALIDADE DES_FINALIDADE
FROM SIIB_FINALIDADE_TED F
, ( SELECT P.TP_PARAMETRO
FROM SIIB_PARAMETROS_GERAIS P
WHERE P.NM_PARAMETRO = 'TIPO_' || :BLOCK.ITEMX ) PAR -- using the :BLOCK.ITEMX the query did'nt return data
WHERE PAR.TP_PARAMETRO = F.TPO_FINALIDADEBut if a use a static query the Record Group( changing :BLOCK.ITEMX for 'STR0005' ) return the desired values.
This Record Group is used to pupulate a LOV.
Edited by: user5914526 on Feb 15, 2012 9:26 AM
Edited by: user5914526 on Feb 15, 2012 9:26 AM
Edited by: user5914526 on Feb 15, 2012 9:29 AMNo, it doesn't .
And return the message: "There aren't data in the List of Values"
And the block item is not empty or null.
Edited by: user5914526 on Feb 15, 2012 10:13 AM -
Changing the record group query in seeded forms
Hi all,
I need to change the record group query in one seeded form.
Can it be done through custom pll or what is the correct approach to do that..
Thanks,
Devangyou want to do that at runtime?
-
Using record filter query to handle behavior of facets
Hi all,
I know for multiselect/single dimensions we should always perform a dimension query to populate the behaviour of our faceted navigation , but i still want to understand if instead of dimension query i perform a record filter query on my facets click then what all flexibility will i loose with the multi select/single select facets.
Regards,
Edited by: IKumar on Apr 7, 2012 11:48 AMHi.
In general record filters and navigation provide similar functionality (faceted search). Depending on your requirements, you can use one or the other or even a combination. There are two things related to records filters that you need to be aware of when considering their use in a scenario like yours.
1. Record filters are applied as the very first step in the query evaluation. They are used to define a sub-set of the indexed data for further query evaluation. This can have an effect on spell corrections and DYM suggestions. Since the MDEX calculates spell corrections and DYM suggestions from the actual data and not based on an external dictionary, you may find that these are more "strict" when using record filters since a smaller data set is used for their evaluation. That said, I have not yet seen this become an issue in real projects for the last 8 years.
2. Record filters do not give you breadcrumb information. Incorporating the record filter as a breadcrumb will require some custom coding (custom = can't copy-paste from the reference app) and could become a bit complicated.
Regards
Pavlos -
Suppressing repeated records in the query
Hello Gurus,
I have a Doctor#1 treating Patient#1 in 3 different cases and in the report I just need to see 1 instead of 3 as it is the same patient#1 to the same doctor#1. What are the ways I can manipulate this data without writing any program.
Report shows as follows: records
doctor 1 disease 1 patient 1 1
disease 2 patient 1 1
disease 3 patient 1 1
total 3
Any help i.e can I write conditions? Selections? or any idea would be greatly appreciated.
Thanks,
PriyaHello Diwa,
I did select (hide the repeated key values) in the query properties and also hid the diseases column but still it shows as below.
Doctor Patient Number of Records
00000403880040 A05088000490040 1
1
Total 2
Thanks,
Priya
Maybe you are looking for
-
How to install HTTP Server in a Linux Machine for running APEX
I've Installed Unbreakable Linux 4.7 and I'm using the standard apache which comes (Apache 2), I want to install the HTTP Server in order to run APEX on this machine, and may it look the data from the database which is oracle 10g (The database is on
-
Does anyone can summarize how many Microphone Iphone 4 has? How each of them are used? From what I got from Apple tech support, there are two Mic, one on top and one on bottom: Top one mainly for nosie canclellation. Bottom one used for speak, record
-
Dera gurus While editing the bank details in ESS by employee, system showing an error message showing that Data record <personnel number> 9999123120050701000 has grouping value "" instead of "40" What is this error and how to solve it Thanks in
-
Can someone explain me well when the infopackage use batch or dialog?
Hi Gurus, can someone explain me well when the infopackage use batch or dialog?
-
[solved]boot with a messy GUI
Hi everyone, After some work I installed my first Arch in my netbook (Lenovo S10). It worked well without GUI. And then I installed X, xfce and login manager slim, modify /etc/inittab and reboot. It did start with a GUI, but the pixels were so messed