How to set dynamic IN clause in English query
Hi ADFExperts,
I have a requirement as if I had a viewObject
Let's say that "select * contact"this query result is 20 lakhs records.
My requirement,
I have to apply the clause 'IN' in this display object so that it will bring only required line.
For example Select * from contact where name: bindName;
I'm passing in the param type string "(" James","John") bindName '"
and I will execute VO.
But it is not the result.
Help, please.
User, please tell us your jdev version!
Check out Jobinesh blog decompilation binary ADF: using bind variable for SQL statements with the paragraph which you shoes how to proceed.
Timo
Tags: Java
Similar Questions
-
How to set dynamically scroll pane?
Hai...
I'm trying to get the text of the xml tag and put it in the scrollpane but Idont know how to set dynamically in scrollpane... someone has idea... Please help me
Thank you
Dembélé
I found the solution... Scroll pane is allocated dynamically when content is dynamic
-
Very Urgent: Setting dynamic where clause for Popup list VO
Hello world
It is a very urgent requirement please help as soon as possible.
I have a custom page in iSupplier. I created two supplier site, number of PO fields.
Site of beg - choice of Message and PO number - Message LOV of entry
I have a named VO under xxisupplier.oracle.apps.pos.home.poplist.server for site begging and xxisupplier.oracle.apps.pos.home.lov.server for PO number.
I have joined these two VO AM homepage.
Now the question is
1. I want to restrict these VO vendor_id-based so I'll put dynamically where clause for these two VO of in my CO
VO SITE PROVIDER QUERY
SELECT POVs.vendor_site_code site, pov.vendor_id
OF po_vendors pov, povs po_vendor_sites_all
WHERE pov.vendor_id = povs.vendor_id
AND TRUNC (povs.inactive_date) IS NULL
PO NUMBER LOV QUERY VO
SELECT DISTINCT ai.invoice_num, ai.vendor_id, ai.invoice_date, poh.segment1
AI ap_invoices_all,.
help ap_invoice_distributions_all,
po_headers_all poh,
po_distributions_all pda,
Al ap_lookup_codes
WHERE aid.po_distribution_id = pda.po_distribution_id
AND ai.invoice_id = aid.invoice_id
AND poh.po_header_id = pda.po_header_id
AND ai.invoice_type_lookup_code = al.lookup_code
AND al.lookup_type = 'INVOICE TYPE'
I am creating where cluase as below in CO
If (vendor_id1! = null)
{
System.out.println ("vendor_id:" + vendor_id1);
OAViewObjectImpl vo = (OAViewObjectImpl) am.findViewObject ("PO_LOV_VO");
if(vo!=null)
{
vo.clearCache ();
VO. Reset();
System.out.println ("inside IN. VO:" + vendor_id1);
vo.setWhereClause (null);
vo.setWhereClause ("vendor_id =: 1");
vo.setWhereClauseParams (null);
vo.setWhereClauseParam(0,vendor_id1);
vo.setOrderByClause ("invoice_date DESC");
String INVQRY = vo.getQuery ();
System.out.println ("INVQRY:" + INVQRY);
vo.executeQuery ();
VO. First();
System.out.println ("after the query appear" + vo.getRowCount ());
}
OAViewObjectImpl sitevo1 = (OAViewObjectImpl) am.findViewObject ("SUPPLIER_SITE_VO1");
if(sitevo1!=null)
{
sitevo1.clearcache ();
sitevo1. Reset();
System.out.println ("Interior site:" + vendor_id1);
sitevo1.setWhereClause (null);
sitevo1.setWhereClause ("vendor_id =: 1");
sitevo1.setWhereClauseParams (null);
sitevo1.setWhereClauseParam(0,vendor_id1);
String SITEQRY = sitevo1.getQuery ();
System.out.println ("SITEQRY:" + SITEQRY);
sitevo1. ExecuteQuery();
sitevo1. First();
System.out.println ("after the query appear" + sitevo1.getRowCount ());
}
Here he works for the purchase order number but the where cluase does not work for Supplier Site. Please help as soon as possible.
2 and also if supplier site to return multiple values then this field should show as messagechoice. If it returns a single value, then it should be the style text message
How can I achieve this.
Thank you
CSKTry
vo.setWhereClause ("IN vendor_id (" + vendor_id_qry + ")" ");
vendor_id_qry is the query that retrieves the list of provider IDS. You don't need to put the vendor column id as whereClauseParam unless you want to have IN the clause in your query of VO and pass the list as 1,2,3 values to the parameter.
Thank you
Shree -
How to set up the right policies to query the DB Production
Hi expert,
I'd like to hear your comments on how to put in place a good policy to query the database of Production.
We have a group of developers to report that sometimes run report against Production and took about 3 hours and almost consuming 100% of CPU.
I need to put in place a policy of good but not ridiculous for this.
My senior DBA insist on limiting the time as no more than 5 minutes, which I disagree. I think time is not a matter as long as it is not breaking the system. However, our developers in my opinion have a knowledge of Oracle. This is why we must put in place a policy which is good and easy to be digested by them. I think it is the reason for my senior DBA to take the shortcut of plan for the application of the limit of 5 minutes for the query.
any input and comments are appreciated. Thank youThere is a very simple strategy, which can be implemented rightaway:
Developers should not be near any system of production, and no test code should be run on a production database.
You simply implement the Production, acceptance, Test strategy, where acceptance is hosting a realistic production as a version of the database.
If it works on the database of acceptance, it can be run on production.Involve other correct strategies
-limit the amount of time processor
-limit the amount of disk i/o
etc., using profiles
This means that the session is disconnected, once a limit is exceeded.The Resource Manager using Oracle is a different option, which will allow the list of unwanted users at a lower priority, but it is an additional burden.
Finally, "developers" are the only virus against no scan anti-virus software to protect your server.
Make sure you only keep the!----------
Sybrand Bakker
Senior Oracle DBA -
How to: Set French as the language of the default keyboard
Original title: when I type anything language changes? How to set the default language in English?
When I type anything language changes? How to set the default language in English?
Follow the section "Let me fix it myself" in the article below (or use the "FixIt" If you are feeling lucky):
"How to use the United International keyboard layout in Windows 7, Windows Vista and in Windows XP"
<>http://support.Microsoft.com/kb/306560 >HTH,
JW -
Problem with dynamic setting where the clause OFA
Hi all
I have a view object with the following query:
SELECT rownum LINENUM,
B.line_id LINE_ID,
B.INVENTORY_ITEM_ID INVITMID,
B.QUANTITY_DELIVERED PICKQTY
MTL_TXN_REQUEST_HEADERS a,.
MTL_TXN_REQUEST_LINES B
WHERE A.HEADER_ID = B.HEADER_ID
AND A.MOVE_ORDER_TYPE = 2
AND "on" =: 1
AND B.TO_SUBINVENTORY_CODE = NVL(:4,B.TO_SUBINVENTORY_CODE)
AND A.request_number = NVL(:5,A.REQUEST_NUMBER)
UNION ALL
SELECT rownum LINENUM,
a.wip_entity_id LINE_ID,
a.INVENTORY_ITEM_ID INVITMID,
a.QUANTITY_ISSUED PICKQTY
WIP_REQUIREMENT_OPERATIONS has
eam_work_orders_v b
WHERE a.wip_entity_id = b.wip_entity_id
AND "on" =: 2
AND a.ATTRIBUTE2 = NVL(:4,a.ATTRIBUTE2)
and b.wip_entity_name = NVL(:6,b.wip_entity_name)
I need to dynamically pass a condition to my where clause that I can manage it by setting two binding settings in the query of vo and can pass it on but the problem is the connection variable contains a string like 1311,13112,14445 that I need to spend for a domain like B.line_id in the first query and b.wip_entity_id in the second query , so when I'm passing the string as a value it works fine, but it gives for value separetd by comma prob.
so I tried passing dynamic where clause, but there is every time that the execution of the first clause only how can I dynamically pass both queries.
vo.setWhereClause ("LINE_ID in" + wherclause);
Please help me
Thnaks
Deb
Hello
Actually I'm passing the parameter to the basic page popup, so in page popup page and the base, I was using the VO even to run then, probably due to that he was running again for all data, so for the basic page I created a new VO and tried to pass the parameter like when clause for questioning now it runs very well Thank you for all your help
-
How to set speech recognition in English
Hello world
I live in Barcelona and have the Spanish version of Windows 7, Home Premium edition.For my work, I use most of the time English and I would like to use speech recognition in Win7.I made the tutorial - in Spanish - but you do not how to set all of the application into English.Does anyone know how to do?Thank you.Hello
Unfortunately, it is not possible to change just the language of speech recognition. Windows speech recognition is only available when the language of the operating system matches the language of Windows speech recognition. You can change the language of the operating system by installing a language pack from Windows Update. If you install the language pack for a supported language of Windows speech recognition, you can then use Windows speech recognition to this language if it is also the language of the operating system.
Note: Multilingual User Interface Pack MUIs are available in Windows 7 ultimate through Windows Update as optional updates. They are not installed automatically.
See below the help links-
http://Windows.Microsoft.com/en-us/Windows7/setting-speech-options
http://Windows.Microsoft.com/en-us/Windows7/set-up-speech-recognition
I hope this helps.
-
Hallo,
I have a request based on VO.
The query contains a where clause clause and a bindi variable.
In a managed bean I would like to access the iterator of VO setting the value of the bind variable and read the result.
I found this code it is good start, but I do not know how to set the variable binding.
BindingContext bctx = BindingContext.getCurrent(); BindingContainer bindings = bctx.getCurrentBindingsEntry(); DCIteratorBinding iter = (DCIteratorBinding ) bindings.get("MyVO1Iterator"); iter.execute();
You kindly help me?
Also, I would like to know if it is generally advisable to use VO directly in controlled beans or whether it would be best to create in the AppModuleImpl methods that do this and return the result.
In my case for example of the VO will return max 1 plug so I'm in doubt, if the creation of a method in the AM that returns a custom class, which attributes contain values of the line of VO.
Sorry if these questions may seem artificial, but I am a beginner, I have many doubts and so I would be happy to receive some tips regarding best practices.
Thank you
Federico
You can use:
iter.getViewObject().setNamedWhereClauseParam("yourBindVar", value);
Note that this approach is used if you have bind variable in the where clause.
To set variables bind to ViewCriteria, you must use VarableValueManager.
This post may be useful for you: binary: how to set the Bind variable values at run time?
Also, I would like to know if it is generally advisable to use VO directly in controlled beans or whether it would be best to create in the AppModuleImpl methods that do this and return the result.
You must set "use VO directly.
For example, from the point of architecture, is probably best to use the method in the model project which will set the bind variable and execute the query.
Or you can use the ExecuteWithParams operation in your the view layer.
In my case for example of the VO will return max 1 plug so I'm in doubt, if the creation of a method in the AM that returns a custom class, which attributes contain values of the line of VO.
Not to complicate your life
All VO lines are represented as ViewRowImpl class if you already have "custom class".
Finally, you can generate your own ViewRowImpl class if it is necessary for this.
Dario
-
How to set 'Initial value' of an element of messageTextInput dynamically
How can I dynamically set 'Initial value' of a messageTextInput point?Hello
Su wrote:
curr.setValue (pageContext,"" + r.getAttribute (0) ");String value = r.getAttribute (0);
curr.setValue (pageContext, value);
Concerning
Meher Irk -
How to set SQL that contains 'in' where clause in VO?
I don't want to set "in" would adopt a kind of programatical in VO as below. I want to use a method declariable to set in the clause using bindings varaible.
It can be implemented?
private String getInClauseWithParamNames(List termCodes) { //logic to form the in clause with multiple bind variables StringBuffer inClause = new StringBuffer(); if(termCodes !=null){ for (int i = 1; i < termCodes.size() + 1; i++) { inClause.append(":termC" + (i)); if (i < termCodes.size()) { inClause.append(","); } } } return inClause.toString(); } public Row[] getYardFixedSlots(List termCodes) { if(termCodes != null && !termCodes.isEmpty()){ String inClause = getInClauseWithParamNames(termCodes); //setting the where cluase to use the generated in clause this.setWhereClause("YardFixedSlot.TERMINAL_C in (" + inClause + ")"); ////clearing all existing where clause params if any this.setWhereClauseParams(null); if(getVariableManager() !=null){ this.getVariableManager().clearVariables(); } //setting values for all bind variables one by one in the in clause for (int i = 0; i < termCodes.size(); i++) { //defining the named bind variables programatically this.defineNamedWhereClauseParam("termC" + (i + 1), null, null); //setting the value for each named bind variable this.setNamedWhereClauseParam("termC" + (i + 1), termCodes.get(i)); } this.setRangeSize(-1); //executing the query this.executeQuery(); } //returning the rows from query result return this.getAllRowsInRange(); }
You can only use the link as a parameter to the in clause. You must divide the string inside the binding variable. Sample can be found at decompilation binary ADF: using bind variable for SQL statements with the paragraph
Timo
-
Need help with dynamic where clause.
Hello world. I'm kind of a novice with PL/SQL, so please be patient with me. I am building a web application using Weblogic Oracle 11 g and Oracle database.
To make a long story short, I need to generate the complex dynamic WHERE clause. I don't know what will be the name of the column or the operator of comparison or the value will be until the moment of execution.
I'm not 100% certain, but I think I need to use dynamic SQL statements. Unless there is a better way to do it.
I'm sure that using dynamic SQL opens me up to SQL injection attacks if I use simple string concatenation. I would like to use bind variable if possible.
In any case, it seems like trying to build a dynamic where clause does not seem to work as I want it would be...
bv1 := 'colA = 5 and colB >= 9'; query_str := 'SELECT * FROM view WHERE :bv1'; OPEN CUR FOR query_str USING bv1;
The code above pours out when I try to run it.
Is there a way to build dynamic where the provisions without the use of concatenation of simple string that leaves me open to attacks by SQL injection?
Thank you
Hello. I have read briefly upward on things, you suggested, but it seems a bit abstract for me since I was a novice.
Can you give us an explanation or an example of how to use it to accomplish what I need to do?
Do ypu really plan create a query with a WHERE clause that contains a predicate for all possible columns?
Variable bind offer performance when the same query is executed several times with different values for bind variables.
Select * from emp where empno =: v_empno
After the first run Oracle will always be this query in the library cache. The next running can use the version of the cache even if the bind value is different.
Select * from emp where empno =: v_empno;
Select * from emp where ename =: v_ename;
Select * from emp where sal =: v_sal;
Each one is a DIFFERENT query. Yes - each of them uses a variable binding, but queries are different.
So, if your username select EMPNO, an '=', and a value from the first query can be executed. But the next time that the user can select the ENAME column so that 'stored' first request may not be used given that the query does not match.
The third time your user selects SAL so none of the first two queries can be used in the library cache. The use of bind variables gives performance during the SAME QUERY is used multiple times with DIFFERENT values for the variable binding. Oracle is not to analyze the hard query everything simply because the VALUE is different.
So bind variables do not help you if most of the queries were completely DIFFERENT sets of predicates. And SYS_CONTEXT will not help either since that simply provides a way to define binds the values of the variables.
Just for the simple example above, there are at least SIX possible combinations of columns that could choose your user name: empno, ename, sal, empno ename, empno & sal, ename & sal
-
How to set up a PPPoE connection?
I want to know if anyone knows how to set up a PPPoE with Windows Vista Home Premium. I have Comcast as a provider of services and I am already able to go online with the wireless router, but I put it in place as a dynamic connection instead of a PPPoE connection. When I go to the web page of the router to try to set up as a PPPoE connection, it cannot connect to the internet.
I want to know if anyone knows how to set up a PPPoE with Windows Vista Home Premium. I have Comcast as a provider of services and I am already able to go online with the wireless router, but I put it in place as a dynamic connection instead of a PPPoE connection. When I go to the web page of the router to try to set up as a PPPoE connection, it cannot connect to the internet.
Found this link for you. I don't know if it applies to you or not. So don't blame me.
http://www.FSR.com/pages/support.asp?Itemid=211
t-4-2
-
How to set up the Office remotely between two pc in different countries
Hi, I just want to know how to use Remote Desktop between PC Windows 7 in different countries...
I just tried Windows remote assistance but it take too long to set up first help me post the invitation file and the key to past and then I download the file and open it with Windows Remote Assistance and then copy the access code and enter it in the text box vacuum... and blablablabla
I have seen a lot of video on how to set up remote desktop for always as when I want to use remote desktop, just ask the user on the other computer and connect it
How can I do
Thank you* and what is Remote Desktop connection software in windows 7? (next to the Windows Remote Assistance)
looking for helpFirst of all know what version of Windows 7 is running on the computer you want to access remote/control. Go to the Start button and type winver in the search window. Windows will report to the version in a pop-up window on your desktop.
***********************************
Assuming that the computer is running Windows 7 Ultimate or Pro...
The main steps are...
- Activate [DRC] Remote Desktop on Windows 7 Ultimate DRC PC host.
- If the login ID DRC on the Windows 7 Ultimate DRC host PC is not an administrator, and then add the user to the remote desktop users group. Don't forget the DRC connection user ID are local on the host Windows 7 Ultimate DRC PC not the DRC PC client.
- Make sure that there is an exception in the Windows Firewall, or any third-party firewall on the Windows 7 Ultimate DRC host PC.
- If the host Windows 7 Ultimate DRC PC is behind a router make sure that TCP Port 3389 is transferred to the LAN IP (static is preferable) of Windows 7 Ultimate DRC host PC.
You can test TCP Port 3389 port through your router forwarding by going to the http://www.canyouseeme.org test site. For help setting up through any router port forwarding, go to the PortForward.com site for help. Ignore references to UDP Port 3389.
http://PortForward.com/English/applications/port_forwarding/Remote_Desktop/Remote_Desktopindex.htm
Test call Windows 7 Ultimate DRC host PC from another PC or laptop computer on your local network using its LAN IP address (static is preferable).
http://theillustratednetwork.MVPs.org/RemoteDesktop/TroubleshootingDiagrams/Basic.html
To call from a remote location using the public IP address of the router to the PC host of Windows 7 Ultimate DRC is behind or a full domain name [FQDN] of DynDNS (which I assume that you have already configured).
Its highly recommended that you use Network Level Authentication [KLA] If you connect remotely from a Windows 7, Vista or XP SP3/SP2 client.
http://Windows.Microsoft.com/en-us/Windows7/what-types-of-Remote-Desktop-connections-should-I-allow
http://theillustratednetwork.MVPs.org/RemoteDesktop/RDP6ConfigRecommendations.html#SP3
http://theillustratednetwork.MVPs.org/screenshots/RDC-NLAandServerAuth/host-UseNLA.jpg
Make sure that you use the latest version of the client if your connection from a client computer to Vista or XP SP3/SP2. Windows 7 includes the new RDC client software.
http://support.Microsoft.com/kb/969084
General help written for Vista, but close enough to Win 7...
http://theillustratednetwork.MVPs.org/RemoteDesktop/RDP6ConfigRecommendations.html
MSFT Win 7 DRC help pages...
http://Windows.Microsoft.com/en-us/Windows7/why-can-t-I-connect-using-Remote-Desktop-connection
http://Windows.Microsoft.com/en-us/Windows7/search?q=remote+desktop&PRD=Windows7
***************************************
If the remote computer runs Windows 7 Home Premium...
Windows Live Mesh 2011 remote connections works well for the access/remote control of a computer Windows 7 Home Premium. It gives you a nice Remote Desktop display type of the Office from remote computers.
http://explore.live.com/Windows-Live-2011-system-requirements
You can use a web browser to access without installing any software, other than an ActiveX control, on the remote client or install Live Mesh on the client. Your choice.
http://explore.live.com/Windows-Live-Mesh-Remote-Desktop-using?OS=Mac
http://explore.live.com/Windows-Live-mesh-devices-remote-connections-what-UI
If you use Live Mesh Remote Connections I suggest to create a Live ID limited account type that does not include an e-mail account. I have install a limited Live ID I use only to connect to some Live Mesh remote connections to computers I want / access control.
https://accountservices.passport.NET/ppnetworkhome.SRF?VV=1200&mkt=en-us&LC=1033
You can, if you wish, also use an existing Live ID or create a new, but this is your choice.
I installed Live Mesh 2011 on desktop Win 7 Home Premium to my wife and in distance/access control can it go literally anywhere. Sometimes I use the web based (IE. Method ActiveX) from my laptop on the desk.
Here is an example of a session Windows Live Mesh 2011 remote connections on my laptop computer for access to the / remote control of desktop Win 7 Home Premium to my wife.
Otherwise if you want to remotely control a computer looking Windows Home Edition to TeamViewer (free for personal use) or VNC (my favorite is UltraVNC with its encryption plugin) as the other two alternatives.
-
Dear all,
I have a problem in the dynamic where clause in the OPS.
I have a VO query as below:
SELECT desc, ccuid, containid, XXXTMP conainline
I'll put whereclause as below:
VO.setwhereclause ("containid '101' =" + "order by containline desc")
so the question is request forms as below:
SELECT desc, ccuid, containid, XXXTMP conainline
(where containid = '101' containline desc order) -query gives question, adding the command from the inside of the caliper
Ideally, order by clause should come outside of the Stirrup.
so, how do I do order by clause order side where clasue or how do I remove the stand before the where clause. So I need the query as below:
SELECT desc, ccuid, containid, XXXTMP conainline
(where containid = '101' containline desc order)
SELECT desc, ccuid, containid, conainline from XXXTMP where containid = '101' containline desc order
or
SELECT desc, ccuid, containid, XXXTMP conainline
(where containid = '101') order by containline desc
Thank you
Hello
Solution 1-
You can use "setOrderByClause (containline desc);" so that it will get out of Where clause.
Solution 2-
Instead of dynamically add Whereclause, you can bind the variable as below-
Query in VO-
SELECT desc, ccuid, containid, conainline from XXXTMP where containid =: 1 containline desc order
In VOImpl-
public void initQuery (String variable)
{
clearCache();
setMaxFetchSize(-1);
setWhereClause (null);
setWhereClauseParams (null);
setWhereClauseParam (0, variable);
executeQuery();
}
Vall of this VOImpl method, and pass the variable value. It will work according to your requirement.
Thank you
Kone
-
How can I change the language to English
How can I change the language to English
Hi Ben,
Please see change the language setting of your Cloud Creative applications
Hope that helps!
Kind regards
Sheena
Maybe you are looking for
-
My email has been hacked two days ago.
I've followed all the advice on changing password, run anti virus and anti malware scans, but it seems that the same thing happened last night, all this be it on a smaller scale. Is there anything else I can do?
-
I tried to go to windows update but redirected to micrsoft support page, which offers no SP2 and SP3 for windows XP Pro, and yet I don't have a network of computers running windows XP Pro download the SPs would be a disater as it is intended for more
-
What happens if I install a new windows on a computer product key OEM windows laptop?
I bought a laptop in 2009 with Windows Vista Home Basic OEM on it (I still have the sticker of the portable product key). This year, I bought a larger capacity HARD drive and installed on my laptop. I thought it was the perfect time to upgrade to Win
-
Who should be subjected to the App world, Simulator or device?
Hello I use the SDK of webworks for BB10 command-line to package and sign my apps. I found 2 subfolders named "Simulator" and "peripheral" generated. My first question is what should I submit the .bar file in the subfolder "peripheral" in appworld? I
-
Question about to leave apps and cleaning
When my application leave what are the things I need to do for cleaning? I come from a background of windows so I do not know whatJava and BB only. What I must put an end to all the listeners, I put up?Do I have to remove things like fieldManagers or