Reg: Retrieve the value by default-
Hi Experts,Need help with writing a query.
Table "Tab_2" a column 'c3' which checks its value from the values in the column "c1" "tab_1" and therefore from value of the column "c2".
But if a value of c3 is not present in the column tab_1 "c1", "c2" value "DX" should by default.
Please find below the scripts Create & Insert:
create table tab_1(
c1 varchar2(200Char),
c2 varchar2(200Char)
);
create table tab_2(
c3 varchar2(200Char),
c4 varchar2(200Char)
);
insert into tab_1 values('104,113,146,165','1x');
insert into tab_1 values('204,213,246,265','2x');
insert into tab_1 values('304,313,346,365','3x');
insert into tab_1 values('default','dx');
commit;
insert into tab_2 values('146',null);
insert into tab_2 values('265',null);
insert into tab_2 values('333',null);
commit;
Here's the query where I'm stuck:SQL> with x1 as
2 (
3 select
4 REGEXP_SUBSTR(c1,'[^,]+',1,level) id1,
5 c2
6 from tab_1
7 connect by level <= length(translate(c1,'~0123456789','~'))+1
8 and prior c1 = c1
9 and prior sys_guid() is not null
10 and c1 != 'default'
11 )
12 select
13 id1, c2, c3
14 from x1 RIGHT OUTER JOIN tab_2
15 on (x1.id1 = tab_2.c3);
ID1 C2 C3
---------- ---------- ----------
146 1x 146
265 2x 265
333
Please let me know if any clarification is needed.-Nordine
Another way... without the generation of line
SQL> select t2.c3,nvl(t1.c2,tx.c2) c2
2 from tab_2 t2
3 left outer join
4 tab_1 t1
5 on (','||t1.c1||',' like '%,'||t2.c3||',%')
6 join
7 (select c2 from tab_1 where c1 = 'default') tx
8 on(1=1);
C3 C2
---------- ----------
146 1x
265 2x
333 dx
Tags: Database
Similar Questions
-
Hi all
I'm recovering the value of profile with below calling a custom procedure created in the custom schema. But it always retrieves NULL.
v_prof: = fnd_profile.value('ORG_ID');
But when I create the same procedure in APPS Schema, it retrieves the value.
I gave all grants to the schema customized for the apps.fnd_profile package. Help, please!
Kind regards
Patricia K.
in the package/proc/func add property 'authid current_user' - using of PL/SQL subprograms
runtime fnd_profile.value('ORG_ID'); will extract the default apps
-
Retrieve the value of Dialog.ask
I am trying to write a function that will create a context menu using Dialog.ask and return the result of the dialog box to the calling Thread. So far I have somethings like this:
//display a pop-up "Yes or No" box and return true for yes, false for no public boolean ask(final String question){ UiApplication.getUiApplication().invokeLater (new Runnable(){ public void run(){ int answer = Dialog.ask(Dialog.D_YES_NO, question, Dialog.NO); if(answer == Dialog.YES){ //somehow return true } else{ //somehow return false } }}); }
I've seen a similar thread, but I didn't know how to use the solution.
In short, how to use DialogClosedListener to retrieve the value of Dialog.ask to ?
First of all, you probably want to use invokeAndWait so that the calling thread is blocked until the Runnable.run () ends. After that, one solution is to store the result of somewhere. For example, the subclass of the floor and add a field where you store the value (a more general concept of an executable that can return a value in J2SE is the future, but it is not available out of the box in J2ME). Once completed invokeAndWait, you can read this field. Alternatively, you may return the value by changing something in the outer class (one that contstructs the Runnable). For example,.
final int[] result = new int[1]; UiApplication.getUiApplication().invokeAndWait(new Runnable() { public void run() { result[0] = Dialog.ask(...); } }); int choice = result[0]; ...
-
Hallo,
I defined a VO with 3 fields (A, B and C) and I would like to create a SelectOneChoiche that shows only the field as options from this instance of VO.
In a managed bean, I need to retrieve the values for all areas (A, B and C) of the item selected by the user.
I started dragging the entire VO instance to UI to create a SelectOneChoiche (in which I have chosen to show only the to field).
Then, I created a for the SOC ValueChangeListener read the values A, B and C of the selected element, but the only thing I've done is to get the displayed value:
System.out.println((String) ((RichSelectOneChoice) FacesUtils.findComponent("MySoc")).getValue());
You kindly help me?
Thank you
Federico
Federico, sorry I didn't see your answer.
As you use 12.1.3 you can do this more easily than the code that I posted before. You can use
{} public void onCountrySelection (ValueChangeEvent valueChangeEvent)
FacesContext will involve = FacesContext.getCurrentInstance ();
Make sure that the selection change is processed and the current link lov line has the new selected line
valueChangeEvent.getComponent () .processUpdates (contxt);
BindingContext lBindingContext = BindingContext.getCurrent ();
BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry ();
List JUCtrlListBinding = lBindingContainer.get ("CountryId") (JUCtrlListBinding);
the newindex in not necessary, but ok let's get it (must be equal to the CountryId, the pharmacokinetics of the binding of the lov
String newindex = (String) valueChangeEvent.getNewValue ();
get the selected value in the list that is the selected line of the binding of the lov
Line lFromList = list.getSelectedValue () (line);
now, we can get the attributes of the line of lov
String s = (String) lFromList.getAttribute ("CountryId");
System.out.println ("CountryId:" + s);
String s2 = (String) lFromList.getAttribute ("CountryName");
System.out.println ("CountryName:" + s2);
BigDecimal s3 = lFromList.getAttribute("RegionId") (BigDecimal);
System.out.println ("RegionId:" + s3.toString ());
}
The form that I use is based on the location of the HR DB schema table. The CountryId is configured in the view object to display a lov based on the campagneVoir. This view contains thre CountryId, CountryName and RegionId attributes.
If you want to get to the attributes of an action listener you can use this code
{} public void onGetSelectedCountryLov (ActionEvent actionEvent)
BindingContext lBindingContext = BindingContext.getCurrent ();
BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry ();
List JUCtrlListBinding = lBindingContainer.get ("CountryId") (JUCtrlListBinding);
get the selected value in the list that is the selected line of the binding of the lov
Line lFromList = list.getSelectedValue () (line);
now, we can get the attributes of the line of lov
String s = (String) lFromList.getAttribute ("CountryId");
System.out.println ("CountryId:" + s);
String s2 = (String) lFromList.getAttribute ("CountryName");
System.out.println ("CountryName:" + s2);
BigDecimal s3 = lFromList.getAttribute("RegionId") (BigDecimal);
System.out.println ("RegionId:" + s3.toString ());
}
You must add the valueChangeListener and at least add the lines
FacesContext will involve = FacesContext.getCurrentInstance ();
Make sure that the selection change is processed and the current link lov line has the new selected line
valueChangeEvent.getComponent () .processUpdates (contxt);
to ensure that the selected line is available when you click the button.
And set autosubmit'= true for the field in the UI that displays the LOV.
Timo
-
search form Web apps: how to retrieve the value of the data-source type field
Hello
My question is:
How can I retrieve the value of the source field of a web - app data-types when you insert the "form web search apps" on a web page.
I have a web application that contains fields from the data source of the type. These fields to recover the (data) value of the 'web app' - 'elements of the field' field of another web application.
When I insert the form
Web apps
Web apps-search form
Name of the Web application
It displays the fields with the field (ie. string, number) types other than type of field 'data source '.
(Note: in the mode 'model of list' module of data tags, the fields of the data source are visible).
What other (alternative) possibilities are there to create a search form?
Thanks for your help.
Kind regards
Carla
By chance, I came up with this workaround. Of course there are other methods to get your data from a web - app, but if you want to use the 'Web apps search form', it would be a workaround.
I noticed that the "Web apps entry form" contains all the fields of web applications for your web application (including the fields of the data source).
It is possible to add the fields to the form of the "Web apps entry form" in the «Web apps search form»
If you insert the "Web apps entry form" on a blank page, you will see all the fields in your web App including the "data source fields. The names of form fields contain something like.
-
How to retrieve the value of a custom field
Hello @all.
In my vCenter, I created a custom field 'email '. The value of this field is set to the e-mail address of the operator of that belongs to a virtual machine.
I would like to retrieve these values in a perl script. But I have found a method to set the values of the custom fields. For example:
$CustomFieldsManager -> SetField(entity => $_, key=> $emailKey, value => "[email protected]");
What should I do to retrieve the value of the $emailKey key? Could someone provide a quick and dirty-snippet, please?
Best regards
Trondesson
of course, in this discussion https://communities.vmware.com/message/1512863#1512863 you can see how it's done
-
pageContext.getParameter not retrieve the value of VO
Dear,
I use (pageContext.getParameter) to retrieve the value of messageTextInput when I click on submit and it works very well. But when I linked the messageTextInput with the VO attribute it returns value. Please I need your help with this.
This is my code for CO
/*===========================================================================+ | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA | | All rights reserved. | +===========================================================================+ | HISTORY | +===========================================================================*/ package g4s.oracle.apps.po.suppliers.server; import java.io.Serializable; import oracle.apps.fnd.common.MessageToken; import oracle.apps.fnd.common.VersionInfo; import oracle.apps.fnd.framework.OAApplicationModule; import oracle.apps.fnd.framework.OAException; import oracle.apps.fnd.framework.webui.OAControllerImpl; import oracle.apps.fnd.framework.webui.OADialogPage; import oracle.apps.fnd.framework.webui.OAPageContext; import oracle.apps.fnd.framework.webui.TransactionUnitHelper; import oracle.apps.fnd.framework.webui.beans.OAWebBean; import g4s.oracle.apps.po.suppliers.server.common.SuppliersVO; import oracle.jbo.ViewObject; /** * Controller for ... */ public class SuppliersInfoCO extends OAControllerImpl { public static final String RCS_ID = "$Header$"; public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion(RCS_ID, "%packagename%"); /** * Layout and page setup logic for a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); if (!pageContext.isBackNavigationFired(false)) { TransactionUnitHelper.startTransactionUnit(pageContext, "SupplierApprovalTxn"); if (!pageContext.isFormSubmission()) { OAApplicationModule am = pageContext.getApplicationModule(webBean); ViewObject MyVO = am.findViewObject("SuppliersVO1"); MyVO.setNamedWhereClauseParam("vdr_id", pageContext.getParameter("vdr_id")); MyVO.executeQuery(); } } else { if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "SupplierApprovalTxn", true)) { OADialogPage dialogPage = new OADialogPage(STATE_LOSS_ERROR); pageContext.redirectToDialogPage(dialogPage); } } } /** * Procedure to handle form submissions for form elements in * a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); //SupplierAMImpl am = (SupplierAMImpl)pageContext.getApplicationModule(webBean); //String xx = "ApprovalBTN"; //Serializable[] parameters = { xx }; //am.invokeMethod("TriggerApproval", parameters); String userContent = pageContext.getParameter("SupplierNameEnITM"); MessageToken[] tokens = { new MessageToken("SUP_NAME",userContent) }; OAException confirmMessage = new OAException("PO", "WF_PO_SUPPLIER", tokens, OAException.CONFIRMATION, null); pageContext.putDialogMessage(confirmMessage); } }
print pageContext.getParameter ("vdr_id") and see what he's back
-
How to retrieve the values of character without using single quotes
Hi all
How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL
Please answer me...
For example
Is actual query-> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);
I want to--> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.
Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.
shagarmahabubjan wrote:
Hi all
How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL
Please answer me...
For example
Actual query is---> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);
I want to---> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.
Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.
In short... you can't. The channels are channels, and SQL and PL languages dictate that the string literals are provided within single quotes.
I don't see how trying to retrieve more than 200 records of employees in the select statement means that you must get rid of the quotes.
Be clear in what you ask: Re: 2. How can I ask a question on the forums?
and take note of the FAQ link davidp provided the solution "variable IN the list.
-
Error when retrieving the value of the pair name / value
Hi gentlemen,
I am facing a problem while retrieving the value of the pair name / value in the incoming XML file. I am using an Xpath query to retrieve the value but Jdeveloper gives me
an invalid expression error.
Please find below the new xml and xquery.
< ebo:QueryItemListEBM xmlns:ebo = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Item/V2" >
< ebo:DataArea xmlns:aia = "http://www.oracle.com/XSL/Transform/java/oracle.apps.aia.core.xpath.AIAFunctions" xmlns:coreitem = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Item/V2" >
< ebo:Query >
< ebo:QueryCode > QUERY_ITEMS < / ebo:QueryCode >
< corecom:QueryCriteria xmlns:corecom = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" >
< corecom:QueryExpression >
< corecom:ValueExpression >
< corecom:ElementPath > ItemEBO/Item/InventoryLocation/BusinessComponentID < / corecom:ElementPath >
< corecom: Value > 82 < / corecom: Value >
< / corecom:ValueExpression >
< corecom:ValueExpression >
< corecom:ElementPath > ItemEBO/Item/ItemIdentification/ContextID@OPERATING_UNIT_ID < / corecom:ElementPath >
< corecom: Value / >
< / corecom:ValueExpression >
< corecom:ValueExpression >
< corecom:ElementPath > ItemEBO/Identification/BusinessComponentID < / corecom:ElementPath >
< corecom: Value > ba55de86-d8b4-4db1-b599-5aef8424ac3b < / corecom: Value >
< / corecom:ValueExpression >
< corecom:ValueExpression >
< corecom:ElementPath > ItemEBO/Item/ItemIdentification/ContextID@STRUCTURE_NAME < / corecom:ElementPath >
< corecom: Value > PIM_PBOM_S < / corecom: Value >
< / corecom:ValueExpression >
< corecom:ValueExpression >
< corecom:ElementPath > ItemEBO/Identification/review < / corecom:ElementPath >
< corecom: Value > 208281 < / corecom: Value >
< / corecom:ValueExpression >
< / corecom:QueryExpression >
< / corecom:QueryCriteria >
< / ebo:Query >
< / ebo:DataArea >
< / ebo:QueryItemListEBM >
I need to retrieve the value 'ba55de86-d8b4-4db1-b599-5aef8424ac3b' on top of xml and xpath expression that I used is:
bpws:.
Please help with your valuable contributions.
Thank you and best regards,
Vikas marzouk829347 wrote:
Hi Vlad,It works quite well. A big thank you to you.
see you soon,
VikasHi Vikas, could you marking my answer as correct then?
Thank you
Vlad -
How to retrieve the value of base on the value on other nodes
Hi, I have a XML below
<? XML version = "1.0" encoding = "iso-8859-1"? > <? XML-stylesheet type = "text/xsl" href="C:\temp\horizontal.xsl"? " >
< Type report = "REPORT" >
< prop Type = 'Result' Flags = "0 x 0" > "
< prop Name = 'STEP' Type = "Obj" Flags = "0 x 0" > "
< prop Name = 'Sequence' >
< prop Name = 'RList' >
< ArrayElementPrototype Type = "TEResult" Flags = "0 x 0" > "
< / ArrayElementPrototype >
< value ID "[0]" = >
< prop Type = 'Result' Flags = "0 x 0" > "
< prop Name = "Status" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "ReportText" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "Common" Type = "Obj" TypeName = "CommonResults" Flags = "0 x 0" > "
< / prop >
< / prop >
< / value >
< value ID "[60]" = > = > ID is not set
< prop Type = 'Result' Flags = "0 x 0" > "
< prop Name = "Error" Type = "Obj" TypeName = "Error" Flags = "0x400000" > "
< prop Name = "Code" Type = "Number" Flags = "0x400000" > "
< value > 0 < / value >
< / prop >
< prop Name = "Msg" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "occurred" Type = "Boolean" Flags = "0x400000" > "
< value > false < / value >
< / prop >
< / prop >
< prop Name = "Status" Type = "String" Flags = "0x400000" > "
< value > spent < / value >
< / prop >
< prop Name = "Numeric" Type = "Number" NumFmt = "%i" Flags = "0 x 2400" > "
< Value > * 88 * < / value > = > value I want back
< / prop >
< prop Name = "ReportText" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "Common" Type = "Obj" TypeName = "CommonResults" Flags = "0 x 0" > "
< / prop >
< prop Name = "Units" Type = "String" Flags = "0x2000" > "
< Value >TESTDATA< / value > = > basic data
< / prop >
< / prop >
< / value >
< / prop >
< / prop >
< / prop >
< / prop >
< / report >
I want to retrieve the value 88 the TESTDATA found in this node, can someone show me how to recover?
Thank you
Vincent
Published by: pj * April 29, 2011 01:14Yes, it is possible, but the query will be slightly less effective.
SELECT XMLQuery( 'for $i in $d/descendant::Value/Prop where $i/Prop[@Name="Units"]/Value = $PropValue return $i/Prop[@Name="Numeric"]/Value/text()' passing t.object_value as "d" , sys_xmlgen('TESTDATA') as "PropValue" returning content ).getNumberVal() as result FROM test_xml t ;
-
How to retrieve the value of the attribute-based
Hello
I save our file XML in a clob field.
The contend of the XML file is as below
< Reports >
"< report Type = 'USE' Title = 'USE report' Link="-1-2010-11-2-0-39-48-750 ' UUTResult = 'Fail' StepCount '69' = >
< prop Name = 'USE' Type = "Obj" TypeName = "USE" Flags = "0 x 0" >
< prop Name = "Serial number" Type = "String" Flags = "0 x 0" >
< value > 20302884 < / value >
< / prop >
< prop Name = "UUTLoopIndex" Type = "Number" Flags = "0 x 0" >
< value > 2 < / value >
< / prop >
< prop Name = "CriticalFailureStack" Type = "Array" LBound = HBound "[0]" = "[1]" ElementType = "Obj" Flags = "0 x 0" >
< ArrayElementPrototype Type = "Obj" TypeName = "NI_CriticalFailureStackEntry" Flags = "0 x 0" >
< prop Name = "StepName" Type = "String" Flags = "0 x 0" >
< value > < / value >
< / prop >
< prop Name = "SequenceName" Type = "String" Flags = "0 x 0" >
< value > < / value >
< / prop >
< prop Name = "SequenceFileName" Type = "String" Flags = "0 x 0" >
< value > < / value >
< / prop >
< prop Name = "Result identifier" Type = "Number" Flags = "0 x 0" >
< value > 0 < / value >
< / prop >
< / ArrayElementPrototype >
< value ID "[0]" = >
< prop Type = "Obj" TypeName = "* NI_CriticalFailureStackEntry *" Flags = "0 x 0" > ""
< prop Name = "StepName" Type = "String" Flags = "0 x 0" >
< Value >pre-program test< / value >
< / prop >
< prop Name = "SequenceName" Type = "String" Flags = "0 x 0" >
< value > MainSequence < / value >
< / prop >
< prop Name = "SequenceFileName" Type = "String" Flags = "0 x 0" >
< value > Challenger_Phase1.seq < / value >
< / prop >
< prop Name = "Result identifier" Type = "Number" Flags = "0 x 0" >
< value > 368 < / value >
< / prop >
< / prop >
< / value >
< value ID "[1]" = >
< prop Type = "Obj" TypeName = "* NI_CriticalFailureStackEntry *" Flags = "0 x 0" > ""
< prop Name = "StepName" Type = "String" Flags = "0 x 0" >
< Value >regulator LogicReg< / value >
< / prop >
< prop Name = "SequenceName" Type = "String" Flags = "0 x 0" >
< value > pre-program test < / value >
< / prop >
< prop Name = "SequenceFileName" Type = "String" Flags = "0 x 0" >
< value > Challenger_Phase1.seq < / value >
< / prop >
< prop Name = "Result identifier" Type = "Number" Flags = "0 x 0" >
< value > 371 < / value >
< / prop >
< / prop >
< / value >
< / prop >
< / prop >
< / report >
< / Reports >
Can someone guide me how can I retrieve the value of the Prop Name = "StepName", i.e. "Before the program tests" and "LogicReg regulator", which is 1 level under the TypeName = "NI_CriticalFailureStackEntry." I extracted the part of XML code below
< prop Type = "Obj" TypeName = "NI_CriticalFailureStackEntry" Flags = "0 x 0" >
< prop Name = "StepName" Type = "String" Flags = "0 x 0" >
< value > pre-program test < / value >
< / prop >
and
< prop Type = "Obj" TypeName = "NI_CriticalFailureStackEntry" Flags = "0 x 0" >
< prop Name = "StepName" Type = "String" Flags = "0 x 0" >
Regulator LogicReg < value > < / value >
< / prop >
Thank you
VincentPJ * wrote:
I save our file XML in a clob field.If you still have the choice, you should consider storing XML data in XMLType column.
For the moment, assume that the XML data resides in the CLOB SAMPLE_TABLE column. DOC:
You can use XMLTable to break a sequence of XML elements in columns and relational rows:
SQL> select x.* 2 from sample_table t, 3 xmltable( 4 '//Prop[@TypeName="NI_CriticalFailureStackEntry"]/Prop[@Name="StepName"]' 5 passing xmltype(t.doc) 6 columns num for ordinality, 7 val varchar2(100) path 'Value' 8 ) x 9 ; NUM VAL ---------- ----------------------------------- 1 Pre-program tests 2 Regulator LogicReg
XMLQuery or to extract it as a string:
SQL> select xmlquery( 2 'string-join(//Prop[@TypeName="NI_CriticalFailureStackEntry"]/Prop[@Name="StepName"], "|")' 3 passing xmltype(t.doc) 4 returning content 5 ).getstringval() as "RESULT" 6 from sample_table t 7 ; RESULT ---------------------------------------------- Pre-program tests|Regulator LogicReg
-
How to retrieve the values of a number of column by column in pl sql
I wanted to know how can I retrieve the values of a column just in number and not the name of the column.user10989720 wrote:
I need exactly this kind of thing.I am retrieving the name of the column from all_tab_columns and under this column name can I retrieve values using any kind of query sub.
Select column_name
from all_tab_columns
where table_name = 'QUOTE_HEADERS_EXT' and
column_id = 58You're still not understanding. You need to do if you want to get the values of the table dynamically.
Either like this:
SQL> create or replace type t_colval is table of varchar2(4000); 2 / Type created. SQL> ed Wrote file afiedt.buf 1 CREATE OR REPLACE FUNCTION get_column(p_sql IN VARCHAR2, p_column_no NUMBER) RETURN t_colval PIPELINED IS 2 v_finaltxt VARCHAR2(4000); 3 v_v_val VARCHAR2(4000); 4 v_n_val NUMBER; 5 v_d_val DATE; 6 v_ret NUMBER; 7 c NUMBER; 8 d NUMBER; 9 col_cnt INTEGER; 10 f BOOLEAN; 11 rec_tab DBMS_SQL.DESC_TAB; 12 col_num NUMBER; 13 BEGIN 14 c := DBMS_SQL.OPEN_CURSOR; 15 DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE); 16 d := DBMS_SQL.EXECUTE(c); 17 DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab); 18 FOR j in 1..col_cnt 19 LOOP 20 CASE rec_tab(j).col_type 21 WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); 22 WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val); 23 WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val); 24 ELSE 25 DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000); 26 END CASE; 27 END LOOP; 28 LOOP 29 v_ret := DBMS_SQL.FETCH_ROWS(c); 30 EXIT WHEN v_ret = 0; 31 v_finaltxt := NULL; 32 CASE rec_tab(p_column_no).col_type 33 WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,p_column_no,v_v_val); 34 WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,p_column_no,v_n_val); 35 v_v_val := to_char(v_n_val); 36 WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,p_column_no,v_d_val); 37 v_v_val := to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'); 38 ELSE 39 DBMS_SQL.COLUMN_VALUE(c,p_column_no,v_v_val); 40 END CASE; 41 PIPE ROW (v_v_val); 42 END LOOP; 43 DBMS_SQL.CLOSE_CURSOR(c); 44* END; SQL> / Function created. SQL> select * from table(get_column('select * from emp',1)); COLUMN_VALUE --------------------------------------------------------------------------------------------------------------- 7369 7499 7521 7566 7654 7698 7782 7788 7839 7844 7876 7900 7902 7934 14 rows selected. SQL> select * from table(get_column('select * from emp',2)); COLUMN_VALUE --------------------------------------------------------------------------------------------------------------- SMITH ALLEN WARD JONES MARTIN BLAKE CLARK SCOTT KING TURNER ADAMS JAMES FORD MILLER 14 rows selected. SQL>
Or like this:
SQL> create or replace type t_colval is table of varchar2(4000); 2 / Type created. SQL> ed Wrote file afiedt.buf 1 CREATE OR REPLACE FUNCTION get_column(p_table IN VARCHAR2, p_column_no NUMBER) RETURN t_colval PIPELINED IS 2 v_column_name VARCHAR2(30); 3 v_rc SYS_REFCURSOR; 4 v_val VARCHAR2(4000); 5 BEGIN 6 SELECT column_name 7 INTO v_column_name 8 FROM user_tab_columns 9 WHERE column_id = p_column_no 10 AND table_name = UPPER(p_table); 11 OPEN v_rc FOR ('SELECT '||v_column_name||' FROM '||p_table); 12 LOOP 13 FETCH v_rc INTO v_val; 14 EXIT WHEN v_rc%NOTFOUND; 15 PIPE ROW(v_val); 16 END LOOP; 17 CLOSE v_rc; 18* END; SQL> / Function created. SQL> select * from table(get_column('EMP',2)); COLUMN_VALUE ---------------------------------------------------------------------------------------------------------------- SMITH ALLEN WARD JONES MARTIN BLAKE CLARK SCOTT KING TURNER ADAMS JAMES FORD MILLER 14 rows selected. SQL>
-
retrieve the value from the base to the element
Hi all
I use the following code to retrieve the value in an element.
Select distinct (tsccod_0) 'name of the group. "
apex_item. RadioGroup (1, tsccod_0, null, null,'onclick = s("P2_PK","'||)) $ tsccod_0 |' «);') » Select"in vw_grpclient;
But if the value in the tsccod_0 column is to have a space, for example: xxx xxxx xxxx he doesn't value, instead, which gives an error.
What should I do if the value is to have spaces. Something that I'm missing that I don't know about?
Thanks in advance
Good bye
Sonny_starckHello
I don't know why space should make any difference, but I've updated the sql statement for:
select APEX_ITEM.RADIOGROUP (1,ename,null,null,'onclick=$s("P3_PK",this.value);') emp, ename, empno, job, mgr, hiredate, sal, comm, deptno from sampemp
and this seems to have fixed
Andy
-
Retrieve the values of the executable (Dialog.Ask)
Hello world!
I have a situation where I have to ask the user a question according to the status of a remote object (sent to a web service). This operation is performed within a Thread, so I can't directly use the Dialog.Ask () because it translates into the exception "Engine UI consulted without holding the lock of the event". I used this code sample to get the dialog to the user
synchronized(UiApplication.getEventLock()) { Runnable push = new Runnable() { public void run() { Dialog.ask(message, choices, 0); } }; UiApplication.getUiApplication().invokeLater(push); }
This work is nice, but I can't retrieve the result... And because it's in a thread, I don't know how I could get it... Can someone help me with this one?
Thank you!
You usually use
Synchronized (UiApplication.getEventLock ())
or
UiApplication.getUiApplication (.invokeLater)
There's no value in using both at the same time.
In this case, the Dialog.ask returns an int, that indicates the result. The doc of the API:
Returns:
The selection of your choice (not the index) value, as must be returned by getSelectedValue(). For example, CANCEL, OK or DELETE are among the possible return values.Thus, you can code something like:
int i = Dialog.ask (...);
Treat the i then returned.
Without doubt, you actually want to return the result in your calling Thread. I don't know how "legal", it is, but you might be able to get away with:
selectedChoice int = - 1;
{Synchronized (UiApplication.getEventLock ())}
selectedChoice = Dialog.ask (.);}
If you can't do that, then look to split the treatment at the time of questions and using a DialogClosedListener to the decision of the user process. I don't know there are other options, just of can't think right now.
-
Get the values of default table row when the page loads
Hello
I am running JDev 11.1.1.7. We have a page that contains two tables in a relationship of the master / detail of nickname. We can do a real master ADF / detail with view items related because the query for the 2nd table is complex and works best when queries with binding settings. The View object for the 2nd table has a request with 2 link params as it can get in the first table. Thus, when a line is selected in the first table we want to execute ExecuteWithParams on the object from view of the table 2. We do it in the Bean managed for the page in a method that is the selection to the first table listener. It works fine except when the page initially loads, the first line is selected by default. When the default value is selected the selection listener is not triggered.
I've seen the suggestion of not having a line selected by default when the page loads by removing the value selectedRowKeys on the table. However, we do not want that the 1st row of the table secondary master to be selected by default and we as the table of detail to show the correct corresponding lines.
Steve
Steve,
Not really sure when you say that the 2nd table is complex and may not use the master detail. If the settings link in the parent table, you can set the ViewLink accordingly and it should work, right?
In any case, if you're after the execution of methods on the loading of the page, you will find the links below.
If it's a working group, you can add a methodCall as activity by default and UTF, you can use phase listener (if listener server does not).
https://blogs.Oracle.com/aramamoo/entry/an_epic_question_how_to
It will be useful.
See you soon
AJ
Maybe you are looking for
-
Satellite A300 - Webcam broken or a driver error?
Hi to everyone. I have a Toshiba Satellite A300. He is eight years old, but I want to continue working with her. When working, he felt on the floor and the HD was damaged. I replaced it. Now, I just installed Windows 7 x 64 (previously, it had Win XP
-
Satellite A660 - 10 X - no boot after upgrading RAM 8 GB, but 4 GB + 2 GB only
Hello Today I bought two sticks of Kingston 4 GB DDR3 1066 MHz CL7 and I'm trying to replace my 2 GB ones, but something is wrong. If I put two sticks of 4 GB laptop does not start. I have the latest version of the BIOS (1.80). I have restored the de
-
using qnx.system.Device.pin
The class PIN not usable in the current SDK? a bit like the keyboardType class? I'm trying to use it, but it is throwing errors like if there is no...
-
Two Applications of blackBerry Smartphones found on...
My BB Storm 9530 Recently, I turned on my BB Storm & noticed 2 APPS that were on my phone that I've never added? One was YOUTUBE I thought great just what I wanted. So I clicked on 'I Aggree' but he said 'not supported for this device? is there a You
-
AnyConnect VPN users cannot access remote subnets?
I googled this until blue in the face without result. I don't understand why Cisco this so difficult? When clients connect to the anyconnect vpn, they can access the local subnet, but cannot access the resources in remote offices. What should I do