Search record based on xmlfield values
Hi,
I have a oracle table with a XMLfield which is having a lot of elements inside.
Now i wanted to fetch a record which is having the element value as "XYZ".
Note: I dont know the element name.
How to get this through SQL Query?.
Thanks.
Ravi
OK, this should do it :
SQL> create table sample_table (
2 id number,
3 doc xmltype
4 );
Table created
SQL> insert into sample_table values(1,
2 xmltype('<student><name>Mohan</name><name>Doss</name><name>ravi</name></student>')
3 );
1 row inserted
SQL> insert into sample_table values(2,
2 xmltype('<root><child1>ABC</child1><child2>XYZ</child2></root>')
3 );
1 row inserted
SQL> select t.id,
2 extract(t.doc,'//*[.="ravi"]').getclobval() as content
3 from sample_table t
4 where existsnode(t.doc, '//*[.="ravi"]') = 1
5 ;
ID CONTENT
1 <name>ravi</name>
SQL> select t.id,
2 extract(t.doc,'//*[.="XYZ"]').getclobval() as content
3 from sample_table t
4 where existsnode(t.doc, '//*[.="XYZ"]') = 1
5 ;
ID CONTENT
2 <child2>XYZ</child2>
Similar Messages
-
Creation of a new record based on the value of a picklist
Hi,
My requirement is whenever i select a picklist value in Opportunity record type based on the value selected a new opprtunity record should get created and get assigned to a role or A User otherwise a lead should get created and should be assigned to a Role or A User.
Can I achieve this in OnDemand?
Kindly help. This is urgent..
Thanks in Advance.Can I achieve this in OnDemand?I think you can better try one of the Oracle CRM On Demand forums @ http://forums.oracle.com/forums/category.jspa?categoryID=162
instead of the Oracle SQL and PL/SQL forum.
This is urgent..The forums are relying on volunteers and it is weekend for most of us now.
If it is really that urgent, call Oracle Support. -
Output Condition Records based on Document Value
I have a need to send/not send different pieces of output based off of Quote value.
Example: if a quotation is over $100 send a copy of the quotation to the field sales rep automatically. And simultaneously if the quotation is under $4000 automatically send a copy of the quotation to the customer.
I have different output types and we are sending all quotes to sales reps and customers but not sure how to set up the VV11 records to recognize the value of the quotation.
We tried to set a threshold table (very custom) and it allows us to set a threshold but I can only contol the output to be over $100 or under $4000. It will not accomodate both at the same time.
We are running SAP 4.7Come to think of it, the best way to accomplish this is to configure 2 identical output types and apply the requirement routine to each of them. In the routine check the quantity and, accordingly, either propose output or not. For example, create output types Z1 and Z2. The requirement routine for Z1 would look like this:
IF KOMKBV1-NETWR > 100.
SY-SUBRC = 0.
ELSE.
SY-SUBRC = 4.
ENDIF.
For Z2 the routine would be the same but the condition would be '< 4000'. If the amount is 50$ then only Z2 would be proposed (since Z1 has a condition 'over 100$'). If the amount is 150$ then both Z1 and Z2 output would be proposed since 100 < 150 < 4000. For the amount $4001 only Z1 would be proposed.
Please note though if a user adds the output manually then requirements are not checked (there will be a warning message, but no one ever pays attention), so you might want to disallow manual output creation for these types, depending on the business requirements.
Hope this will resolve the issue.
Edited by: Jelena Perfiljeva on Jul 7, 2008 3:45 PM -
Selecting Records based on multiple values in one field
Excuse the basic request.
I want to select all records from one table depending on the value in 2 specific fields. Each of these fields has a single value in it.
What I have written is as below
1.select nm_idno "EZAID", nm_fname, nm_lname, nm_et_tt "Position", nm_mt_mt "Status", nm_type, nm_wemal, nm_mailshot from MNME
2.where nm_type = 'M' and where nm_mailshot = 'Y' and nm_wemal > ' '
3.and where nm_mt_mt = (1 or 6 or 3 or 10) *** these are the bits that I don't understand why they will not work.
4. and where nm_et_tt = (408 or 329 or 283)
Basically every record should have one of the values I have highlighted in it.
Any help greatly appreciated.select nm_idno "EZAID"
,nm_fname
,nm_lname
,nm_et_tt "Position"
,nm_mt_mt "Status"
,nm_type
,nm_wemal
,nm_mailshot
from MNME
where nm_type = 'M'
and nm_mailshot = 'Y'
and nm_wemal > ' ' --< not sure what you mean here
and nm_mt_mt IN (1, 6, 3, 10)
and nm_et_tt IN (408, 329, 283)
; -
Show new page table record based on parameter value in first page in ADF
I have to show a selected record on a new page whose input query value is in first page. For example I choose to edit an order id by selecting order id and then pressing Edit Record button then in new page selected order record should show. I am working in ADF JSF pages. I can pass parameter from one page to another by pageFlowScope. but how to display selected record on next page.
any one to help. I want to use an input parameter on first page to edit the table on new page
-
Fetch records from Database based on Input value
Hi Experts,
In my mobile application, I have designed one input field with F4 help or input assist. I need to fetch records from database based on that input and need to display records in table.
My question is:
How to fetch the records from database/back end based on the input value and display them as table format as we are doing in SAP ABAP?
Here, I need to fetch the records based on input value available in the UI screen and pass that value to gateway, fetch the records from database and need to bind with table in SAPUI5.
Kindly share the whole process flow with sample code for this requirement. Hope I have explained the requirement in detail.
Thanks In Advance..
Regards,
Arindam Samanta.Hi,
Try something like this.
In this, I am passing From date, To date, RelGrp, RelStr, Uname as input. Then I am storing those values in variables and passing this data in Odata request.
OData.read({ requestUri: "http://xxxx:8000/sap/opu/odata/sap/Z188_PO_SRV/pos?$filter=Docdate le datetime'"
+ todateformat+"T00:00:00' and Docdate ge datetime'"
+ fromdateformat+"T00:00:00' and RelGrp eq '"
+ relcode +"'and RelStr eq '"
+ relstg +"'and Uname eq '"
+ username+ "' "},
function (data) {
console.log(data);
When we are giving correct inputs it will goes to Success function and get the data from back end.
In console we can see the data.
Hope this will helps to you.
Thanks&Regards
Sridevi -
Can a subreport select records based on values in the main report record?
Post Author: calvin
CA Forum: General
Perhaps my understanding of a subreport is incorrect as this is the first time I've used one, but it seems to me that the subreport should be able to use the values from the main report record in its (the subreport's) operations-but my subreport doesn't seem to be working that way.In my main report, I select a set of records from a 'request' table. I have a subreport in the detail section so the subreport is processed for each of the request records. That works, but I'm simply getting the same data reported multiple times. It's as if the subreport only uses the last request record rather than the current one. Stating it this way I can see that the problem might be evaluation time-it's processing the request records first, then processing the subreport, and only then printing everything. If this is correct then putting WhilePrintingRecords on the subreport should work-but the only way I know of to do that is in a formula. Can I call the subreport from a formula? Or am I totally off-track?Thanks.Post Author: foghat
CA Forum: General
Have you established a link(s) between your main report and subreport?When viewing the main report, click edit --> subreport links and link the 2 based on whatever values from the main report you want. -
When user clicks on the link ,it will display some record based on value
Hi
i want to create such a query/request in the Dashbord,when user click on it, it will open the other request in the same place based on the value it clicks.
More detail idea about the question:
for ex. i have created one query, which gives the following output.
current_loan_amount Current_status
now when user click the current_loan_amout ..........the detail page will be displayed.
wchich will give the dettail about the Current_loan_amount.....like to whom the loan has been given,region,address,broker name etc..
So if anybody knows anything about this.
Guide meYes you can create a navigate report where it displays the details for the amount user selected.
You can enable navigation on the metric(column format-interation-navigate) and give the path of the other qyery.
You just need to pass all the values that you need using "Is prompted" Filters.
Hope it helps
Prash -
Searching Records Following the Creation of a Lookup Table
Hello,
Please excuse my ignorance but I have just created a lookup table by using the wizard in SQL Workshop. All is well text has been replaced by numbers. My issue is that when I do a search now using a drop down list based on a query it returns records based on other numbers as well. That is if '2' relates to an item the search picks up anything containing a 2: 2,21,22, etc. How can I get the query to return a value for the number selected and not anything containing that number?
and (
instr(upper("MODEL_ID"),upper(nvl(:P40_REPORT_SEARCH,"MODEL_ID"))) > 0
Kind Regards,
Swelch
Edited by: Steve Welch on Mar 9, 2012 12:03 PMHere are two potential solutions
and (instr(upper('~'||"MODEL_ID"||'~'),upper(nvl('~'||:P40_REPORT_SEARCH||'~',"MODEL_ID"))) > 0)or
AND model_id = NVL(:P40_REPORT_SEARCH, model_id)The first is often used for components such as shuttles. I think I've added the special characters in the right place - not tested/verified against my previous example
The second may be more appropriate to your scenario, depending on your data.
Scott -
Is there an easy way to filter a 2-d array based on the values of two of the fields?
Is there an easy way to filter a 2-d array based on the values of one of the fields. In my attached VI the output array has the following format:
TimeStamp Ident Frame Type Bytes Data
10:57:07.621 3AD00016 CAN Data Frame 8 0000000000000000
10:57:07.622 3AD00017 CAN Data Frame 8 000005E000000000
10:57:07.624 3AD00018 CAN Data Frame 8 0000000003300000
10:57:07.625 2DC00000 CAN Data Frame 8 0000000000000000
10:57:07.626 3AD00019 CAN Data Frame 4 0000030000000000
I would like to delete any rows that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the above data the fourth row would be deleted. The only way I can see to do it is to form a 1-d array. Is there a better approach?
Thank you.
Solved!
Go to Solution.
Attachments:
CMM_SN_MULTI.vi 20 KBHi chuck72352,
after you have sorted your data, you can use the InRange Function. Combined with a "search 1D Array" you'll get the range you really want.
Mike
Attachments:
ArraySubset.PNG 25 KB -
Update a table based on Min value of a column of a Another Table.Pls Help.
Dear All,
Wishes,
Actually I need update statement some thing like below scenario...
Data in table is like below:
I wrote a query to fetch data like below ( actually scenario is each control number can have single or multiple PO under it ) (i used rank by to find parent to tree like show of data)
Table: T20
Control_no P_no Col3
19950021 726473 00
19950036 731016 00
19950072 731990 00
731990 01
19950353 734732 00
734732 01
19950406 736189 00
736588 01
736588 02
736588 03
Table : T30
Control_no P_no col3
19950021 726473
19950036 731016
19950072 731990
731990
19950353 734732
734732
19950406 736189
736588
736588
736588
Now requirement is I need to update Table T30's col3 (which do have values in T20 but not this table) in such a way that , It should take MIN (COL3) from T20 and then update that value to related Col3)
Better I can explain through below new data format in T30 after update:
After update it should like:
Table : T30
Control_no P_no col3 (this is updated column)
19950021 726473 00 -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
19950036 731016 00 -- as this is min value for Pno 726473 belongs to Control NO 199950021 in Table T20 above
19950072 731990 00 -- see here..both Pno should updated as '00' as MIN value col3 in Table T20 related to this
731990 00 record is '00' (out of 00,01 it should select 00 and update that value here)
19950353 734732 00 -- same again both Pno should updated as '00' as MIN value col3 in TableT20 related to this
734732 00 record is '00' (out of 00,01 it should select 00 and update that value here)
19950406 736189 00 -- As there is single col3 value in T20, 00 should be updated here.
736588 01 -- Here it should update col3 as '01' since for this pno(736588)
736588 01 -- Here too it should update col3 as 01 per requirement ,minimum value of this pno in T20
736588 01 -- same here too.. Sorry if my post formatting is not good...
Hope i am clear in my requirement..(update T30 col3 based on min value of col3 of related records)
Please suggest some update sql for this...(ideas would be great)
I am using oracle 10 g version soon will be migrated to 11g..
Regards
Prasanth
Edited by: Onenessboy on Oct 20, 2010 12:13 PM
Edited by: Onenessboy on Oct 20, 2010 12:15 PMOnenessboy wrote:
I am really sorry, my post so nonsense in look..
I used to use for actuall code..
the out put i tryped, i used [pre] , [/pre] but still does not look good..
hmm..thanks for your suggestion hoek..
so any ideas about my requirement...I would suggest spending a bit more time trying hoek's suggestion regarding {noformat}{noformat} tags instead of repeatedly asking for more help.
Because to understand your requirement, people are going to have to read it first. -
Need to supress main report based on shared value comes from subreport
Hi,
I have a database that is used in both main report and subreport. On main report I have column a,b ,c, d,e,f to display in detail section, the subreport (column c, g,h etc) is also displayed on detail section, the link between main report and subreport is column a,b and a formula based on the value of c. So the link is within one database, some records link with other records and display both matching records on one line(especially column c shows one value in main report and another value in subreport). That's why I need subreport and I can display the report correctly.
Here is my question: if one record in main report couldn't find a match in subreport (subreport is blank), then I would like to show this record; if one record in main report does find a match in subreport, I don't want it to show(need to be supressed). I can define a shared variable to flag whether the subreport is blank or not, but this shared variable has to be placed under the section of subreport in main report and I don't know how to supress the upper detail section with subreport in it.
Any help would be appreciated!
HelenHi
In this case you need to insert the same sub report twise.
Example :
Detail a--Insert the sub report and go in sub report suppress all sections and using shared variables bring the value to main report.
Detail b -- based on detail a sub report suppress the main report records
Detail c-- Your actual sub report will display the values.
Note : use the same links for your detail 'a' sub report which you are using for detail 'c' sub report.
Thanks,
Sastry -
Count the number of rows based on the values!!!
Hi all,
What I am using:
I am working with a multidimensional database in Visual Studio 2010 using its Data source view and calculation member and dimension usage.
What I want to do:
I have a fact table that has five columns(leg(s),hand(s), Head and body,overall) that shows the category of how severe the injury is. Let say for the records all columns never have an empty value(no injury is stated with 'No injury' ) . These five columns
are connected with a dimension that has all the available values (Category A-E of injury).The overall has the most severe from the other four columns. I want to create a bar chart with five different measure
values, one for each column, and count the values in those columns.
For example : I have a slicer in the excel and a bar chart and the slicer has all the values of the Category of the injury ( Cat a,Cat B, Cat C, ... Cat E, No injury ) and when i select one of them, lets say
Cat C, the bar chart should update and show how many Cat C each measurement column has.
Example FACT table:
ID LEG HAND HEAD BODY OVERALL
1 No A No No A
2 No D C C C
3 E C D A A
4 E E B C B
So if i selected C the bar chart will count (Leg = 0, Hand = 1, Head = 1, body = 2 and Overall = 1).
Any ideas ?
Thanks for the help and the time :)Hi DBtheoN,
According to your description, you want to create a chart on excel worksheet to count the rows based on the value, right? If in this case, I am afraid this issue is related to Office forum, I am not the expert of Office, you can post the issue on the corresponding
forum.
However, this requirement can be done easily on SQL Server Reporting Services. You can using the expression below to count the rows.
=COUNT(IIF(Fields!LEG.Value=Parameters!TYPE.Value,1,NOTHING))
Regards,
Charlie Liao
TechNet Community Support -
Conditional formatting of a cell based on a value in another cell
I want to change the color of the text in a cell based on the value in a different cell. How can I accomplish this?
drmjdoyle,
There Numbers User Guide, http://support.apple.com/en_US/manuals/#iwork, will show you how to do that. Also, doing a search in these forums will provide many hits answering your question.
Click in the cell you want the color to change: click Format > Create custom cell format, in the first dropdown in that dialog box click Choose Rule, then follow the prompts.
Cordially,
RicD -
Line item pricing based on total value of the order
Hi,
We need to charge as a separate line item (material) 'Insurance' as a % based on the total value of the order less one line item. Our orders are created on the web and posted via a BAPI.
(a) depending on where the customer is located, we charge a certain added shipping cost.
(b) the customer has the choice to ask for insurance or not.
The actual order may be 10 lines totaling $1,000 and due to location, the BAPI slaps on an added line item of $100. If the customer chose the insurance option, the BAPI needs to slap on another line item whose value would be, say 2% of the total order, i.e. 2% of 1000 (instead of on 1000+100). Of course, if the customer doesn't choose this option he is not charges this extra line and further if the customer is not in the particular region, the 100 charge may also not be there.
The 2% can vary time to time so needs to be driven by a condition record based on %.
How can we achieve this in the pricing procedure? The logic of how the BAPI will function is clear to us, we are stuck on the pricing procedure configuration.
Glad to answer any further questions you may need for clarifications.
Many thanks!Ideally insurance would be levied on end customer based on Inco Terms like CIF, DDU etc.,
So you can have an access sequence for which you can make use of tables like 033 & 034 in V/07. In VK11, for this combination, maintain the required insurance percent.
In condition type V/06, for this condition type, maintain "C" for Manual entries, since you have indicated that customer has the choice. Otherwise, this can be populated automatically in sale order.
Similarly, for shipment cost also, you can have the Inco2 as one of the combination so that based on region, this condition type will be populated in sale order. If you have shipment cost configured, then this can be achieved.
In your pricing procedure, you have to assign the shipment cost condition type next to insurance and assign the From-To step accordingly.
thanks
G. Lakshmipathi
Maybe you are looking for
-
Hi All, I want to know the ways to copy data in a maintainable table from one system to other system ( in different landscape). Kindly pass on your inputs. Thanks. Regards, Arun.
-
hi i have problem with Catt . some data is like this >NS . When i put it in the catt file, this data is ignored and i have blank on it. Do you know a solution for that ? thanks
-
[SOLVED] Cannot run executable
Using ls I can see the files contained within a directory: $ ls picaxe08 I have execute permissions, but when I try to execute it: $ ./picaxe08 bash: ./picaxe08: No such file or directory Using strings picaxe08, I can see "/lib/ld-linux.so.2" hardcod
-
I can't seem to open itunes - nothing happens when I click on the icon. It was successfully downloaded and installed, and quicktime works, but not itunes. Whenever I shut down the computer, there is an error message saying that itunes has encountered
-
Hi SAP PP Gurus Can any body know about picking for production order using T-Code CO27 and its related setting in customizations because i use it and i get error message "No data exists for chosen selection" . Regards, Rajesh.