Note: You can view the full content of our pages on any browser or Internet device. However, our pages look best in browsers that support Web Standards.

Oracle Web Application Programming for PL/SQL Developers

Solutions Specification for search_student

Description: Create a PSP that paints a search screen for choosing a student. Name this PSP Search_Student.psp. The PSP should be created with the following requirements.

1. There should be one text-inputtable field for last_name and one for first_name. HINT: To make this search as useful as possible, it should allow a user to enter a partial search. You'll need a pattern-matching approach in order to be able to accomplish this task. Also, be sure to make the search case-INsensitive.

2. Feel free to retrieve all results when a user simply doesn't enter any data in either of the two text fields. Search_Student.psp should merely be created as a form where you collect any information entered by a user to then be passed to another PSP.

3. Be sure to include a method for gracefully handling PL/SQL errors.  Create a PSP called Search_Student_Error.psp. This error page must be specified in the errorPage attribute of your page directive.

Sample Screen

search_student.gif

Sample Code

<%@ page language="PL/SQL" errorPage="search_student_error.psp" %>
<%@ plsql procedure="search_student" %>
<%
--------------------------------------------------------
-- FILENAME:    search_student
-- FILEDATE:    02.02.2002
-- CREATED BY:  Melanie Caffrey
-- DESCRIPTION: Search Student
-- URL :        http://localhost/pls/any/search_student 
--------------------------------------------------------
%>
<HTML>
<HEAD>
<TITLE>Search Student</TITLE> 
</HEAD>
<BODY BGCOLOR="#99CCCC">
<P></P>
<H2 ALIGN=center>Please enter your Student/Instructor Search criteria.</H2>
<P></P>
<FORM METHOD="post" ACTION="get_student" NAME="student_search">
<TABLE BORDER=0>
<TR>
<TD ALIGN="right"><FONT FACE="Arial">First Name</FONT></TD>
<TD>
<INPUT TYPE="text" NAME="p_first_name" SIZE="30" >
</TD>
</TR>
<TR>
<TD ALIGN="right"><FONT FACE="Arial">Last Name</FONT></TD>
<TD>
<INPUT TYPE="text" NAME="p_last_name" SIZE="30" >
</TD>
</TR>
<TR>
<TD></TD>
<TD ALIGN="left"><INPUT TYPE="submit" VALUE="Search"> <INPUT 
TYPE="reset" VALUE="Reset">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
********************************************************

<%@ page language="PL/SQL" %>
<%@ plsql procedure="search_student_error" %>
<HTML>
<HEAD>
<TITLE>Error in Search Student Procedure</TITLE>
</HEAD>
<BODY>
<H2>The following error has occurred: </H2>
<P><FONT FACE="Arial">
<%= SQLERRM %>
</FONT></P>
</BODY>
</HTML>

Select a Sample Application Code Unit

  1. main_frame (15.2)
  2. top_menu (13.3) / (15.2)
  3. splash (13.1)
  4. student_main_frame (6.3)
  5. students_left_nav (6.3)
  6. search_student (12.4)
  7. get_student (12.4)
  8. student_list (12.4)
  9. student_personal_info (12.4)
  10. student_zipcode (18.5)
  11. update_student (18.5)
  12. instruct (Package Spec and Body)
    • grade_calc (9.2)
    • v_font (9.4)
    • c_instruct_list (9.4)
    • inst_tbl_type (9.4)
    • instruct_table (9.4)
    • [PL/SQL block to load instruct_table] (9.4)
    • instruct_personal_info (11.3)
    • instructor_list_info (11.3)
    • showzip (11.3)
    • instructors_frame (11.1)
    • instructors_left_nav (11.1)
    • update_instructor (11.2)
    • instructor_list_class (11.3)
    • instruct_classes (11.3)
    • student_list (11.2)
  13. classes_main_frame (6.3)
  14. classes_left_nav (6, Building App)
  15. classes_list (6, Building App)
  16. classes_location (13.4)
  17. classes_location_update (13.4)
  18. set_cookie (15.2)
  19. get_cookie (15.2)
  20. cookie_exists (15.2)
  21. visitor_name (15.2)
  22. process_visitor_name (15.2)
  23. student_list_update (not in book)

Main Solutions Page