PLS-S-00201, identifier 'STATS_MODE' must be declared [message #666690] |
Mon, 20 November 2017 13:30 |
|
WarrenDB
Messages: 4 Registered: November 2017
|
Junior Member |
|
|
My precompiler is giving an error:
Pro*C/C++: Release 12.1.0.2.0 - Production on Mon Nov 20 13:05:30 2017
Copyright (c) 1982, 2015, Oracle and/or its affiliates. All rights reserved.
System default option values taken from: /oracle/product/12102SE/precomp/admin/pcscfg.cfg
Error at line 757, column 4 in file code.pc
EXEC SQL
...1
PLS-S-00201, identifier 'STATS_MODE' must be declared
Error at line 757, column 4 in file code.pc
EXEC SQL
...1
PLS-S-00000, SQL Statement ignored
Semantic error at line 757, column 4, file code.pc:
EXEC SQL
...1
PCC-S-02346, PL/SQL found semantic errors
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 2.
on the following query:
SELECT STATS_MODE(DECODE(data_type,'DATE',21,
DECODE(data_precision,NULL,data_length,data_precision))), count(*)
INTO :llCurColMode, :llCurColCnt
FROM user_tab_columns
WHERE column_name = :lsColNme;
Replacing STATS_MODE with MEDIAN or AVG will let it build, but obviously not the result I want. Is there a specific header set I need to use to enable the extended aggregate functions, or a way to manually declare it as a valid function even though it's built in? It runs just fine when I run it directly against the database with sqlplus.
|
|
|
|
|
|
|
|
|
Re: PLS-S-00201, identifier 'STATS_MODE' must be declared [message #666703 is a reply to message #666696] |
Tue, 21 November 2017 00:34 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
The difference between the 2 settings is that with SYNTAX pcc does not connect to the database to check if the function is valid or not in the user environment.
Check if there is no object with name STATS_MODE in your database.
If no, then I tend to think it is a bug (or maybe a restriction of Standard Edition?).
|
|
|