Re: Can a procedure contain only a SELECT statement?

From: Mladen Gogala <no_at_email.here.invalid>
Date: Fri, 19 Mar 2010 19:48:49 +0000 (UTC)
Message-ID: <pan.2010.03.19.19.48.49_at_email.here.invalid>



On Fri, 19 Mar 2010 20:33:09 +0100, Sybrand Bakker wrote:

> This also measn the 'wisdom' of Mladen Gogala Oracle 'lacks'
> transactional DDL is incorrect. Oracle doesn't *NEED* crap constructs
> like 'transactional DDL'. In the Oracle world systems are *designed* and
> not 'hacked together'. Maybe Mladen Gogala's applications are, and in
> that case he might better switch to craphola RDBMS-es completely.

Real programmers use cursors? So be it, use them. So, real programmers as you see them, would probably never do this:

mgogala_at_nycwxp2622:~$ PGHOST=lpo-postgres-01 mgogala_at_nycwxp2622:~$ psql -U scott
Password for user scott:
Timing is on.
psql (8.4.2)
Type "help" for help.

scott=> create local temporary table dept10 as select * from emp
where deptno=10;
SELECT
Time: 37.902 ms
scott=> select * from dept10;
 empno | ename | job | mgr | hiredate | sal | comm | deptno

-------+--------+-----------+------+---------------------+------+------
+--------
  7782 | CLARK  | MANAGER   | 7839 | 1981-06-09 00:00:00 | 2450 |      
|     10
  7839 | KING   | PRESIDENT |      | 1981-11-17 00:00:00 | 5000 |      
|     10
  7934 | MILLER | CLERK     | 7782 | 1982-01-23 00:00:00 | 1300 |      
|     10

(3 rows)

Time: 30.546 ms
scott=> \c scott;
psql (8.4.2)
You are now connected to database "scott". scott=> select * from dept10;
ERROR: relation "dept10" does not exist LINE 1: select * from dept10;

                      ^

scott=>

Big deal, as long as it works. Of course, that particular database also knows how to deal with cursors. Local temporary tables or transactional DDL are a very useful feature which doesn't exist in Oracle. Oracle has many very useful and practical features, but this one is not among them. BTW, the password for this user is...., oh, I'll let you guess this one.

-- 
http://mgogala.byethost5.com
Received on Fri Mar 19 2010 - 14:48:49 CDT

Original text of this message