Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SELECT ... FROM DUAL ?
I have seen PL/SQL code (see
http://www.oracle.com/oramag/code/cod02189.html) such as:
SELECT SUBSTR (vissuedt, 3, 3) INTO vmonth FROM dual;
my question is: would not this be more efficient written as:
vmonth := SUBSTR(vissuedt,3,3);
Due to my understanding there is a small, but definate cost from switching from PL/SQL context to SQL context. I understand with things like sequences need to be selected from DUAL.
PL/SQL code I have seen and wanted to change right away:
SELECT USER INTO v_username FROM dual;
SELECT TRUNC(SYSDATE) INTO v_today FROM DUAL;
Perhaps I am just being picky.
Phil Bolduc
North Vancouver, Canada
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Fri Sep 17 1999 - 02:40:42 CDT
![]() |
![]() |