Creating a search form on apex
I have created a form to search the database. I want it to only return the rows that are specifically part of the search critera. "it continues to return all rows in the database'
Hello,
What's the WHERE clause of your SELECT? Probably there's something wrong there or you lose the session state of your search item.
Regards,
Dimitri
-- http://dgielis.blogspot.com/
-- http://www.apex-evangelists.com/
-- http://www.apexblogs.info/
Similar Messages
-
Creating a search form based on a table.
Hello,
I'm currently trying to create a search form which performs a searchquery in values stored in a table in my database.
The table is filled peoples names,lastnames ,telephonenumbers and departments.
I can use the sample application to make a form based on the tableview but this returns a search textfield for every column in the table. I just want 1 searchfield/textfield to search on ALL columns at the same time and display the other fields as labels when returning the queryresults.
I tried searching the forums for an explanation on how to build said form and I checked Metalink but I have yet to find one. Anyone out there willing to help me out?
thanks in advance,
Melvin K.Why not use an instr with your data in a bind variable in your where clause for the select?? Page 1 sets an item called P2_Parameter with your value string slightly modified ('12345','345632','645534534','3434344')
Select a,b,c,d,e from some_table where INSTR(TO_CHAR(Lookup_column,'099999999'),:P2_Parameter)
Maybe that will work? Its off the top of my head, but should get you what you want.. (But to agree with one of the other posters, it is a BAD Design..) I would try like an interactive report to allow them to enter in acct #'s or whatever these are and let them access the rows that way..
Thank you,
Tony Miller
Webster, TX -
Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.
Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.
-
Creating a Search form for Captivate courses
I've been asked to create a search form for our online courses. We do not use the TOC in our courses so the Find field in the TOC is not an option. Here are the ideas I've had so far:
a Javascript-powered form search
a search form widget
a Google search embedded into the surrounding HTML page (But I don't think that Google can "see" text inside the Captivate SWF object...)
Right now, we are using Captivate 5.5, but do plan to move to Captivate 6.0 fairly soon. I'm grateful for any ideas.
Thanks!
PeterYou're hitting a bug. See ADF Faces Classical Search Form works only with Entity base VO in JDev 11? for a workaround suggestion.
-
Query for create manual tabular form using apex collection add row button functionality
Hello everyone
My requirement is i created a tabular form manually using apex collection but if i click on add row button then previously selected data refreshed and added new row in this form it is fine.but i don't want to refreshed previously selected data and click on add row button then add new row .how it is possible? plz help
Thanks & Regards,
UjwalaUjwala
Instead of starting a new thread with the same question as Query for create manual tabular form using apex collection add row button functionality.
Could you answer the question about what you see while debug the javascript code.
If you don't understand the question or have trouble debug javascript let us know.
Nicolette -
How to create a search form? - Jdev TP4 11.1.1.0.0
Hi,
I am using Jdev TP4 11.1.1.0.0.
I have a af:table which is based on a view. I want to have a search form on top of this af:table to query based on the selection in the search form. I have 15 columns in the view. When I drag and drop the "All queriable attributes" from the named criteria I get all these columns in the search form. I need only 3 of the columns in the search form and the af:table should query based on the selection. How can I achieve this? Any help. Thanks in advance.You can create a new named query with only these three columns in the where clause and use that.
Or you can drag the VO as a search form and remove the columns you don't need. -
How To create ADF Search form in JDeveloper 11g 11.1.1.0.1
Hi,
I am using JDeveloper 11g 11.1.1.0.1 , in which i tried creating an ADF search form that has Find and Execute Buttons.
I created the same ADF search form using JDeveloper 11g TP3 and TP4 wherein it works fine but not in JDeveloper 11g 11.1.1.0.1.
Scenario....
I dragged a read only view object on to the jspx page as ADF Search Form and dragged the same as Read only table.
After doing this if i run the application the search functionality does not happen .
( I click on the find button and enter the condition and then click on the execute button. records does not get filtered based on that condition specified.)
But when the same steps is done in 11g TP3 and TP4 the search functionalty works fine.
Can someone suggest me what is the issue.
Is this a bug in the new release.
regards
vinithareply is in this id
ADF Searchform with find and execute buttons in JDev 11.1.1.0.1 studio edi. -
Firefox sync creates duplicate search/form history results
I have Firefox synced on 3 PCs and a laptop. Some of the sites I visit, sync creates multiple duplicates in form/search boxes. Two that I know of for sure are outlook/hotmail (the box you enter your e-mail address) and my bank website (where I enter my account name). For example, I would see 2 or 3 options to select the same e-mail address in the dropdown history box. If I go to delete all but one of them, it disappears completely the next time so I have zero options.
This also only happens on some of my computers. Some of them only have one option (which is how it should be).
Minor issue, but it's kind of bothersome.I don't use any sync add ons. The add ons I use are flash video downloader and custom new tab.
The duplicates are only on my 'other' devices, not my main device (the one I use the most and the one I created my sync account on). I'll have to wait until I get time to go on my other devices to take a screenshot. For now, this is what I mean. Here is the outlook/hotmail sign in page:
http://www.icts.canterbury.ac.nz/graphics/outlook.com%20login%20screen.JPG
When I press the down arrow in the account name box, I see 2-3 entries of the same e-mail address. Again, on my main PC, I would only see one entry of my e-mail address (like I should). This also happens on my bank website.
When I try to delete the duplicates and only keep one entry, the next time I visit the page, they're all gone. So it seems like there's some bug in the search/form history sync. -
Declare @p1 variable error when creating multiple search form to show database info
Hi, all help is incredibly appreciated,
i have been trying to make a multiple filtered search form for a database in asp / vbscript. I want to be able to select from THIS database table, all info on the rows which id is BETWEEN x and x AND date is BETWEEN x and x AND securitynumber is BETWEEN x and x
what would be the best way to do this?
this is what ive got so far, which gives me the error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@P1'.
<%
Dim rsBundleR__p_selectedDB
rsBundleR__p_selectedDB = request.form("selectedDataBase")
If (request.form("selectedDataBase") <> "") Then
rsBundleR__p_selectedDB = request.form("selectedDataBase")
End If
%>
<%
Dim rsBundleR__p_idFrom
rsBundleR__p_idFrom = request.form("bundleIdFrom")
If (request.form("bundleIdFrom") <> "") Then
rsBundleR__p_idFrom = request.form("bundleIdFrom")
End If
%>
<%
Dim rsBundleR__p_idTo
rsBundleR__p_idTo = request.form("bundleIdTo")
If (request.form("bundleIdTo") <> "") Then
rsBundleR__p_idTo = request.form("bundleIdTo")
End If
%>
<%
Dim rsBundleR__p_dateFrom
rsBundleR__p_dateFrom = request.form("fromDate")
If (request.form("fromDate") <> "") Then
rsBundleR__p_dateFrom = request.form("fromDate")
End If
%>
<%
Dim rsBundleR__p_dateTo
rsBundleR__p_dateTo = request.form("toDate")
If (request.form("toDate") <> "") Then
rsBundleR__p_dateTo = request.form("toDate")
End If
%>
<%
Dim rsBundleR__p_ssFrom
rsBundleR__p_ssFrom = request.form("fromSS")
If (request.form("fromSS") <> "") Then
rsBundleR__p_ssFrom = request.form("fromSS")
End If
%>
<%
Dim rsBundleR__p_ssTo
rsBundleR__p_ssTo = request.form("toSS")
If (request.form("toSS") <> "") Then
rsBundleR__p_ssTo = request.form("toSS")
End If
%>
<%
Dim rsBundleR
Dim rsBundleR_cmd
Dim rsBundleR_numRows
Set rsBundleR_cmd = Server.CreateObject ("ADODB.Command")
rsBundleR_cmd.ActiveConnection = MM_PHPSQL_STRING
rsBundleR_cmd.CommandText = "SELECT * FROM ? WHERE id BETWEEN ? AND ? AND fecha_solicitado BETWEEN ? AND ? AND seguro_social BETWEEN ? AND ? ORDER BY id ASC"
rsBundleR_cmd.Prepared = true
rsBundleR_cmd.Parameters.Append rsBundleR_cmd.CreateParameter("param1", 200, 1, 255, rsBundleR__p_selectedDB) ' adVarChar
rsBundleR_cmd.Parameters.Append rsBundleR_cmd.CreateParameter("param2", 5, 1, -1, rsBundleR__p_idFrom) ' adDouble
rsBundleR_cmd.Parameters.Append rsBundleR_cmd.CreateParameter("param3", 5, 1, -1, rsBundleR__p_idTo) ' adDouble
rsBundleR_cmd.Parameters.Append rsBundleR_cmd.CreateParameter("param4", 135, 1, -1, rsBundleR__p_dateFrom) ' adDBTimeStamp
rsBundleR_cmd.Parameters.Append rsBundleR_cmd.CreateParameter("param5", 135, 1, -1, rsBundleR__p_dateTo) ' adDBTimeStamp
rsBundleR_cmd.Parameters.Append rsBundleR_cmd.CreateParameter("param6", 200, 1, 255, rsBundleR__p_ssFrom) ' adVarChar
rsBundleR_cmd.Parameters.Append rsBundleR_cmd.CreateParameter("param7", 200, 1, 255, rsBundleR__p_ssTo) ' adVarChar
Set rsBundleR = rsBundleR_cmd.Execute
rsBundleR_numRows = 0
%>
someone, please help, this is very important!allright i think thats what i did here:
<% While ((Repeat1__numRows <> 0) AND (NOT rsBundleR.EOF)) %>
<table align="center" border="1">
<tr>
<td align="left" width="50%">id</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("id").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">seguro_social</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("seguro_social").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">numero_estudiante</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("numero_estudiante").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">nombre</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("nombre").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">apellido</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("apellido").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">telefono</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("telefono").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">celular</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("celular").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_postal</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_postal").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_postal_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_postal_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">email_pupr</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("email_pupr").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">ciudad</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("ciudad").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">estado</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("estado").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">zona_postal</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("zona_postal").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_fisica</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_fisica").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_fisica_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_fisica_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">email_personal</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("email_personal").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">ciudad_fisica</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("ciudad_fisica").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">estado_fisica</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("estado_fisica").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">zona_postal_fisica</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("zona_postal_fisica").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">tipo_estudiante</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("tipo_estudiante").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">termino_prestamo</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("termino_prestamo").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">nombre_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("nombre_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">apellido_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("apellido_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">telefono_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("telefono_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_postal_1_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_postal_1_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_postal_2_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_postal_2_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">ciudad_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("ciudad_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">estado_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("estado_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">zona_postal_referencia_1</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("zona_postal_referencia_1").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">nombre_referencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("nombre_referencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">apllido_refencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("apllido_refencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">telefono_referencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("telefono_referencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_postal_1_referencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_postal_1_referencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">direccion_postal_2_referencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("direccion_postal_2_referencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">ciudad_referencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("ciudad_referencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">estado_referencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("estado_referencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">zona_postal_referencia_2</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("zona_postal_referencia_2").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">tipo_de_prestamo</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("tipo_de_prestamo").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">cantidad_prestamo</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("cantidad_prestamo").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">subsidiado</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("subsidiado").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">no_subsidiado</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("no_subsidiado").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">autorizo_pupr</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("autorizo_pupr").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">fecha_solicitado</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("fecha_solicitado").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">estatus</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("estatus").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">revisado_por</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("revisado_por").Value)%></td>
</tr>
<tr>
<td align="left" width="50%">nota_personal</td>
<td align="left" width="50%"><%=(rsBundleR.Fields.Item("nota_personal").Value)%></td>
</tr>
</table>
<br /><br />
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsBundleR.MoveNext()
Wend
%>
, no error is given BUT still, no information is showing.
However, i dont see the "." either :/
I made it create a table for each record,
is it the way i called the information?
or is the query not finding anything?
( there is information in the database ) -
Create simple database form in APEX
I'm trying to create a simple form off of a database table or query.
After going through the wizard, the form does not bring back any data.
I see it created a process Before Header: Fetch Row from table_name, but that doesnt' seem to be happening.
Is there something that has to be set to activate the form to actually query?
Thank you.Hi,
In the form page's "Fetch Row..." and "Process Row..." processes, you can specify two key fields (one "primary" and one "secondary"). As long as the fields you are referencing are a unique combination, this should work ok. Though, ideally, you should create a primary key on all tables.
In both processes, make sure you complete the "...Secondary Key...." settings with the appropriate page item names and table column names. Your form page should also have two "hidden and protected" page items - one for each of the keys - the link from your report should populate both of these.
Andy -
Query for create manual tabular form using apex collection using item textfield with autocomplete
can we create a manual tabular form inside item textfield with autocomplete ?
how it is possible?
with Apex_item API used for this item.
i used this code for creat cascading select list
select seq_id,
APEX_ITEM.SELECT_LIST_FROM_QUERY(
p_idx => 1,
p_value => c001,
p_query => 'SELECT C001 D
, C002 R
FROM APEX_COLLECTIONS
WHERE COLLECTION_NAME = ''col1''',
p_attributes => 'style="width:150px" onchange="f__name(this,parseInt(#ROWNUM#));"',
p_show_null => 'Yes',
p_null_value => null,
p_null_text => '- Select name -',
p_item_id => 'f01_'|| LPAD (ROWNUM, 4, '0'),
p_item_label => 'Label for f01_#ROWNUM#',
p_show_extra => 'NO') name,
APEX_ITEM.SELECT_LIST_FROM_QUERY(
p_idx => 2,
p_value => c002,
p_query => ' SELECT null d, null r FROM dual WHERE 1 = 2
p_attributes => 'style="width:150px"',
p_show_null => 'Yes',
p_null_value => null,
p_null_text => '- Select name -',
p_item_id => 'f02_'|| LPAD (ROWNUM, 4, '0'),
p_item_label => 'Label for f02_#ROWNUM#',
p_show_extra => 'NO')name2,
from apex_collections
where
collection_name = 'COLLECTION1'
It is fine .
but i want item in tabular form textfield with autocomplete and remove select list. my requirement is using textfield with autocomplete select a employee name and second item textfield with autocomplete display dependent perticular employee related multiple task.
how it is created.i have no idea related textfield with autocomplete.Please help me....pt_user1
I understand that the add row button is currently doing a submit.
To not submit the page you need a dynamic action on the page.
Does the javascript function addRow do what you want?
Otherwise have a look at the following two threads Add row in manual tabular form using dynamic action and Accessing Tabular Form & Add Elements to Collection without Page Submit.
You're process could be something like:
Add the new values to the collection using the idea's in the second thread and at the same time add the new row.
And as second action refresh your tabular form.
If you get stuck set up what you have done on apex.oracle.com using the tables from the demo application.
Nicolette -
Hello! everybody.
I want to create a form with search option (i.e. enter id or name and by clicking search i get the result i need).
I need to know the code and where to place the trigger (form level or data block level).
I am using Oracle 9iDS form builder.Hi,
create form form that table where u wanna search record then create control block & create textile with data base item NO yout control block first block on ur form
then wrtite trigger on ur non data base text item which created in control block KEY-NEXT-ITEM & write code
next_block;
execute_query;
then go to next block & open Block Property then add where condition for example
demand_num = :ind_no
after that run ur form then just entry some value in ur non data base text item then presed enter then u see u search that all record ........
Rizwan -
A search form with three search criterias
I want to create a search form in Apex with three text boxes that would let us search with a lastName,firstName or a course Name. So i would have three text box regions where the user can enter any one of the search criterias and get a results
the sql query that does the join is as
select Student.Student_id,
Student.First_NAME,
Student.LAST_NAME,
Student.Email1 as Primaryemail,
Student.Email2 as SecondaryEmail,
Student.Phone1 as MobileNumber,
Student.Phone2 as HomeNumber,
Address.Street1 as Street ,
Address.City as City,
Address.State as State,
Address.ZIP as Zip,
Course.PROVIDER_COURSE_ID as CourseID,
Course.Course_Name as Course,
Course.Credit_Hours as Credit_Hours,
INSTITUTION.Name as InstName
from Student Inner join Address on Student.ADDR_ID = Address.ID
Inner Join Institution on Student.INST_ID = Institution.ID
Inner join Course on Course.INST_ID = Institution.IDand i want to incorporate my query into pl/sql example as below which is provide in apex examples as below where it searches for assignee and status. any ideas guys how i can do this or if there is simpler way to do this where the user can have three text boxes and search with their names or course name etc.
declare
c pls_integer := 0;
l_detail varchar2(4000);
i pls_integer;
l pls_integer;
l_max_rows integer;
begin
l_max_rows := nvl(:P2_ROWS,10);
if :P2_SEARCH is null
and :P2_ASSIGNEE is null
and :P2_STATUS is null then
sys.htp.p('<p>'||
apex_escape.html('Please enter at least one search condition.')||
'</p>');
else
-- PUT YOUR QUERY HERE
for c1 in (
select id, project, task_name, start_date, end_date, status, assigned_to,
cost, budget
from EBA_DEMO_SEARCH_PROJECTS
where ( instr(upper(assigned_to),upper(:P2_ASSIGNEE)) > 0
or :P2_ASSIGNEE is null)
and ( instr(upper(status),upper(:P2_STATUS)) > 0
or :P2_STATUS is null)
and ( instr(upper(project),upper(:P2_SEARCH)) > 0
or instr(upper(task_name),upper(:P2_SEARCH)) > 0
or instr(upper(status),upper(:P2_SEARCH)) > 0
or instr(upper(assigned_to),upper(:P2_SEARCH)) > 0
or :P2_SEARCH is null
loop
c := c + 1;
if c = 1 then
sys.htp.p('<ul class="sSearchResultsReport">');
end if;
sys.htp.p('<li>');
sys.htp.prn('<span class="title">');
-- DEFINE DRILL DOWN LINK HERE
sys.htp.prn('<a href="'
||apex_util.prepare_url('f?p='||:APP_ID||':3:'||:APP_SESSION||
':::3:P3_ID:'||c1.id)||'">');
-- ASSIGN PRIMAY ATTRIBUTE HERE, REFERENCE QUERY COLUMN
l_detail := c1.project;
i := instr(upper(l_detail),upper(:P2_SEARCH));
if i > 0 then
l := length(:P2_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</a></span>');
sys.htp.prn('<span class="description">');
-- ASSIGN SECONDARY ATTRIBUTE HERE, REFERENCE QUERY COLUMN
l_detail := c1.task_name;
i := instr(upper(l_detail),upper(:P2_SEARCH));
if i > 0 then
l := length(:P2_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</span>');
-- DEFINE ADDITIONAL QUERY COLUMNS FOR SEARCH BELOW
sys.htp.p('<span class="type">');
sys.htp.prn('Assigned to: ');
sys.htp.prn(apex_escape.html(c1.assigned_to));
sys.htp.prn('</span>');
-- display additional column detail
sys.htp.p('<br /><span class="type">');
sys.htp.prn('Status: ');
sys.htp.prn(apex_escape.html(c1.status));
sys.htp.prn('</span>');
sys.htp.prn('</li>');
if c = l_max_rows then
exit;
end if;
end loop;
if c > 0 then
sys.htp.p('</ul>');
sys.htp.p('<p>'||c||' results found.</p>');
else
sys.htp.p('<p>No data found matching your search criteria.</p>');
end if;
end if;
end;i tried to change the pl/sql to incorporate it into my apex application but i consistently get an error as pl/sql not defined.
any help or a slight hint is very much appreciated
thanks for looking and taking the time to read it through if u made it this far or even if u made it half wayThanks that worked and i got the procedure inside apex as well now i have to figure out how to make the search condition so that it will look for a like condition as well so the user can enter sam for samuel and still find the users
declare
c pls_integer := 0;
l_detail varchar2(32767);
i pls_integer;
l pls_integer;
l_max_rows integer;
begin
l_max_rows := nvl(:P37_ROWS,10);
if :P37_SEARCH is null
and :P37_FirstName is null
and :P37_LastName is null
and :P37_Course_Name is null
then
sys.htp.p('<p>Please enter at least one search condition.</p>');
else
for c1 in (
select
/* SIMULATE A UNIQUE COLUMN */
Student.Student_id || ',' || Course.Course_id as FAKE_PK,
Student.Student_id ,
Student.First_NAME as FirstName,
Student.LAST_NAME as LastName,
Student.Email1 as Primaryemail,
Student.Email2 as SecondaryEmail,
Student.Phone1 as MobileNumber,
Student.Phone2 as HomeNumber,
Address.Street1 as Street ,
Address.City as City,
Address.State as State,
Address.ZIP as Zip,
Course.PROVIDER_COURSE_ID as CourseID,
Course.Course_Name as Course_Name,
Course.Credit_Hours as Credit_Hours,
INSTITUTION.Name as InstName
from Student left join Address on Student.ADDR_ID = Address.ID
left Join Institution on Student.INST_ID = Institution.ID
left join Course on Course.INST_ID = Institution.ID
where ( instr(upper(First_Name),upper(:P37_FirstName)) > 0
or :P37_FirstName is null)
and
(instr(upper(Last_Name),upper(:P37_LastName)) > 0
or :P37_LastName is null)
and
(instr(upper(Course_Name),upper(:P37_Course)) > 0
or :P37_Course is null)
and (
instr(upper(First_Name),upper(:P37_SEARCH)) > 0
or instr(upper(Last_Name),upper(:P37_SEARCH)) > 0
or instr(upper(Course_Name),upper(:P37_SEARCH)) > 0
or :P37_SEARCH is null
order by Course_Name desc
loop
c := c + 1;
if c = 1 then
sys.htp.p('<ul class="sSearchResultsReport">');
end if;
sys.htp.p('<li>');
l_detail := c1.Course_Name;
i := instr(upper(l_detail),upper(:P37_SEARCH));
if i > 0 then
l := length(:P37_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</a></span>');
sys.htp.prn('<span class="description">');
l_detail := c1.FirstName;
i := instr(upper(l_detail),upper(:P37_SEARCH));
if i > 0 then
l := length(:P37_SEARCH);
l_detail := apex_escape.html(substr(l_detail,1,i-1))||
'<span class="highlight">'||
apex_escape.html(substr(l_detail,i,l))||'</span>'||
apex_escape.html(substr(l_detail,i+l));
end if;
sys.htp.prn(l_detail);
sys.htp.prn('</span>');
sys.htp.prn('<span class="type">Incident: ');
sys.htp.prn(apex_escape.html(c1.FirstName));
sys.htp.prn('</span>');
sys.htp.p('</li>');
if c = l_max_rows then
exit;
end if;
end loop;
if c > 0 then
sys.htp.p('</ul>');
sys.htp.p('<p>'||c||' results found.</p>');
else
sys.htp.p('<p>No search results.</p>');
end if;
end if;
end; Edited by: user13133295 on Jun 4, 2013 1:59 PM -
How to create Pro grammatically Search Form ?
Version 11.1.1.3.0
HI i have a requirement where i cant use the search panel/Af:guery panel or View criteria to create the Search form,
I want simple search on 3 fields and result shld dispaly in table.
How can i do that??
Thanks for helpTwo things:
1. I don't know why you need to have the bean populate the list box -- is it based on other values in the form, requiring a runtime filter? "data" belongs in databases.
If so, I would recommend looking up Cascading List boxes (Shay has a youtube channel with that) and I have a video on that, too.
Secondly, you can have list box on the form that will show the "readable" value to the user that they can select. I have a video on that -- possibly the first video I mentioned, but this one may help too.
http://www.youtube.com/watch?v=ytpLTC5HdvA&feature=plcp
2. To create a view criteria programatically:
In the application module, go to the java tab and create an appmoduleimple class. Create a method that manipulates the view criteria and executes the view object. Then expose that on the application module. On the data control, drag and drop the method onto your form. Choose parameter form.
A form should be created that has the input and button.
3. On the data control, click on the method and under it, select parameter. drag that onto the form. Select listbox when it asks what kind of control you want to create. Then it will display the listbox gui to connect the database table. This will create a listbox on the form that users can then select. You can manipulate the view object (also using view critieria) behind the listbox to filter data based on some value on the form.
I am writing from memory here, so I might have skipped a step.
This may help also: Re: How to filter the list of data
Edited by: Stuart Fleming on Sep 17, 2012 12:04 PM -
I would like to create a search form for my database. I would like to plug a value into a field, and click a search button that finds the record I want and fills in the rest of the fields. If someone can point me to some docs or give me a hint I would appreciate it.
I can create reports and forms of any type, but I can't figure this one out.
Thanks.
BrianI guess you are talking of Parameter forms or Customization forms. You can create a report and use its customization form for conditionally querying your records.
For example ...
If your select statement for the Report is something like this...
select ename,sal from scott.emp where deptno=:department;
(Here :department is the bind variable which will facilitate conditional querying when you run the customization form for that report).
Maybe you are looking for
-
Help setting up Flash Builder 4.5 for PHP
I am looking for a concise set of steps for setting up ALL requirements for running Flash Builder 4.5 for PHP. I have been fighting for three days to get the TestDrive example up and running, with no success. At every step of the way I have encount
-
hi i have a problem with my itunes there's no text on the command bars i want to save my contacts and i cant do it help me please
-
Data Migration for MS SQL Server 7 to Oracle 8.0.l5
I have tried to migrate the DB Structure from MS SQL Server 7 to Oracle 8.0.5 but I am only able to convert the system table of SQL Server 7. I was suggested to user Oracle Migration Workbench 1.2.5.0.0 for this but I can not find a sample version of
-
Alternative to RealPlayer on E71x
Hi, The RealPlayer installed on my E71x other than the fact that movies get stuck all the time, doesn't have fast forward, which becomes really annoying as I stopped watching somthing and then want to continue from the middle or fast forward the piec
-
I don't know why I can't buy an app it always says that I have to change my address and the thing I I can't change my address due to that I have money in my accunt that they won't let me spandet