Re: (Fwd) Re: Any Oracle 9 users? A test please...

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Yury Bokhoncovich <byg(at)center-f1(dot)ru>, Dan Langille <dan(at)langille(dot)org>, Roland Roberts <roland(at)astrofoto(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: (Fwd) Re: Any Oracle 9 users? A test please...
Date: 2002-10-02 16:20:01
Message-ID: 3D9B1CB1.3020707@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
>
> OK, two requests. First, would you create a _named_ PL/SQL function
> with those contents and try it again. Also, would you test
> CURRENT_TIMESTAMP too?
>

SQL> CREATE TABLE foo(a date);

Table created.

As a PROCEDURE:

SQL> CREATE PROCEDURE test
2 AS
3 BEGIN
4 INSERT INTO foo SELECT SYSDATE FROM dual;
5 dbms_lock.sleep(5);
6 INSERT INTO foo SELECT SYSDATE FROM dual;
7 END;
8 /

Procedure created.

SQL> execute test;

PL/SQL procedure successfully completed.

SQL> select to_char(a, 'HH24:MI:SS') from foo;

TO_CHAR(
--------
12:01:07
12:01:12

As a FUNCTION:

SQL> CREATE FUNCTION mydiff
2 RETURN NUMBER
3 IS
4 time1 DATE;
5 time2 DATE;
6 c NUMBER;
7 BEGIN
8 SELECT SYSDATE
9 INTO time1
10 FROM DUAL;
11 SELECT COUNT(*)
12 INTO c
13 FROM bar, bar, bar, bar, bar, bar, bar, bar;
14 SELECT SYSDATE
15 INTO time2
16 FROM DUAL;
17 RETURN (time2 - time1);
18 END;
19 /

Function created.

SQL> select mydiff FROM dual;

MYDIFF
----------
.000034722

I can't test the use of CURRENT_TIMESTAMP because I have Oracle
8, not 9.

Mike Mascari
mascarm(at)mascari(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-10-02 16:26:59 GUC log_min_error_statement
Previous Message Bruce Momjian 2002-10-02 16:06:17 Re: small patch for vacuumlo