Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors
- PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #564864] Wed, 29 August 2012 03:44 Go to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

Hi,
I make the cursor in store function, the cursor is retrieving data from a remote table that has been made ​​synonymous earlier.
Problems arise when the store function is compiled and raises the error

- Create the Synonym
create or replace Synonym CI_BILL
for CISADM.CI_BILL@CCBSTDBY;

SQL> create or replace function tried to return varchar2 is
2 result varchar2 (20);
3 begin
4 bill_id select into result from ci_bill;
5
6 return (result);
7 end try;
8 /

Warning: Function created with compilation errors

SQL> SHOW ERROR
Errors for FUNCTION DEEPWELL.COBA:

LINE / COL ERROR
-------------------------------------------------- ----------
4/33 PL / SQL: ORA-04063: table "CISADM.CI_BILL" has errors
4/1 PL / SQL: SQL Statement ignored

What causes this error occur?

thank you
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #564865 is a reply to message #564864] Wed, 29 August 2012 03:54 Go to previous messageGo to next message
John Watson
Messages: 8977
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read our OraFAQ Forum Guide and How to use [code] tags and make your code easier to read

Your code is full of bugs! Check the msot basic syntax first:
orcl> create or replace function tried to return varchar2 is
  2  begin
  3  null;
  4  end;
  5  /

Warning: Function created with compilation errors.

orcl> show errors
Errors for FUNCTION TRIED:

LINE/COL ERROR
-------- -----------------------------------------------------------------
1/16     PLS-00103: Encountered the symbol "TO" when expecting one of the
         following:
         ( return compress compiled wrapped
         The symbol "TO" was ignored.

orcl>

and post again, using the [code] tags, please.
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #564990 is a reply to message #564865] Wed, 29 August 2012 19:33 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

Hi, sorry i made mistake when copy-paste the script, my script suppose like this:

Quote:

SQL> create or replace function coba return varchar2 is
2 result varchar2(20);
3 begin
4 select bill_id into result from ci_bill;
5
6 return(result);
7 end coba;
8 /

there is no word "TO" in the script.

and give error:
Quote:

SQL> show error
Errors for FUNCTION DEEPWELL.COBA:

LINE/COL ERROR
-------- ----------------------------------------------------
4/33 PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors
4/1 PL/SQL: SQL Statement ignored


What causes this error occur?

thank you
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #564991 is a reply to message #564990] Wed, 29 August 2012 19:44 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/

>Errors for FUNCTION DEEPWELL.COBA:
It appears schema owner of COBA function is DEEPWELL.

>4/33 PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors
04063, 00000, "%s has errors"
// *Cause:  Attempt to execute a stored procedure or use a view that has
//          errors.  For stored procedures, the problem could be syntax errors
//          or references to other, non-existent procedures.  For views,
//          the problem could be a reference in the view's defining query to
//          a non-existent table.
//          Can also be a table which has references to non-existent or
//          inaccessible types.
// *Action: Fix the errors and/or create referenced objects as necessary.

what object type is CI_BILL? (a VIEW?)
Is CI_BILL really owned by CISADM?

[Updated on: Wed, 29 August 2012 19:55]

Report message to a moderator

- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #564998 is a reply to message #564991] Wed, 29 August 2012 23:38 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

ci_bill is an synonym of table from remote database schema CISADM.
The remote database is our standby database which has characteristic READ ONLY.

Quote:

create or replace Synonym CI_BILL
for CISADM.CI_BILL@CCBSTDBY;
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565001 is a reply to message #564998] Wed, 29 August 2012 23:43 Go to previous messageGo to next message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Post result of:
select sysdate from dual@CCBSTDBY;
select owner, username from dba_db_links where db_link='CCBSTDBY';

Regards
Michel

[Updated on: Wed, 29 August 2012 23:44]

Report message to a moderator

- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565020 is a reply to message #565001] Thu, 30 August 2012 01:18 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

sysdate: 30/08/2012 13:02:14

OWNER USERNAME
DEEPWELL CISADM
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565023 is a reply to message #565020] Thu, 30 August 2012 01:32 Go to previous messageGo to next message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Can you use SQL*Plus and copy and paste your session.
And add:
show user
select owner, object_name, object_type, status 
from dba_objects
where object_name in ('CCBSTDBY', 'CI_BILL')
/
select * from dba_synonyms where synonym_name='CI_BILL';

Execute this (and the 2 previous queries) with CISADM account. If it can't access DBA viess then replace DBA by ALL.

Regards
Michel
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565035 is a reply to message #565023] Thu, 30 August 2012 02:16 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

Hi Michel,
Do you mean i have to execute the 2 queries under CIASADM in CCBSTDBY? or just in DEEPWELL?

Thanks
zhy
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565039 is a reply to message #565035] Thu, 30 August 2012 02:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Sorry, I mean DEEPWELL as this is the one that tries to create the function.

In addition, I didn't first see that but:

Quote:
SQL> create or replace function tried to return varchar2 is
...8 /

Warning: Function created with compilation errors

SQL> SHOW ERROR
Errors for FUNCTION DEEPWELL.COBA:

There is some kind of mismatch in the name.

Regards
Michel
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565040 is a reply to message #565039] Thu, 30 August 2012 02:53 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

Hi Michel,
sorry i made mistake when copy-paste the script, my script suppose like this:
SQL> create or replace function coba return varchar2 is
2 result varchar2(20);
3 begin
4 select bill_id into result from ci_bill;
5
6 return(result);
7 end coba;
8 /

there is no word "TO" in the script.
below is result of execution script from you:
SQL> show user
User is "deepwell"
SQL> select owner, object_name, object_type, status
  2  from dba_objects
  3  where object_name in ('CCBSTDBY', 'CI_BILL')
  4  /
 
OWNER      OBJECT_NAME     OBJECT_TYPE        STATUS
---------- --------------- ------------------ -------
DEEPWELL   CI_BILL         SYNONYM            VALID
DEEPWELL   CCBSTDBY        DATABASE LINK      VALID

SQL> select * from dba_synonyms where synonym_name='CI_BILL';
 
OWNER    SYNONYM_NAME  TABLE_OWNER  TABLE_NAME   DB_LINK
-------- ------------- ------------ ------------ ----------------
DEEPWELL CI_BILL       CISADM       CI_BILL      CCBSTDBY


Regard
zhy
--
update: corrected [quote] tags to [code] tags. jw.

[Updated on: Thu, 30 August 2012 03:00] by Moderator

Report message to a moderator

- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565044 is a reply to message #565040] Thu, 30 August 2012 03:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Please use CODE tags and not QUOTE one to post your code.
And I asked you to execute again the first 2 queries within SQL*Plus. Please do it.

After that, connect on the @CCBSTDBY database using user CISADM and execute:
show user
select owner, object_name, object_type, status 
from dba_objects
where object_name in ('CI_BILL')
/
show parameter audit

Regards
Michel

[Updated on: Thu, 30 August 2012 03:03]

Report message to a moderator

- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565053 is a reply to message #565044] Thu, 30 August 2012 03:50 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

here result execution from DEEPWELL:
SQL> show user
User is "deepwell"
SQL> select owner, object_name, object_type, status
  2  from dba_objects
  3  where object_name in ('CCBSTDBY', 'CI_BILL')
  4  /
 
OWNER     OBJECT_NAME   OBJECT_TYPE        STATUS
--------- ------------- ------------------ -------
DEEPWELL  CI_BILL       SYNONYM            VALID
DEEPWELL  CCBSTDBY      DATABASE LINK      VALID

SQL> select * from dba_synonyms where synonym_name='CI_BILL';
 
OWNER    SYNONYM_NAME   TABLE_OWNER    TABLE_NAME    DB_LINK
-------  -------------- -------------- ------------- -------------
DEEPWELL CI_BILL        CISADM         CI_BILL       CCBSTDBY


and here execution result from CISADM@CCBSTDBY database:
SQL> show user
User is "CISADM"
SQL> select owner, object_name, object_type, status
  2  from dba_objects
  3  where object_name in ('CI_BILL')
  4  /
 
OWNER      OBJECT_NAME    OBJECT_TYPE         STATUS
---------- -------------- ------------------- -------
CISUSER    CI_BILL        SYNONYM             VALID
CISREAD    CI_BILL        SYNONYM             VALID
RPTUSER    CI_BILL        SYNONYM             VALID
STGUSER    CI_BILL        SYNONYM             INVALID
STGREAD    CI_BILL        SYNONYM             INVALID
UATUSER    CI_BILL        SYNONYM             VALID
UATREAD    CI_BILL        SYNONYM             VALID
UATADM     CI_BILL        TABLE               VALID
CISADM     CI_BILL        TABLE               VALID
STGADM     CI_BILL        TABLE               VALID
 
10 rows selected
SQL> show parameter audit
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /oradb11/ccb00/product/10.2.0/Db_1/admin/ccbprod/adump
audit_sys_operations                 boolean     FALSE
audit_syslog_level                   string      
audit_trail                          string      NONE
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565058 is a reply to message #565053] Thu, 30 August 2012 04:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Gee, I don't think why it does not work.
In summary, you have
DEEPWELL.COBA function 
-> CI_BILL = synonym DEEPWELL.CI_BILL - VALID
-> CISADM.CI_BILL@CCBSTDBY 
  -> CCBSTDBY database link connect to CISADM on CCBSTDBY - VALID
-> on CCBSTDBY, CISADM.CI_BILL table VALID.

So everything is valid and accessible.

Last test, on original database with DEEPWELL account execute:
select * from CI_BILL where rownum=1;

Regards
Michel


- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565137 is a reply to message #565058] Thu, 30 August 2012 20:07 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

yes, you right.
this case really make me confuse, i have many time make database link and synonym object before, but just in this case the error like this occur.
and the other think we don't find any error if we make selection script, the error occur if we put the selection statement in store function or procedure.

SQL> select * from CI_BILL where rownum=1;
 
BILL_ID      BILL_CYC_CD WIN_START_DT ACCT_ID    BILL_STAT_FLG BILL_DT     DUE_DT      CRE_DTTM    COMPLETE_DTTM LATE_PAY_CHARGE_SW
------------ ----------- ------------ ---------- ------------- ----------- ----------- ----------- ------------- ------------------
000309858268                          0003000000 C             01/06/2011  25/07/2011  22/06/2011  22/06/2011    Y                  


is it because of GLOBAL NAME?
SQL> show parameter global
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
global_context_pool_size             string      
global_names                         boolean     FALSE


Rgds
zhy
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565138 is a reply to message #565137] Thu, 30 August 2012 20:30 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>select bill_id into result from ci_bill;
CI_BILL must contain only 1 row; otherwise error gets thrown.

Part of me questions whether the code you post is the code that actually gets invoked.
Also as general reminder, privilege acquired via ROLE do not apply within named PL/SQL procedure.
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565140 is a reply to message #565138] Thu, 30 August 2012 22:14 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

Hi BlackSwan,
It's my habit for me before make true script, i mean the complex script, i try make a simple just for testing. I will put the selection under a cursor and got the same error like:

declare
cursor a is
select bill_id from ci_bill;
begin
null;
end;
 
ORA-06550: line 4, column 21:
PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors
ORA-06550: line 4, column 1:
PL/SQL: SQL Statement ignored


please explained more to me about your statement:
privilege acquired via ROLE do not apply within named PL/SQL procedure.


tks
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565141 is a reply to message #565140] Thu, 30 August 2012 22:21 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>ORA-06550: line 4, column 21:
Is line 4 the BEGIN or null; that throws posted error?

I'll stop wasting my time trying to discern fact from fiction.
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565142 is a reply to message #565140] Thu, 30 August 2012 23:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
declare
  cursor a is select bill_id from ci_bill;
begin
  null;
end;
/


Execute this in the same SQL*Plus session that the other things I asked you.

Regards
Miguel
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565168 is a reply to message #565142] Fri, 31 August 2012 03:08 Go to previous messageGo to next message
zhyege
Messages: 10
Registered: August 2012
Location: Indonesia
Junior Member

SQL> declare
  2    cursor a is select bill_id from ci_bill;
  3  begin
  4    null;
  5  end;
  6  /
 
declare
  cursor a is select bill_id from ci_bill;
begin
  null;
end;
 
ORA-06550: line 3, column 35:
PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors
ORA-06550: line 3, column 15:
PL/SQL: SQL Statement ignored


is it because CISADM@CCBSTDBY database is a READ ONLY database? we configure read only database for standby purpose.. is it because of this characteristic?
- Re: PL/SQL: ORA-04063: table "CISADM.CI_BILL" has errors [message #565169 is a reply to message #565168] Fri, 31 August 2012 03:16 Go to previous message
Michel Cadot
Messages: 68757
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Your output is strange.
I begin to think like BlackSwan: "I'll stop wasting my time trying to discern fact from fiction."

Regards
Michel
Previous Topic: Case Statement issues
Next Topic: importance of recursion functions in pl/sql
Goto Forum:
  


Current Time: Tue May 20 18:15:04 CDT 2025