Do hot alter this password (or your interface will no longer work).
start /home/oracle/oracle/app/oracle/product/7.3.2/ows/admin/owains.sql ;You will see some information about the packages being succesfully created, and then the sql prompt will return. The necessary packages have been loaded.
Supose that Charles the TA has the following
table
defined in his tablespace:
create table WEATHER ( City varchar2(11), Temperature number, Humidity number, Condition varchar2(9) );and suppose that the following insertions have been made into this table:
insert into WEATHER values ('LIMA',45,79,'RAIN');
insert into WEATHER values ('PARIS',81,62,'CLOUDY');
insert into WEATHER values ('ROME',91,85,'SUNNY');
If a procedure called showweather is
defined in his tablespace using the
following PL/SQL code:
create or replace procedure showweather is
ignore boolean;
begin
ignore := owa_util.tablePrint('weather', 'BORDER', OWA_UTIL.HTML_TABLE);
end;
/
Then the URL
http://hops.cs.jhu.edu:8990/cschafer/owa/showweather will run the procedure
showweather, which should display the following table in your
web browser (try it!):| CITY | TEMPERATURE | HUMIDITY | CONDITION |
|---|---|---|---|
| LIMA | 45 | 79 | RAIN |
| PARIS | 81 | 62 | CLOUDY |
| ROME | 91 | 85 | SUNNY |
showweather
procedure in your tablespace by accessing the URL
http://hops.cs.jhu.edu:8990/<your username>/owa/showweather;
i.e., by
replacing "cschafer" with your username in the URL.
Suppose we have defined another
procedure called
showweather2 by running the following PL/SQL code:
create or replace procedure showweather2 is
ignore boolean;
begin
ignore := owa_util.tablePrint
('weather', 'BORDER', OWA_UTIL.HTML_TABLE,
'city, temperature, humidity',
'where humidity>80');
end;
/
This procedure, which can be called in cschafer's tablespace
by accessing the URL
http://hops.cs.jhu.edu:8990/cschafer/owa/showweather2,
prints out the table weather using the following
SQL statement:
select city, temperature, humidity from weather where humidity>80;How, you may ask? Well, note the function call in
showweather2:
owa_util.tablePrint ('weather', 'BORDER', OWA_UTIL.HTML_TABLE,
'city, temperature, humidity',
'where humidity>80');
In PL/SQL, component functions and procedures of a given package are
called by giving the package name, followed by a dot ("."), followed by
the function or procedure name. Thus, we know that the above
function call is a call to the function tablePrint, which is
a member of the owa_util (remember those packages you
loaded in step 3 of "getting started", above?, Well, owa_util
is one of
them). The values for the select statement are passed as arguments
to owa_util.tablePrint; the correct select statement
is generated by
owa_util.tablePrint, using these arguments.