Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SUM using PL/SQL?

Re: SUM using PL/SQL?

From: Chris Halioris <halioris_chris_nonlilly_at_lilly.com>
Date: 1997/08/05
Message-ID: <33E73539.2790@lilly.com>#1/1

tdrudy_at_ix.netcom.com wrote:
>
> All,
> I have a million+ rows table with about 18 columns.
> I'm going to be allowing our users to access this database on our
> intranet via Netscape in this manner: they will be allowed to do
> retrievals only, with high-level results being passed back to their
> browser. These high-level results will be sums or counts based
> on their inputted retrieval parms.
>
> We're using Oracle Webserver 2.1's htp/htf procedures&
> functions to create a selection screen for the user, and the
> parms which the user selects are passed back to Oracle 7.3.2.3.
> very well.
>
> The question: I want to use a PL/SQL procedure(s) which will
> accept the retrieval parms from the Webserver, do the summing or
> counting based on those parms, and pass results back to the user.
> The COUNT function in PL/SQL 2.3 only retruns counts of retrieved rows,
> while I need counts of internal column values; also, there is no SUM
> per se within PL/SQL, and I do not want to use SQL within PL/SQL
> (such as the DBMS_SQL package). Is there a way to do the summing of
> internal column values using PL/SQL?
>
> Thanks,
> Tom

You've lost me. First of all, COUNT is not a PL/SQL function but a SQL function. Second, if I understand you correctly (which I may not, you should provide an example for us to follow) you want to return the number of rows that match the given criteria. That is no more than a select count(*) from ... where column = parm.

Also, you said you don't want to use SQL within PL/SQL. You will definitely use SQL as any select statement you issue will be using SQL. Using DBMS_SQL would be poerforming dynamic SQL by using PL/SQL.

Sounds to me like you don't exactly understand the differences between SQL and PL/SQL. Why don't you provide an example of the data and the prototype for the procedure you want to write and maybe someone here will be able to help...

Chris Halioris
Tactics, Inc. Received on Tue Aug 05 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US