Olivia,
First, Olivia, in both of your postings, above, the code for the "numchk" function and the code for your SQL query seem to appear
together. I just want to confirm that you are running the "CREATE FUNCTION..." code separately from the SELECT statement...You should not attempt to run the SELECT statement until your "CREATE FUNCTION..." code results in a "Function created." response.
Second, TOAD and QTODBC don't recognise "/"; that is a SQL*Plus symbol.
Third, if the SQL*Plus command, "show errors", produces no results (following an attempt to compile in SQL*Plus), then you can use the following script to display errors for a user session. (BTW, I artificially widened the display, below, to avoid unsightly/confusing line wrap on wider lines.):
Code:
col line_pos format a8
col text Heading "Error Description" format a90
accept proc prompt "Enter the name of the Procedure/Function you just tried to compile: "
select line||'/'||position line_pos, text
from user_errors
where name = upper('&proc')
/
I called the above script "showerrors.sql" (designed for use in SQL*Plus). You cannot copy and paste the above code since it contains "ACCEPT...PROMPT" syntax, which must run from a script. Following is a sample invocation of "showerrors.sql" from a SQL*Plus prompt:
Code:
SQL> @showerrors
Enter the name of the Procedure/Function you just tried to compile: xy
LINE_POS Error Description
-------- ------------------------------------------------------------------------------------
2/7 PLS-00201: identifier 'VW' must be declared
2/7 PL/SQL: Item ignored
6/19 PLS-00320: the declaration of the type of this expression is incomplete or malformed
6/21 PL/SQL: ORA-00904: : invalid identifier
6/5 PL/SQL: SQL Statement ignored
7/26 PLS-00320: the declaration of the type of this expression is incomplete or malformed
7/5 PL/SQL: Statement ignored
**********************************************************************************************
You could tailor the above script for use outside of SQL*Plus (i.e., TOAD, et cetera), as well.
Let us know your findings.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services:
www.dasages.com]