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

Home -> Community -> Usenet -> c.d.o.tools -> Selecting rows by a Starting and Ending Date

Selecting rows by a Starting and Ending Date

From: <newopt_at_my-deja.com>
Date: Tue, 16 Jan 2001 01:48:05 GMT
Message-ID: <94098i$ikm$1@nnrp1.deja.com>

I want to calculate the average latency over a range of dates inputted by the user for the LATENCY_AUDIT table.

The column that holds the latency value in seconds is LATENCY_SECONDS in the LATENCY_AUDIT table.

Can you give me a short sniplet of code that would prompt the user of the pl/sql script for a starting and ending date and select only those rows in the LATENCY_AUDIT table that fall within the starting and ending date the user inputs.

I would like the end user to be prompted with a "Starting Date" and "Ending Date" prompts.

I also need a cursor created to read throught the recordset that falls withing the starting and ending dates and calculates the average latency in seconds after all rows have been processed.

Here's the DDL for my LATENCY_AUDIT table. I want to select rows by using the AS400_TIMESTAMP column as the date range selection.

 CREATE TABLE LATENCY_AUDIT

   REGION_SCHEMA     CHAR(10)      NOT NULL,
   AS400_TIMESTAMP   DATE          NOT NULL,
   ORACLE_TIMESTAMP DATE,
   LATENCY_SECONDS NUMBER,
   PRIMARY KEY ( REGION_SCHEMA, AS400_TIMESTAMP ) Thanks in advance!

Sent via Deja.com
http://www.deja.com/ Received on Mon Jan 15 2001 - 19:48:05 CST

Original text of this message

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