Use wwv_searchdb.search within PL/SQL portlet
The standard search API procedure wwsbr_search.submit_search redirects to the standard Result page (or another defined). In order to find out if it is possible show the results within a portlet (like the Custom Search Portlet does) I found the procedure wwv_searchdb.search. How can I use this procedure?
You are correct in saying that the wwsbr_search.submit_search redirects to the selected results page (as specified in the global search settings). However that results page must have a custom search portlet on it in order to actually run the search. When we redirect to the results page, the portlet on that page takes the parameters from the URL and runs the search and displays the results. Therefore the results are being displayed within the portlet on the results page.
The wwv_searchdb.search method is the entry point to the search engine. This will execute the search determined by the parameters and return the results. However from the results, i dont think there are many public APIs for you to get the information on the results which you would need.
Similar Messages
-
Using OS Commands within PL/SQL
How can I use Operating system commands from within PL/SQL procedures or functions? Kindly explain with an example.
Thanx,
SBPreviously we have used external procedures to use Windows kernel32.dll to start an external program. However this does not work on Oracle9i.
Instead I have modified an example in Java to acceive this. The following class can start an external program either synchronously or asynchronously and in synchronous mode it will return the programs output.
import java.io.*;
import java.util.*;
public class util
// Executes an operating system command. The command shall be fully qualified.
// The Java connects with silent login. No environment set-up files are run
// and no path is set. The mode can be "sync" or "async" for respectively
// synchronous and asynchronous execution
static public int OSCmd(String cmd, String mode, String[] output)
throws IOException, InterruptedException
System.out.println("OSCmd "+cmd+" ("+mode+")");
output[0]="";
// start command
Process proc = Runtime.getRuntime().exec(cmd);
if (mode.equals("sync"))
// get command's stdout and stderr
InputStream stdout = proc.getInputStream();
InputStream stderr = proc.getErrorStream();
String str;
// Stdout
BufferedReader br = new BufferedReader(new InputStreamReader(stdout));
while ((str = br.readLine()) != null)
output[0]+=str+"\n";
br.close();
// Stderr
br = new BufferedReader(new InputStreamReader(stderr));
while ((str = br.readLine()) != null)
output[0]+=str+"\n";
br.close();
// wait for command to terminate
proc.waitFor();
return proc.exitValue();
return 0;
You need the following permissions:
call dbms_java.grant_permission('COMMON', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute');
call dbms_java.grant_permission('COMMON', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
call dbms_java.grant_permission('COMMON', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
And then create the Java stored procedure:
create or replace function os_cmd2(p_cmd varchar2, p_mode varchar2, p_output in out varchar2) return number
as language java
name 'util.OSCmd(java.lang.String, java.lang.String, java.lang.String[]) return int'; -
How do I use a variable within a sql statement
I am trying to use a local variable within an open SQL step but I keep getting an error.
My sql command looks like this "SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " + locals.CurrentSerialNo
If I replace the locals.CurrentSerialNo with an actual value such as below the statement works fine.
"SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " + " 'ABC001' "
Can someone tell me how to correctly format the statement to use a variable?Hi,
Thanks for the reply. I have changed the required variable to a string, but with no success. I have reattached my updated sequence file and an image of the error.
When looking at the Data operation step I see that the sql statement is missing everything after the last quotation mark.
Thanks again,
Stuart
Attachments:
Database Test Sequence.seq 10 KB
TestStand error.JPG 37 KB -
Help with search within pl/sql code
Hi All,
Can you please help me to find all the objects with a database link.
I have some procedures,function and packages which uses database link. I need to fetch all the objects that uses a database link. Is there any way to get the list of object names using any database link?
Thanks in advance
Apppreciate your help!
Thanks
Bobhi there,
the problem with dba_source is that the code might be wrapped.
another possibility is to query dba_dependencies, column referenced_link
Also you can have pl/sql routines that create dynamically code and might use dblinks in their dynamic code.
So you might not be able to be 100 percent complete.
HTH Mathias -
Using 'NOT IN' Within a SQL Statement
Does anyone know why the following SQL statement does not return any values? The problem is with the SELECT statement within the 'NOT IN' clause. When explicitly typing in the part_ids returned from the select statement, everything works as expected.
Thanks for any help.
SELECT Distinct Part_Id, Trans_Date
FROM Invctrl
WHERE Trans_Type = 0
AND Trans_Date BETWEEN To_Date( '1-Mar-2006 00:00:00', 'dd-mon-yyyy hh24:mi:ss' )
AND To_Date( '31-Jan-2007 23:59:59', 'dd-mon-yyyy hh24:mi:ss' )
AND Part_Id NOT IN (SELECT part_Id From InvCtrl WHERE Trans_Date < To_Date( '1-Mar-2006 00:00:00', 'dd-mon-yyyy hh24:mi:ss'))'NOT IN' should be avoided where ever we can.
Change your query to 'IN' clause as below and it should work.
SELECT DISTINCT part_id, trans_date
FROM invctrl
WHERE trans_type = 0
AND trans_date BETWEEN TO_DATE ('1-Mar-2006 00:00:00',
'dd-mon-yyyy hh24:mi:ss'
AND TO_DATE ('31-Jan-2007 23:59:59',
'dd-mon-yyyy hh24:mi:ss'
AND part_id IN (
SELECT part_id
FROM invctrl
WHERE trans_date BETWEEN TO_DATE ('1-Mar-2006 00:00:00',
'dd-mon-yyyy hh24:mi:ss'
AND TO_DATE ('31-Jan-2007 23:59:59',
'dd-mon-yyyy hh24:mi:ss'
MINUS
SELECT part_id
FROM invctrl
WHERE trans_date <
TO_DATE ('1-Mar-2006 00:00:00',
'dd-mon-yyyy hh24:mi:ss'
[pre] -
Using accept command within PL/SQL block
Hi all i have a following Pl/SQL block which ia =as follows :-
declare
begin
...certain statements using while
end;
i need to take the user input using accept
if i put the accept stmt betweeen begin and end i am getting following error :-
accept myv number default 10 prompt 'Enter a number: '
ERROR at line 48:
ORA-06550: line 48, column 8:
PLS-00103: Encountered the symbol "MYV" when expecting one of the following:
:= . ( @ % ;
ORA-06550: line 48, column 30:
PLS-00103: Encountered the symbol "PROMPT" when expecting one of the following:
* & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
between || multiset member SUBMULTISET_
Let me know how can i include accept stmt in Pl/SQL block
ThanksYou're missing a fundamental concept here.
PL/SQL = embedded 4GL programming language in the Oracle database.
SQL*Plus = CLI (Command Line Interface) client for an Oracle database.
The ACCEPT command is a SQL*Plus command. Not a PL/SQL command.
The PL/SQL engine sits inside the Oracle Server Process that services your client (SQL*Plus) session. That server process does not know who/what/where you are as a physical client. It does not know what platform and o/s you are using. It does not know what client you are using. It is after all a server process and should not and need not to know that.
Nor can that Oracle Server Process running on the Data Server Platform access you client's hard drive, keyboard, mouse, screen, printer and so on.
PL/SQL running in this Oracle Server Process therefore cannot read your keyboard to accept end-user input. PL/SQL therefore cannot write data to your screen.
You need to make a clear distinction between SQL*Plus (a client) and Oracle PL/SQL (the server). -
Is it possible to use ESI within pl/sql portlets?
The idea being to only re-execute the query and redraw the resulting HTML rather than re-load the whole portlet.
Any ideas ?Not sure. I'll look into it. In the meantime, you may get a faster response if you repost your question to the Portal Caching forum. A lot more Portal expertise there.
-
Spatial search within distance error
I am using the search within query and am getting an error, can anyone help me with the solution to this error
the error is :
ORA-29902: error in executing ODCIIndexStart() routine
the select query for within distance is :
select a.name,a.mcid,a.geoloc.sdo_point.x,a.geoloc.sdo_point.y
from Restaurants a
where mdsys.locator_within_distance(
a.geoloc,
mdsys.sdo_geometry (2001, null,
mdsys.SDO_POINT_TYPE (77.578159, 12.99836,null), null, null), 'distance=1 Unit=mile layer_gtype=POINT') = 'TRUE'There are a lot of possibilities here. If the restaurants table has an SDO_SRID set and the point you are comparing it to doesn't this is a possible cause.
What version of Oracle Spatial are you using? -
How to use Custom Search in Dynamic Page or HTML Portlet ?
Gurus,
1. I have a tab called My Space in the portal web site, where user gets a personalized view of the content.
2. I am using custom attributes and custom item types. I have a custom attribute called 'Location', which is a attribute of custom item types.
3. I have 2 pages - News and Events.
4. All the content in News and Events page is tagged by the attribute 'Location'.
5. The requirement is to let the user search the News and Events by Location.
6. To achieve this I used the Custom Search portlet and the user can select the attribute Location and see the resultant News and Event items by location in the Search portlet.
7. The requirement is to present the News items and Event items in separate regions on the page and show only the first 5 News and Event items in the result and show a More link which would guide the user to rest of the News and Event items.
8. Eventually there may be more content other than News and Events tagged by location. If so, the requirement is to create a new region and display the new content.
9. How would I do this using custom search ? I was thinking if there is anyway I could use the custom search api (where can i find it ?) in the HTML portlet or Dynamic page and submit the result to IFRAMES in each region and show the output ?
Pls advise.
Thanx a bunch.I would suggest that you use two custom search portlets; one for the news items and one for the events items. Switch the custom search portlets to "AutoQuery" mode and add the relevant criteria. On the results display tab of the the "edit defaults" screen, choose to show just 5 items.
To add a link to show the user mode results, I'd create two new pages that have just a single custom search portlet on it that is customised to show more of the results and maybe has the pagination links enabled.
Then I'd add two "Page Link" items underneath the two news and events portlets on the first page in an item region.
I'm sure there are other ways of doing this as well. Hope that helps to get you started. -
How do i do an advanced search when using adobe reader within a firefox window?
i used to be able to do an advanced search within a firefox tab, but when i updated firefox to version 33.0 from version 17.x, the interface changed and i can't figure out how to do it, any longer.
eventually, i figured out that a simple search can be done with control-F, but i'd like to get the advanced search panel.
when i use internet explorer, it has an icon of binoculars that will open advanced search. firefox does not have this.Advanced Search relies on the use of a Catlog index built by the Acrobat search engine.
The browser add-ons cannot access the Catalog index.
Advance Search via Catalog indexes of network based PDF collections is possible.
Be well... -
SQL error for searches within Arch forums
Hi guys,
Since last night, when ever I try to run a search, whether it be a pre-defined search like New Posts or last 12h, or a keyword search within the search page, I get an error:
Could not delete old search id sessions
DEBUG MODE
SQL Error : 1016 Can't open file: 'phpbb_search_results.MYI' (errno: 145)
DELETE FROM phpbb_search_results WHERE session_id NOT IN ('b8a882a76bd524ca2cae00763907813a', 'ff63868080729e0ee81c83f1e2b08fac', '153ae6e2b7dfa3b1acab764caf6251a9', '61230f3df774fc9e05bbd91b9de8ab6a', 'ebea35cab271f97e47a0edeb867f350b', '852bae4b6e661b50c6e656eacab5204f', '874a6ac043dfb52bd2162d92f3700b28',
... (goes on for ages) ...
'eb520a66784db4079cf64fbf16316d65', '9f2f2ebe525f98222e32c1cefffd7ea1')
Line : 663
File : search.php
This is rather annoying as I can't look for the latest posts easily.There's already a discussion about it here:
http://bbs.archlinux.org/viewtopic.php?t=17004
Locking to keep continuity. -
Is there any way to use Quickview from within Spotlight search results?
I'm sure this has been answered previously, but my searches came up empty....
Is there any way to use Quickview from within Spotlight search results? I'd like to be able to do a Spotlight search and hit the space bar for a quick Quickview look before actually launching the program. I'm guessing this isn't possible, but thought I'd ask...Thanks, Kappy.
Duh...I meant Quick Look. Sorry about that.
In any event, pressing the space bar in Spotlight just puts a space in the Spotlight search box - it doesn't open a Quick view of the highlighted item... -
Parameter to search within a field
Post Author: hd1
CA Forum: Crystal Reports
Hello,
I have a report that is connected to SQL database. I was wondering if there was a way to create a parameter to search within a specific field in my database table. The scenario is we have Paralegals and Attorneys who have created a huge Word document that has a table in it. They have 8 fields in this table and one field in particular is their summary field. This field can go up to over 1000 characters. So, we decided to create a SQL database and have them import their data from a Data Access Page using Microsoft Access, then we run a Crystal Report for them. So far it looks good and it's working great. We can import there current data without any problems. The problem that I have run into is the way they search for specific entries. I was wondering if I could create a parameter in the report to search within the summary field. Again these summary fields can be from one sentance to multiple paragraphs. I would like to be able to get this going for them, it will make things a lot easier on them. An example would be. We have multiple entries in this field.
This is a test entry done 11/27/07
This is a test entry done 12/3/07
This is a test import using DTS done 12/3/07.
Now it would be nice if the users could put in the word 'DTS' in the parameter and it would only show entries containing DTS. Do you think this is possible.
I ran accross a posting by Skodidine and his was something like this.
{table.field} LIKE & "*"
But that was relating to a wild card search. I tried just using {table.field} LIKE but I didn't get any results. This does sound possible though.Post Author: hd1
CA Forum: Crystal Reports
So far this seems to give me some results.
IF {?Summary} = "<none>" THEN TRUE ELSE ({?Summary}) IN LowerCase ({LOEB_Docs.Summary})
I don't know though, If someone has a more reliable and better one could you let me know? I did have to add some words in my parameter, by the looks of it, I will have to do that from now on. So if someone has something better to where I do not have to enter keywords for them, I would appreciate it. This database is going to continue to grow, it's a reference for them so the keywords could be endless. -
SEQUENCE Select within an SQL Query with an ORDER BY statement
Does anyone know why you cannot use an ORDER BY statement within an SQL query when also selecting from a SEQUENCE? My query was selecting production data as a result of a filtered search. I want to take the results of the filtered search and create a transaction. I have a sequence for generating transaction numbers where I select NEXTVAL. Since I could possibly obtain multiple, yet distinct, rows based upon my search criteria, I wanted to use an ORDER BY statement to simplify and order the resulting row(s).
I was able to get the SQL select with SEQUENCE.NEXTVAL to work without the ORDER BY, so I know that my SQL is correct. Thanks in-advance.Okay,
I understand. You want the sequence assigned first and the you want to ORDER BY. You
can do this using pipelined functions. See here:
CREATE OR REPLACE TYPE emp_rec_seq AS OBJECT (
seq NUMBER,
ename VARCHAR2 (20),
job VARCHAR2 (20),
sal NUMBER
CREATE OR REPLACE TYPE emp_tab_seq AS TABLE OF emp_rec_seq;
CREATE OR REPLACE FUNCTION get_emp_with_sequence
RETURN emp_tab_seq PIPELINED
IS
my_record emp_rec_seq := emp_rec_seq (NULL, NULL, NULL, NULL);
BEGIN
FOR c IN (SELECT dummy.NEXTVAL seq, ename, job, sal
FROM emp)
LOOP
my_record.seq := c.seq;
my_record.ename := c.ename;
my_record.job := c.job;
my_record.sal := c.sal;
PIPE ROW (my_record);
END LOOP;
RETURN;
END get_emp_with_sequence;after that, you can do a select like this:
SELECT seq, ename, job, sal
FROM TABLE (get_emp_with_sequence)
order by enamewhich will get you this:
SEQ ENAME JOB SAL
1053 BLAKE MANAGER 2850
1054 CLARK MANAGER 2450
1057 FORD ANALYST 3000
1062 JAMES CLERK 950
1055 JONES MANAGER 2975
1052 KING MANAGER 20000
1060 MARTIN SALESMAN 1250
1063 MILLER CLERK 1300
1064 DKUBICEK MANAGER 12000
1056 SCOTT ANALYST 3000
1058 SMITH CLERK 800
1061 TURNER SALESMAN 1500
1059 WARD SALESMAN 1250Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
MySQL functionality within Oracle SQL Developer Data Modeler
Hi all,
I've read a few forum posts here that lead me to believe that MySQL is not currently supported by the data modeler tool (Link #1 I got to by clicking on the Statement Of Direction link on the main page SQL Developer Data Modeler</title><meta name="Title" content="SQL Developer Data Modeler"&g… Link #2 I got to by doing a search on the word MySQL within the forum search):
Link 1:
SQL Developer Data Modeler Statement of Direction
Link 2:
Can datamodeler be used with MySQL?
SQL Developer (not the Data Modeler tool, but the database admin-type tool not for modeling) does support MySQL using the latest MySQL Connector J 5.1 driver but, strangely, it doesn't seem the Data Modeler supports it, though. Can anyone please confirm that MySQL is currently unsupported for the Data Modeler tool? Thanks in advance.Hi,
it doesn't seem the Data Modeler supports it, though.
Data Modeler doesn't have specific support for MySQL - i.e you cannot generate DDL for MySQL. Though you can import form MySQL server using JDBC connection in standalone DM or using created MySQL connection if you are using DM inside SQL Developer.
You can import definitions for tables(columns, PK and UK constraints, indexes, foreign keys) and views.
Philip
Maybe you are looking for
-
Double click on icon to run java application
Hello, I want to write a code in java so that if i double click on icon the program will start showing the window as it appears when we double click acrobat and the we get the main screen. How this can be achieved? Thank you
-
For some reason, the down and right keys aren't working. They work fine in other programs but in this program they fail. What's going on? paddle_ybase = paddle._yscale; paddleSpeed = 0; onEnterFrame = function(){ if(Key.isDown(Key.UP)){paddleA._y -=
-
Video Format when Creating New Project
I'm using iMovie HD v. 6.0.3 and I'm wondering, when I first start the movie creation process in iMovie, which video format do I want to choose? DV, DV Widescreen, HD 1080i, HDV 720p, MPEG-4, or iSight? I will be exporting it to iDVD to burn the fina
-
Messgae Tracking, C350, AsyncOS.6.3.5-003
Hi IronPort Nation, in message Tracking I can configure a search for example to look up envelope sender with keywords "Begins With", "Contains" and "ls". What means "ls"? Can anyone explain the keyword "ls"? With Regards, jpk
-
Is there a compressed version of the "Oracle by Example" Tutorials for downloading? Thanks you for your help