How to get the values of the fields inside pageFragment
Hi All,
I am working on Jdeveloper 11.1.1.5.
I have a fragment "home.jsff", in that fragment i have two textboxes(txt1,txt2);
Then i have created a bounded taskflow "myTF"and dragged the home.jsff inside it and used as a default activity.
Now finally i have "final.jspx" , in which i have dragged and dropped the bounded taskflow "myTF" as a region.
Scenario : - I have a button on final.jspx , and on click of that button i need to get the value of those two textboxes using bindings which is present in fragment .
On Click of button,I am using this method of pageDef and i am able to get the values :-
jsfUtils.resolveExpression("#{data.abc_homePageDef.txt1.inputValue}");
but somehow it gives me null in some conditions.I don't know why it sometimes gives the value and why it doesn't.
I have seen this video in which Frank has told about the API Mistakes : -
http://download.oracle.com/otn_hosted_doc/classic_api_mistakes_part1/classic_api_mistakes_part1.html
and i did the same mistake but what is the another approach .
If i need to get the current value of txt1, then how can i get it??
What is the best approach to get the values of the pageFragment attributes and how to use it ?
Please suggest!!!
Regards,
Shah
Hi Tulasi,
As i have said that i am trying to get the values on the click of button(*not on page load*) situated on final.jspx page.
On click of button i am using this code to get the values :-
public String getValueTextBox()
Object valueTXT= getBoundAttributeValue("txt1");
logger.info("value is"+ valueTXT); *// It shows the value as null.*
return null;
public Object getBoundAttributeValue( String attributeName) {
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindingContainer = bctx.findBindingContainer("abc_homePageDef");
if (bindingContainer != null) {
ControlBinding ctrlBinding = bindingContainer.getControlBinding(attributeName);
if (ctrlBinding instanceof AttributeBinding) {
return (AttributeBinding)ctrlBinding;
return null;
Please suggest!!!
Regards,
Shah
Similar Messages
-
How to get maximal value from the data/class for show in Map legend
I make WAD report that using Map Web Item.
I devide to four (4) classes for legend (Generate_Breaks).
I want to change default value for the class by javascript and for this,
I need to get maximal value from the class.
How to get maximal value from the data/class.
please give me solution for my problem.
Many Thx
Eddy Utomouse this to get the following End_date
<?following-sibling::../END_DATE?>
Try this
<?for-each:/ROOT/ROW?>
==================
Current StartDate <?START_DATE?>
Current End Date <?END_DATE?>
Next Start Date <?following-sibling::ROW/END_DATE?>
Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
================
<?end for-each?>
o/p
==================
Current StartDate 01-01-1980
Current End Date 01-01-1988
Next Start Date 01-01-1990
Previous End Date
================
==================
Current StartDate 01-01-1988
Current End Date 01-01-1990
Next Start Date 01-01-2005
Previous End Date 01-01-1988
================
==================
Current StartDate 01-01-2000
Current End Date 01-01-2005
Next Start Date
Previous End Date 01 -
UDF: how to get a value in the previous record when lopping over records?
Hello
I have this challenge:
Source message:
<row>
<ID>111</ID>
<Score>200</Score>
<Date>2010-01-01</Date>
</row>
<row>
<ID>111</ID>
<Score>230</Score>
<Date>2010-01-02</Date>
</row>
<row>
<ID>112</ID>
<Score>230</Score>
<Date>2010-01-03</Date>
</row>
etc...
Now the case is, that IF the value of ID of the current record (row) is equal to the value of the ID of the previous record AND the Score value of the current record is bigger than the Score value of the previous record THEN a record in the target message must be created with these values:
Target Message:
<row>
<ID_target> value of source ID </ID_target>
<Score_yesterday> Score value of previous record (day) </Score_yesterday>
<Score_current_date> Score value of current record </Score_current_date>
<Date_current> Date of current record </Date_current>
</row>
I am thinking of using GlobalContainer to store the previous values but am note sure how to maintain these previous values. In addition, I am thinking about using a UDF on the target row record, which will just create the row, if conditions are met (result.addValue("");) and then just make a simple mapping of the ID_target, Score_current_date and Date_current fields and make an other UDF for the Score_yesterday field where I get the Score for the previous record using the GlobalContainer value, that I stored in the other UDF.
BUT:
Should I use "All values of context" or "All values of Queues" in the UDF used on the row record and how do I make sure, that the Score_yesterday global container value is maintained correctly? I am planning of setting it in the UDF used on the Target row record but will it then be in sync with the consuming UDF of the Score_yesterday field?
Java code to go into the UDF would be very much appreciated
Mikaelint tmp1;
int tmp2;
int len = ID.length;
for(int i =0;i< len;i++)
if( i!= len-1)
tmp1 = Integer.parseInt(Score<i>);
tmp2 = Integer.parseInt(Score[i+1]);
if(tmp2 >tmp1)
if (TARGET[0].equals("ROW"))
result.addValue("");
else if (TARGET[0].equals("ID_TARGET"))
result.addValue(ID[0]);
else if (TARGET[0].equals("SCORE_YDAY"))
result.addValue(Score<i>);
else if (TARGET[0].equals("SCORE_CDAY"))
result.addValue(Score[i+1]);
else
result.addValue(DT[i+1]);
I got the following results for the set of data that you provided.
Target-XML
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_TestingTGT xmlns:ns0="http://monsanto.com/CIC">
<Row>
<ID_TARGET>571515198310502207</ID_TARGET>
<SCORE_YDAY>1000</SCORE_YDAY>
<SCORE_CDAY>1010</SCORE_CDAY>
<CURRENT_DATE>2010-03-02 00:00</CURRENT_DATE>
</Row>
<Row>
<ID_TARGET>571515198310502207</ID_TARGET>
<SCORE_YDAY>1000</SCORE_YDAY>
<SCORE_CDAY>1050</SCORE_CDAY>
<CURRENT_DATE>2010-03-04 00:00</CURRENT_DATE>
</Row>
<Row>
<ID_TARGET>571515198310502207</ID_TARGET>
<SCORE_YDAY>1050</SCORE_YDAY>
<SCORE_CDAY>1080</SCORE_CDAY>
<CURRENT_DATE>2010-03-05 00:00</CURRENT_DATE>
</Row>
<Row>
<ID_TARGET>571515198310502108</ID_TARGET>
<SCORE_YDAY>2000</SCORE_YDAY>
<SCORE_CDAY>2040</SCORE_CDAY>
<CURRENT_DATE>2010-03-03 05:00</CURRENT_DATE>
</Row>
<Row>
<ID_TARGET>571515198310502108</ID_TARGET>
<SCORE_YDAY>2000</SCORE_YDAY>
<SCORE_CDAY>2040</SCORE_CDAY>
<CURRENT_DATE>2010-03-05 05:00</CURRENT_DATE>
</Row>
<Row>
<ID_TARGET>571515198310302203</ID_TARGET>
<SCORE_YDAY>3000</SCORE_YDAY>
<SCORE_CDAY>3020</SCORE_CDAY>
<CURRENT_DATE>2010-03-05 00:00</CURRENT_DATE>
</Row>
</ns0:MT_TestingTGT> -
How to get multiple values from the list
I've a list of an item which I queried it from the database. I also created a button that will takes a selected items from the list when it was clicked. I used javabean to get the data from database.
<% // clicked on Select District Button
Vector vselectedDistrict = new Vector();
Vector vdistrictID = new Vector();
String tmpSelectDistrict = "";
tmpSelectDistrict = request.getParameter("bSelectDistrict");
if(tmpSelectDistrict != null)
// get multiple values from the list
String[] selectedDistrict = request.getParameterValues("usrTDistrict");
vselectedDistrict.clear();
vdistrictID.clear();
if((selectedDistrict != null) && (selectedDistrict.length != 0))
for(int i=0;i<selectedDistrict.length;i++)
vselectedDistrict.addElement(selectedDistrict);
vdistrictID = dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
for(int i=0;i<vdistrictID.size();i++)
out.println("district = " + selectedDistrict[i]); out.println("district ID= " + vdistrictID.get(i).toString());
%>
// get vdistrict from the database here......
<select name="usrTDistrict" size="5" multiple>
<% for(int i = 0; i< vdistrict.size(); i++)
%>
<option value="<%=vdistrict.get(i).toString()%>"><%=vdistrict.get(i).toString()%></option>
<%
%>
</select>
<input type="submit" name="bSelectDistrict" value="Select District">
Lets say the item that i selected from the list is 'Xplace' and I clicked on the Select District button,
what I got is this error message:
org.apache.jasper.JasperException: Unable to convert string 'Xplace' to class java.util.Vector for attribute usrTDistrict: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
So where is going wrong and what the message means?. Any help very much appreciated. ThanksThese are just guesses that might hopefully steer you in directions you haven't looked in yet.
I presume you used triangle brackets (< >) to avoid having the Jive Forum think it was the "italics" tag?
Are you certain this: dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
expects a Vector as its second parameter? And returns a Vector?
I don't believe you've shown how you use the javabean, or its code? Perhaps it should be rewritten to accept an array of strings instead of a Vector? -
How to get a value from the previous element (XSLT/XPATH gurus ahoy!)
Hi All,
I am building an RTF template for a "letter of reference"-report. Sometimes there are several rows in the data, that need to be printed as one. This is due to consecutive temporary contracts, which will be printed out as one period of service.
Here's a simplified data example to illustrate the problem.
<ROW>
<START_DATE>01-01-1980</START_DATE>
<END_DATE>01-01-1988</END_DATE>
</ROW>
<ROW>
<START_DATE>01-01-1988</START_DATE>
<END_DATE>01-01-1990</END_DATE>
</ROW>
<ROW>
<START_DATE>01-01-2000</START_DATE>
<END_DATE>01-01-2005</END_DATE>
</ROW>
With the data above, I should print two lines:
01-01-1980 - 01-01-1990
01-01-2000 - 01-01-2005
I need to compare START_DATE of an element (except for the first one) with the END_DATE of the previous element, to find out whether to print the END_DATE for that element or not. How can I get that value from the previous element?
Thanks & Regards, Matildause this to get the following End_date
<?following-sibling::../END_DATE?>
Try this
<?for-each:/ROOT/ROW?>
==================
Current StartDate <?START_DATE?>
Current End Date <?END_DATE?>
Next Start Date <?following-sibling::ROW/END_DATE?>
Previous End Date <?preceding-sibling::ROW[1]/END_DATE?>
================
<?end for-each?>
o/p
==================
Current StartDate 01-01-1980
Current End Date 01-01-1988
Next Start Date 01-01-1990
Previous End Date
================
==================
Current StartDate 01-01-1988
Current End Date 01-01-1990
Next Start Date 01-01-2005
Previous End Date 01-01-1988
================
==================
Current StartDate 01-01-2000
Current End Date 01-01-2005
Next Start Date
Previous End Date 01 -
How to get updated values from the loops while they are running
Hello,
I am having difficulty solving a very basic problem, how to access the updated values from the 'FOR loop' while its running? Basically, the VI I am currently working on calls two sub VIs. Each sub VI has a for loop, and both VIs may or may not run for same number of iterations. My goal is to read the values at each terminal inside the loop of both sub VIs, in the Main VI. I tried to achieve it using Global Variables, but in main VI it displays only the last iteration value from both sub VIs. Could anyone please tell me whrere am I going wrong? Is there any other/better way to achieve this.
I appreciate any input on this issue.
Kudos are (always) welcome for the good post. :-)
Solved!
Go to Solution.Dennis,
In attached VI, I can see the values changing in the sub VI from the main VI with the numeric indicator whose reference is passed on to the sub VI. Now if I wanted to store or use those values how do I do that? I tried to chnge the indicator to control and read from it (in the attached VI) , but the the indicator updates only once. Tried to create a property node and read the Value from it and it didn't work either.
Thanks in Advance!
-Nilesh
Kudos are (always) welcome for the good post. :-)
Attachments:
main-1.vi 8 KB
sub-1.vi 9 KB -
How to get selected-value of dropdown-field in alv ?
Hello experts,
I have a alv-table with dropdown-field.
When I open the dropdown I am able to select another value.
Now I use method ON_CLICK with ON_CELL_ACTION, and when
I change value in my alv, system jumps into this mehtod.
But how do I get now the selected dropdown value in this method ?
I use following code in comp-wdini in order to declare the dropdown:
Dropdownfield
DATA: lr_dp TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
DATA: lr_node TYPE REF TO if_wd_context_node_info.
DATA: lt_valueset TYPE wdr_context_attr_value_list.
DATA: ls_valueset TYPE wdr_context_attr_value.
DATA : lr_nodeinfo TYPE REF TO if_wd_context_node_info.
DATA wa TYPE cdbc_tj30t.
DATA: lr_drdn_by_index TYPE REF TO cl_salv_wd_uie_dropdown_by_idx.
SELECT * FROM cdbc_tj30t INTO wa WHERE stsma = 'CRMOPPOR' AND
spras = 'DE'.
ls_valueset-value = wa-estat. " actual values
ls_valueset-text = wa-txt30. " text displaying on the dropdown
APPEND ls_valueset TO lt_valueset.
ENDSELECT.
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'CONCATSTATUSER'.
CREATE OBJECT lr_drdn_by_index
EXPORTING
selected_key_fieldname = ls_column-id.
lr_drdn_by_index->set_valueset_fieldname( 'VALUESET' ).
lr_drdn_by_index->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
ls_column-r_column->set_cell_editor( lr_drdn_by_index ).
ENDCASE.
ENDLOOP.
In view-ini I fill the table which is bound to my alv-table:
LOOP AT lt_list_opportunities INTO lstru_list_opportunities
WHERE status = ls_opportunity_status-estat AND
valid_to <= ls_input-bdate AND valid_from >= ls_input-vdate.
ls_opportunities-valueset = lt_valueset.
MOVE-CORRESPONDING lstru_list_opportunities TO ls_opportunities.
APPEND ls_opportunities TO ltt_list_opportunities.
ENDLOOP.
lo_nd_opportunities = wd_context->get_child_node( name =
wd_this->wdctx_opportunities ).
lo_nd_opportunities->bind_table( new_items = ltt_list_opportunities ).
HOW can I now get the slected dropdown values in ON_CLICK with ON_CELL_ACTION method ?
Thanks for answers !!
GerdHello Abap,
when I have selected the value in the dropdown-box, then the event should start, and then I should have the
selected values of the dropdown box.
Hope you can help me !
Gerd -
How to get a value from a column inside a table
Hi,
I have got the following problem. I have got a table with some data inside. And a new column, which is not in the dataprovider. Now i search for an opportunity to go through the rows of the table and check the value of this column. I cant do this with the dataprovider or the rowset. My question is now how can i do this? The table object doesnt seem to have a corresponding method.
Thanks in advance for help
Acinonyxthis is some code you can use (based on Winston's and others' tips):
put this in you page bean:
private HashSet selectedRows = new HashSet();
public boolean isSelected() {
TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow");
if (trdp == null) {
return false;
RowKey rowKey = trdp.getTableRow();
if (this.selectedRows.contains(rowKey.getRowId()))
return true;
else
return false;
public void setSelected(boolean b) {
TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow");
RowKey rowKey = trdp.getTableRow();
if (checkbox1.isChecked()) {
this.selectedRows.add(rowKey.getRowId());
Object v = this.t_fotoDataProvider.getValue("fieldName", rowKey);
} else {
this.selectedRows.remove(rowKey.getRowId());
and then bind the "selected" property of the checkbox column to the "selected" property of the page bean.
Now, eveytime the page is submitted, you can do something useful, for example, in the setSelected() method (the row that starts with Object v = ... get's the value of some field corresponding to the checked row)
Mauro -
How to get actionOverride value in the URL in page Flow
Hi All,
I have main page Flow , under main page flow there are 2 sub folders.When i navigate
between the page flow the URL I can see is like http://localhost:7501/myWEB/actportal.portal?_nfpb=true&portlet_2_1_actionOverride=/content/account/getAccount
Can any body tell me how to get the value 'portlet_2_1' that we see in the URL.
What is the API to get this value.
Thanks & Regards,
Hitesh C.u can try in JSP:
DesktopPresentationContext dpCtx = DesktopPresentationContext.getDesktopPresentationContext(request);
BookPresentationContext bpCtx= dpCtx.getBookPresentationContext();
ArrayList al = bpCtx.getPagePresentationContexts();
for(int i=o; i<al.size(); i++) {
PagePresentationContext ppCtx = (PagePresentationContext )al.get(i);
List windowCtxList = ppCtx.getWindowPresentationContexts();
for(int j=0; j<windowCtxList.size(); j++) {
WindowPresentationContext wpCtx = (WindowPresentationContext)windowCtxList.get(j);
wpCtx.getLabel();
"Hitesh" <[email protected]> wrote:
>
Joe,
Thx a lot .
I got the instance ID for the current portlet with API
com.bea.netuix.servlets.controls.portlet.PortletPresentationContext.getPortletPresentationContext(request).getInstanceLabel();
But how to get instance label for other Portlet ? any idea..........
Thanks ,
Hitesh
"Joe" <[email protected]> wrote:
It is a portlet's instance name. You can see it in the .portal screen
as a property.
This is added for portlet scoping. The instance name you might get from
a
backing (did not find it yet) or soeme fancy request attribute eventually.
"Hitesh" <[email protected]> wrote:
Hi All,
I have main page Flow , under main page flow there are 2 sub folders.When
i navigate
between the page flow the URL I can see is like http://localhost:7501/myWEB/actportal.portal?_nfpb=true&portlet_2_1_actionOverride=/content/account/getAccount
Can any body tell me how to get the value 'portlet_2_1' that we see
in the URL.
What is the API to get this value.
Thanks & Regards,
Hitesh C. -
How to get multiple values from the db using select
hi all,
i am using oracle 9i database
i created a procedure
create or replace procedure sample_proce
as
to_i varchar2(50)
begin
select to_id into to_i from sample where flag in('y');
dbms_output.put_line('hai'|| to_i);
end;
when i executed this procedure the following error occurred.
error at line 5 fetching too many rows.
but when i execute the select query alone i can able to view all the rows.
how to resolve iti used the following procedure
create or replace procedure sample_proc
as
begin
for s in(select to_id from sample where flag='y')
loop
dbms_output.put_line(s.to_id);
end loop.
end;
it is executed fine. i can able to fetch all the rows.
how to pass all these values into the another procedure.
we usually pass only one value into another procedure, i do no how to pass all the values . please help me.
Thank u. -
How to Get Parameter Values from the URL ?
Hi,
I have built a calendar called cal_test. I am calling this calendar with this URL:
http://.../pls/.../xyz.cal_test.show?p_arg_names=p_sc_id&p_arg_values=2&p_arg_names=_start_date&p_arg_values=FEB-2002
In the 'Additional PL/SQL Code' tab of cal_test, I need to call a procedure which requires me to pass in as parameters the values of p_sc_id and startdate embedded in the URL named above. How can I retrieve these 2 values from the URL ? Any advice will be appreicated !
DorothyHi Daniel
The following thread might help;
if not, you could try posting the question in Application Server » Web Dynpro Java
Thanks
Kenny -
How to get a value of attribute/field From another Component/bol
Hello
I have to write some code in Component GS_CM/DocList.
From 'GS_CM' I have to get a value of field attribute-STATUS_CURRENT
From BT115QH_SLSQ/Details
Context Node = BTSTATUSH
Attributes = STATUS_CURRENT
In order to check and enable some other functions.
I know how to do it when I'm in the BT115QH_SLSQ/Details
lr_status ?= typed_context->btstatush->collection_wrapper->get_current( ).
lv_statush = lr_status->get_property_as_string( iv_attr_name = 'STATUS_CURRENT' ).
But, in my Componenet GS_CM/DocList the field "BTSTATUSH->COLLECTION_WRAPPER->GET_CURRENT" is unknown. It is not contained in one of the specified tables nor is it defined .
would be very grateful if you could help to solve this issue.
Thanks In Advance
SimaHi Sima,
then another short hint to the WD_USAGE_INITIALIZE.
Go to the component workbench, open the component BT115QH_SLSQ. Go now to the component controller class, go to it's methods. You will see that in the coding of the Method WD_USAGE_INITIALIZE, on the class CL_BT115QH__BSPWDCOMPONEN_IMPL:
WHEN 'CUGSCM' OR 'CUGSCM_DET'.
CALL METHOD iv_usage->bind_context_node
EXPORTING
iv_controller_type = cl_bsp_wd_controller=>co_type_custom
" iv_name = 'ContentManagementCuCo' "Custom Controller Name
iv_name = 'BT115QH_SLSQ/CUGSCMGenCuCo' "Custom Controller Name
iv_target_node_name = 'CMBO' "Name of Node in this Custom Controller
iv_node_2_bind = 'CMBUSOBJ'. "Name of Node in used component GS_CM
CALL METHOD iv_usage->bind_context_node
EXPORTING
iv_controller_type = cl_bsp_wd_controller=>co_type_custom
iv_name = 'BT115QH_SLSQ/CUGSCMGenCuCo'"#EC NOTEXT
iv_target_node_name = 'ATTRIBUTES' "#EC NOTEXT
iv_node_2_bind = 'ATTRIBUTES'. "#EC NOTEXT
Now I checked the context on the component controller and it contains the statusH, the node which you want to use in the component GS_CM. So make sure to prepare the GS_CM component by adding the Status context, and afterwards just add the binding in the code I pointed out above.
Best regards,
Erika -
How to get attribute value from an object inside an object in Xpress
Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
<ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
<ObjectRef type='Resource' name='Google Apps'/>
</ResourceInfo>
I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
<invoke name='getResourceName'>
<ref>myResInfo</ref>
</invoke> -
How to get all values in the range of select option into internal table?
Hi,
I need to capture all entries coming in the range of select option into one internal table.
How to do get that?
For E.g
select-options: matnr for mara-matnr.(select option)
IF I enter G0100013507892 as lower value of matnr and G0100014873947 as higher value
and if there are 10,000 materials in the above range, then I want to capture all theses 10000 materails in one internal table. How to do that?
Regards,
MrunalHello Mrunal Mhaskar ,
What i understand you can do one thing go in debug mode
Try this code : -
LOOP AT s_matnr_ex.
IF s_matnr_ex-low IS NOT INITIAL.
i_matnr-matnr = s_matnr_ex-low.
i_matnr-option = s_matnr_ex-option.
APPEND i_matnr.
CLEAR : i_matnr.
ENDIF.
ENDLOOP.
LOOP AT s_matnr_ex.
IF s_matnr_ex-high IS NOT INITIAL.
i_matnr-matnr = s_matnr_ex-high.
i_matnr-option = s_matnr_ex-option.
APPEND i_matnr.
CLEAR : i_matnr.
ENDIF.
ENDLOOP.
In the i_matnr table high and low values are there.
Regards,
Vandana. -
How to get sysnr value in a Function Module
Hi all,
I need to get the sysnr(system number) value of the R/3 system. I execute a RFC function module and need to get the value of sysnr of the system it executes in as a return parameter. Can somebody tell me how to get this value in the function module and return it.
Thanks and Regards,
PratikHello Pratik
The system number has to be defined in the RFC destination. Thus, select on your local system (where you call the RFC function module) the corresponding RFC destination from table <b>RFCDES</b>. In field RFCDES-RFCOPTIONS you will find a string like this:
H=<ip address>,S=21,R=N, ...
S=system number
Regards
Uwe -
How to get each value from a parameter passed like this '(25,23,35,1)'
Hi
One of the parameter passed to the function is
FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
pi_flag_codes will be passed a value in this way '(25,23,35,1)'
How to get each value from the string
like 25 first time
23 second time
35 third time
1 fourth time
I need to build a select query with each value as shown below:-
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3, code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 25 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3,code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 23 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
(SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
from org_name t2, ref_org_name t3,code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 35 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
group by t2.org_id) q3,
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3, code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 1 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.chris227 wrote:
I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
select
regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
from dual
S1 S2 S3 S4
"25" "23" "35" "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
If t2.att_type is type of number you will do:
t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
I am using oracle 10g.
In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
say 25 is at 1 position.
23 is at 2
35 is at 3
1 is at 4.
the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
Please see the code I wrote for it, But the select query is having error:-
BEGIN
IF(pi_flag_codes IS NOT NULL) THEN
SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
*(SELECT '(25,23,35,1)' V_CNT FROM dual);*
DBMS_OUTPUT.PUT_LINE(V_CNT);
-- V_CNT := 3;
FOR L_CNT IN 0..V_CNT LOOP
if L_CNT=0 then
V_S_POS:=1;
V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
else
V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
end if;
if L_CNT=V_CNT then
V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
else
V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
end if;
VN_ATYPE := ' t2.att_type = ' || V_ID;
rec_count := rec_count +1;
query_no := 'Q' || rec_count;
Pls help me with fetching each value to build the where cond of the select query along with the query number.
Thank You.
Maybe you are looking for
-
I have a problem with IOS 7 I think.When I want to download a app says cause Terms & Conditions have changed and I taped ''OK''. I read it but there is no Agree or accept button! I can't accept it because is not an agree buton.There says if you agree
-
Flip4Mac / Windows Media Player question..
My husband subscribes to a service that allows him to hear audio commentary for his favorite Scottish football team. It requires the latest version of Windows Media Player though. I was thinking that Flip4Mac might be the answer, but when I tested it
-
Apple id password incorrect in phone
Im positive I've put the correct password while signing in store with my phone.. But it tells me "password incorrect".. but on PC it works.. any help?? pls..
-
Why won't my program work??
when i try to run it, all i get is a window that comes up.. i'm trying to make a 9-box pattern on the screen import javax.swing.*; public class Quilt public static void main (String[] args) JFrame frame = new JFrame ("Quilt"); fra
-
How to assign item category group with item category
hi SAP gurus, i want to know how sales item category(e.g. TAN) are assigned to a item category gorup (e.g.NORM). because with Material type we assign item category grp and according to that in sales order it find the suitable item category. Regards,