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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Serious Challenge # 1 - Probably Not Much Fun

Re: SQL Serious Challenge # 1 - Probably Not Much Fun

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 19 Mar 2004 20:17:03 -0500
Message-ID: <2vKdnS0J76c0BsbdRVn-hg@comcast.com>

"Turkbear" <john.g_at_dot.spamfree.com> wrote in message news:mqcm50lmjfdieh71eippc0k7qt6dg646of_at_4ax.com...
| "Terry Dykstra" <dontreply_tddykstra_at_forestoil.ca.x> wrote:
|
| >Does it work in PL/SQL in 9i or 10g? I tried in 8174 and it failed:
| >
| > 1 declare
| > 2 ls_result varchar2(10);
| > 3 begin
| > 4 select reverse('oracle') into ls_result from dual;
| > 5* end;
| >SQL> /
| >select reverse('oracle') into ls_result from dual;
| > *
| >ERROR at line 4:
| >ORA-06550: line 4, column 8:
| >PLS-00201: identifier 'REVERSE' must be declared
| >ORA-06550: line 4, column 1:
| >PL/SQL: SQL Statement ignored
|
|
| The REVERSE() Function( Not the REVERSE Keyword used in the INDEX clause)
| is a SqlPlus function and those do not work in Pl/Sql ( at least not in
8i) -
|
|

there is no such thing as a 'SqlPlus' function (SQL*Plus is the tool, not a language) -- but this does appear to be a SQL (the language) vs PL/SQL issue

the REVERSE function is not recognized by PL/SQL until 9i because the PL/SQL and SQL engines are out-of-sync in 8i

per Daniel's observation, REVERSE will work in dynamic SQL in 8i because the dynamic SQL statement (since it is stored in a literal or a variable) is not parsed by the PL/SQL engine or its 'stale' SQL parser, but will be submitted to the real SQL engine at runtime, where it will be recognized

;-{ mcs Received on Fri Mar 19 2004 - 19:17:03 CST

Original text of this message

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