Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Run SQL Functions in PL/SQL
How To Run SQL Functions in PL/SQL? - Oracle DBA FAQ - Working with Database Objects in PL/SQL
✍: FYIcenter.com
Of course, you can run SQL functions in SQL statements. But many SQL functions can also be executed in regular PL/SQL statements, as shown in the following sample script:
DECLARE
now DATE;
id NUMBER;
str VARCHAR2(40);
BEGIN
now := SYSDATE;
DBMS_OUTPUT.PUT_LINE('Time #1 = ' ||
TO_CHAR(now,'HH24:MI:SS'));
SELECT SYSDATE INTO now FROM DUAL;
DBMS_OUTPUT.PUT_LINE('Time #2 = ' ||
TO_CHAR(now,'HH24:MI:SS'));
id := UID;
DBMS_OUTPUT.PUT_LINE('User id #2 = ' || TO_CHAR(id));
SELECT UID INTO id FROM DUAL;
DBMS_OUTPUT.PUT_LINE('User id #2 = ' || TO_CHAR(id));
str := CHR(70)||CHR(89)||CHR(73);
DBMS_OUTPUT.PUT_LINE('String #1 = ' || str);
SELECT CHR(70)||CHR(89)||CHR(73) INTO str FROM DUAL;
DBMS_OUTPUT.PUT_LINE('String #2 = ' || str);
END;
/
Time #1 = 21:41:16
Time #2 = 21:41:16
User id #2 = 33
User id #2 = 33
String #1 = FYI
String #2 = FYI
2007-04-27, 5720👍, 0💬
Popular Posts:
How to set a HTML document's background color? document.bgcolor property can be set to any appropria...
Can one execute dynamic SQL from Forms? Yes, use the FORMS_DDL built-in or call the DBMS_SQL databas...
Can you explain what is “AutoPostBack” feature in ASP.NET ? If we want the control to automatically ...
What is the difference between CALL_FORM, NEW_FORM and OPEN_FORM? CALL_FORM: start a new form and pa...
How To Empty Your Recycle Bin? - Oracle DBA FAQ - Managing Oracle Database Tables If your recycle bi...