Error in pakcage table or view does not exist but on sql prompt query works
Hi
Can any one help me to understand the error of ORA-00942: table or view does not exist while compiling the package on Oracle 9.2.0.4.0
The below package compiled in system user and trying to query on view v$session_wait however getting below error.
PACKAGE BODY SYSTEM.PK_DB_ALERT
On line: 212
PL/SQL: ORA-00942: table or view does not exist
I can execute same query mentioned below from sql prompt from system user and it works fine however it doesn't like from package, Please advice, thank you in advance.
SELECT SID, seq#, event, wait_time
FROM v$session_wait
WHERE event NOT LIKE 'SQL*Net%' AND wait_time <> 0
ORDER BY 2
SDD wrote:
Hi
Can any one help me to understand the error of ORA-00942: table or view does not exist while compiling the package on Oracle 9.2.0.4.0Which means package owner is granted select on view not directly but via roles. However, roles are ignored by definer rights packages/stored procedures/stored functions/triggers... You need to grant package owner select on view directly.
SY.
Edited by: Solomon Yakobson on Jan 21, 2010 4:06 AM
Similar Messages
-
ERROR ORA-00942: table or view does not exist
Hi:
I created a .sql file and a loader file. Running the .sql file with sql * plus Worksheet:
declare
gr sdo_georaster;
begin
select image into gr from gis.RasterImages where geoid=1 for update;
sdo_geor.generatePyramid(gr,'resampling=NN');
update gis.RasterImages set image=gr where geoid=1;
commit;
end;
I trying to create a pyramid,but the error appeared:
ERROR at line 1:
ORA-29400: DATA CONTROL ERROR ORA-00942: table or view does not exist
ORA-06512: 在 "MDSYS.SDO_GEOR_INT", line 162
ORA-06512: 在 "MDSYS.SDO_GEOR", line 826
ORA-06512: 在 line 5
I don't know why?
Anyone can help me?
Thanks.Hi,
I think you are executing the select statement for schema X and the table is in the schema srnr.
And schema X is not having select privilege on the table 'students' present in schema srnr.
Goto schema srnr.
Execute the following statement:
grant select on students to X;
This will give schema X the privilege to query the table students present in srnr.
Regards,
Anupama -
HI ,
we are facing below issue while activating info object xxxxxxxx
" SQL Error: ORA-00942: table or view does not exist " and " CX_RS_SQL_ERROR "
can any one help us out to resolve this issue.
Thanks,
EDK......Hi,
Check the corrections given in the note 990764:
Reason and Prerequisites
Up to now, using a characteristic with its own master data read class as the InfoProvider was not supported. This is now released but it is not available for all modelings. Using the attributes in the query is not supported for characteristics that have their own master data read class. Using the attributes in the query causes a termination. The following errors may occur in this case:
ORA-00942: table or view does not exist
Fehler in CL_SQL_RESULT_SET Include NEXT_PACKAGE
RAISE_READ_ERROR in CL_RSDRV_VPROV_BASE
Solution
SAP NetWeaver 2004s BI
Import Support Package 11 for SAP NetWeaver 2004s BI (BI Patch 11 or SAPKW70011) into your BI system. The Support Package is available once Note 0914305 "SAPBINews BI 7.0 Support Package 11", which describes this Support Package in more detail, has been released for customers.
In urgent cases you can implement the correction instructions.
The correction instructions contain the tightened inspection for characteristics.
Regards,
Anil Kumar Sharma .P -
Why APEX 4.1 Error handling function does not trap the error of missing table?
Say, I create simple application with single IR report page and I also assign standard simple error handling function.
Function works perfectly, except but this case:
If I just drop a table used by report page and then refresh the page I am getting usual APEX error message:
ORA-20001: get_dbms_sql_cursor error ORA-00942: table or view does not exist
and error handling function is not invoked at all.
Is this a feature or a bug?Hi,
Check the corrections given in the note 990764:
Reason and Prerequisites
Up to now, using a characteristic with its own master data read class as the InfoProvider was not supported. This is now released but it is not available for all modelings. Using the attributes in the query is not supported for characteristics that have their own master data read class. Using the attributes in the query causes a termination. The following errors may occur in this case:
ORA-00942: table or view does not exist
Fehler in CL_SQL_RESULT_SET Include NEXT_PACKAGE
RAISE_READ_ERROR in CL_RSDRV_VPROV_BASE
Solution
SAP NetWeaver 2004s BI
Import Support Package 11 for SAP NetWeaver 2004s BI (BI Patch 11 or SAPKW70011) into your BI system. The Support Package is available once Note 0914305 "SAPBINews BI 7.0 Support Package 11", which describes this Support Package in more detail, has been released for customers.
In urgent cases you can implement the correction instructions.
The correction instructions contain the tightened inspection for characteristics.
Regards,
Anil Kumar Sharma .P -
Error rendering element. Exception: ORA-00942: table or view does not exist
Guru,
We are maintaining 10 internal Database through OEM 10g and using seesded reports.
When we try to create simple custom reports against one of the Target database , its failing with following error message ,
Query : select * from v$database
Error rendering element.
Exception: ORA-00942: table or view does not exist
select * from dual & v$session working ( But query execution happeniing from Reposistory Database not from Target instance )
Note:
I have reviewed thred "getting ORA-00942 while running report in GC"
Please give some light .
Regards,
RajuThis is an EM related question so I would suggest you post in the appropriate space "Enterprise Manager" -- https://forums.oracle.com/community/developer/english/enterprise_management/enterprise_manager/enterprise_manager_6
You may also review (In Grid Control 10.2, Creating a Report to Query 'V$SESSION 'Fails: 'Error Rendering Element. Exception: ORA-00942 Table Or View Does Not Exist' (Doc ID 356755.1)) and implement the solution for v$database
Thanks,
Hussein -
Table or view does not exist - Data Dictionary Import Wizard(Data Modeler)
Hi All,
In Data Modeler, Data Dictionary Import Wizard, I'm able to connect to database.But while going to the second stage (Select Schema/Database), I'm getting an error "ORA-00942: table or view does not exist".
I am able to select the table with select * from all_tables and I can open many tables as well.
Could anyone tell me, whether I'm missing any privilege, that causing this error.
Thanks in advance for you support.
Thanks.Hi,
Thanks for your response, sorry for my late reply as I was away from my place.
Yes, it is showing "Connection established successfully".
log file as below-
2012-08-02 10:37:26,471 [main] INFO ApplicationView - Oracle SQL Developer Data Modeler 3.1.1.703
2012-08-02 10:39:42,889 [AWT-EventQueue-0] ERROR AbstractDBMExtractionWizardImpl - java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
Pls see oracle version details-
Oracle Database 11g Enterprise Edition
11.1.0.6.0
64bit Production
Thanks again and waiting for reply. -
Not able to create EM repository - ORA-00942: table or view does not exist
-bash-3.00$ emca -config dbcontrol db -repos recreate
STARTED EMCA at 2010-06-02 12:12:29
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: eric1
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
You have specified the following settings
Database ORACLE_HOME ................ /oracle/product/10.2.0/db_1
Database hostname ................ solx
Listener port number ................ 1521
Database SID ................ eric1
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
Do you wish to continue? [yes(Y)/no(N)]: Y
2010-06-02 12:12:52 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_2010-06-02_12-12-29-PM.log.
2010-06-02 12:13:02 oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) ...
2010-06-02 12:13:05 oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /oracle/product/10.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=solx)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=eric1))) -repos_user SYSMAN -action drop -verbose -output_file /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_repos_drop_2010-06-02_12-13-02-PM.log
2010-06-02 12:13:05 oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
2010-06-02 12:13:05 oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_repos_drop_<date>.log for more details.
2010-06-02 12:13:05 oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_2010-06-02_12-12-29-PM.log for more details.
Could not complete the configuration. Refer to the log file at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_2010-06-02_12-12-29-PM.log for more details.So I looked into a log file: /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_2010-06-02_12-12-29-PM.log
Here is an end of it ( I can paste all log file if necessary but it is very long):
CONFIG: Starting execution: /oracle/product/10.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=solx)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=eric1))) -repos_user SYSMAN -action drop -verbose -output_file /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_repos_drop_2010-06-02_12-13-02-PM.log
2010-06-02 12:13:05 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Exit value of 51
2010-06-02 12:13:05 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Enter SYS user's password :
Enter repository user password :
Getting temporary tablespace from database...
prepare(SELECT tablespace_name FROM dba_tablespaces WHERE contents='TEMPORARY' AND status='ONLINE'): ORA-00942: table or view does not exist (DBD ERROR: error possibly near <*> indicator at char 28 in 'SELECT tablespace_name FROM <*>dba_tablespaces WHERE contents='TEMPORARY' AND status='ONLINE'')
2010-06-02 12:13:05 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: stty: : No such device or address
stty: : No such device or address
stty: : No such device or address
stty: : No such device or address
2010-06-02 12:13:05 oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /oracle/product/10.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=solx)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=eric1))) -repos_user SYSMAN -action drop -verbose -output_file /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_repos_drop_2010-06-02_12-13-02-PM.log
2010-06-02 12:13:05 oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
2010-06-02 12:13:05 oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_repos_drop_<date>.log for more details.
2010-06-02 12:13:05 oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/eric1/emca_2010-06-02_12-12-29-PM.log for more details.
2010-06-02 12:13:05 oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Error dropping the repository
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:176)
at oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:127)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:142)
at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:479)
at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1123)
at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:463)
at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:412)...and here I can easly see that error: ORA-00942: table or view does not exist.
But what does it mean to me ? I mean what should I ro to create/recreate missing table or view ?Hi, so here are my tries:
1. admin:
Below Dirs dont not exist:
<ORACLE_HOME>/<hostname_sid>
<ORACLE_HOME>/oc4j/j2ee/OC4J_DBConsole_<hostname>_<sid>
...also it was unable to drop user - does not exist
-bash-3.00$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.2.0 - Production on Wed Jun 2 12:55:44 2010
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Release 10.2.0.2.0 - Production
SQL> sqlplus "/as sysdba"
drop user sysman cascade;
drop role MGMT_USER;
drop user MGMT_VIEW cascade;
drop public synonym MGMT_TARGET_BLACKOUTS;
drop public synonym SETEMVIEWUSERCONTEXT;
SP2-0734: unknown command beginning "sqlplus "/..." - rest of line ignored.
SQL> drop user sysman cascade
ERROR at line 1:
ORA-01918: user 'SYSMAN' does not exist
SQL> drop role MGMT_USER
ERROR at line 1:
ORA-01919: role 'MGMT_USER' does not exist
SQL> drop user MGMT_VIEW cascade
ERROR at line 1:
ORA-01918: user 'MGMT_VIEW' does not exist
SQL> drop public synonym MGMT_TARGET_BLACKOUTS
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist
SQL> drop public synonym SETEMVIEWUSERCONTEXT
ERROR at line 1:
ORA-01432: public synonym to be dropped does not exist
{code}
I also tried this:
2. coskan
{code}
-bash-3.00$ sqlplus sys/qaz123@eric1 as sysdba
SQL*Plus: Release 10.2.0.2.0 - Production on Wed Jun 2 12:51:34 2010
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Release 10.2.0.2.0 - Production
SQL> SELECT tablespace_name FROM dba_tablespaces WHERE contents='TEMPORARY' AND status='ONLINE';
SELECT tablespace_name FROM dba_tablespaces WHERE contents='TEMPORARY' AND status='ONLINE'
ERROR at line 1:
ORA-00942: table or view does not exist
{code} -
Why Table or View does not exist???
Hi to all. I have an issue with my Business Objects. I have a relationship between two entities with the following cardinality:
EntityA 1......* Entity B, the relation is a composition and the IDs for them are DB Sequence.
I have created the corresponding views and the view link and they all work fine in the Application Module. Also, in the View Object for the EntityA ( ViewObjectA ), I have created a View Criteria, a nested one, with two attributes: the first one is an att from the*ViewObjectA* and use a value from a bind variable (Integer), and the second one is an attribute from the Entity B son and it's value is static (1). I tested with the query button and says OK. When I run the AppModule for test the ViewCriteria, I got this error: ORA-00942: table or view does not exist . And for my sorprise, I checked the query resultant and it's wrong!! Please see an example below:
SELECT Att1,Att2 FROM EntityA WHERE ( ( ( (EntityA.att1 = :id ) AND (EXISTS(SELECT 1 FROM EntityBNQ1 EntityBNQ1 WHERE ( (*EntityBDNQ1.att1 = :id*) ) AND ( EntityA.att1 = EntityBDNQ1.att1 ))) ) ) ) AND (EntityA.att1 = EntityBDNQ1.Att1))) ) ) )
As can be seen, the name of the tabla for the EntityB has NQ1 attached, and I don't know why. The view link works perfectly, as also the create operation for both ViewsObjects.
Please can anyone tell me what I'm doing wrong, if I have a mistake? What should I do??
Thanks in advance.
PS: In a new application, I created a Business Components from DataBase, and it works my WiewCriteria. I just can't believe that I should start all over again.
Thanks in advance again.Hi and thanks for the answers. Apologize for my forgetfulness of the version. It's 11.1.1.5.0 and ADF Business Components 11.1.1.60.13
I created a new Application and I made a Business Components From Table with only the two Entities mentioned before. Once configured (Put the ID as a DBSequence), created the views an the View Criteria and it's just all fine.
Hear is fragment of the XML from my EntityA (the god one). The first part it's the key attribute, the second one its the key.
This is the god working version
<Entity
xmlns="http://xmlns.oracle.com/bc4j"
Name="Person"
Version="11.1.1.61.92"
DBObjectType="table"
DBObjectName="EntityA"
AliasName="Person"
BindingStyle="OracleName"
UseGlueCode="false">
<DesignTime>
<Attr Name="_codeGenFlag2" Value="Access"/>
<AttrArray Name="_publishEvents"/>
</DesignTime>
<Attribute
Name="EntityId"
ColumnName="EntityA_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.DBSequence"
ColumnType="NUMBER"
TableName="EntityA"
PrimaryKey="true"
IsUpdateable="while_insert"
Domain="oracle.jbo.domain.DBSequence" //Different
RetrievedOnInsert="true">
<DesignTime>
<Attr Name="_DisplaySize" Value="39"/> //Different, but don't think it's important
<Attr Name="_SequenceStart" Value="1"/>
<Attr Name="_SequenceName" Value="EntitiA_SEQ"/>
</DesignTime>
</Attribute>
...This is the bad working version
<Entity
xmlns="http://xmlns.oracle.com/bc4j"
Name="EntityA"
Version="11.1.1.60.13"
DBObjectType="table"
DBObjectName="EntityA"
AliasName="EntityA"
BindingStyle="OracleName"
UseGlueCode="false"
RowClass="criminal.model.entities.filiative.EntityAImpl">
<DesignTime>
<AttrArray Name="_publishEvents"/>
<Attr Name="_codeGenFlag2" Value="Access"/>
<Attr Name="_isCodegen" Value="true"/>
</DesignTime>
<Attribute
Name="Entity_ID"
IsUpdateable="while_insert"
DefaultValue="@0" //Different
ColumnName="EntityA_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.DBSequence"
ColumnType="NUMBER"
TableName="EntityA"
PrimaryKey="true"
RetrievedOnInsert="true">
<DesignTime>
<Attr Name="_SequenceStart" Value="1"/>
<Attr Name="_SequenceName" Value="EntityA_SEQ"/>
</DesignTime>
</Attribute>
... Hear is the constrain (the god one) related to the key att:
<Key
Name="EntityAEntityAIdCheck10">
<DesignTime>
<Attr Name="_DBObjectName" Value="EntityA_EntitAy_ID_CHECK_10"/>
<Attr Name="_checkCondition" Value='"EntityA_ID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes"/>
</Key>
...Hear is the constrain (the bad one) related to the key att:
<Key
Name="EntityAEntityAIdCheck10">
<DesignTime>
<Attr Name="_isNotNull" Value="true"/>
<Attr Name="_DBObjectName" Value="EntityA_EntityA_ID_CHECK_10"/>
<Attr Name="_checkCondition" Value='"EntityA_ID" IS NOT NULL'/>
<Attr Name="_isCheck" Value="true"/>
</DesignTime>
<AttrArray Name="Attributes">
<Item Value="model.EntityA.EntityA_ID"/>
</AttrArray>
</Key>
...Hear is the XML of the EntityB The differences are the same that in EntityA
the key att:
<Entity
xmlns="http://xmlns.oracle.com/bc4j"
Name="EntityB"
Version="11.1.1.61.92"
DBObjectType="table"
DBObjectName="EntityB"
AliasName="EntityB"
BindingStyle="OracleName"
UseGlueCode="false">
<DesignTime>
<Attr Name="_codeGenFlag2" Value="Access"/>
<AttrArray Name="_publishEvents"/>
</DesignTime>
<Attribute
Name="EntityBId"
ColumnName="EntityB_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.DBSequence"
ColumnType="NUMBER"
TableName="EntityB"
PrimaryKey="true"
IsUpdateable="while_insert"
Domain="oracle.jbo.domain.DBSequence"
RetrievedOnInsert="true">
<DesignTime>
<Attr Name="_DisplaySize" Value="39"/>
<Attr Name="_SequenceStart" Value="1"/>
<Attr Name="_SequenceName" Value="EntityB_SEQ"/>
</DesignTime>
</Attribute>
...this is the bad one
<Entity
xmlns="http://xmlns.oracle.com/bc4j"
Name="EntityB"
Version="11.1.1.60.13"
DBObjectType="table"
DBObjectName="EntityB"
AliasName="EntityB"
BindingStyle="OracleName"
UseGlueCode="false"
RowClass="model.EntityBImpl">
<DesignTime>
<Attr Name="_codeGenFlag2" Value="Access"/>
<AttrArray Name="_publishEvents"/>
<Attr Name="_isCodegen" Value="true"/>
</DesignTime>
<Attribute
Name="EntityB_ID"
IsUpdateable="while_insert"
ColumnName="EntityB_ID"
SQLType="NUMERIC"
Type="oracle.jbo.domain.DBSequence"
ColumnType="NUMBER"
TableName="EntityB"
PrimaryKey="true"
RetrievedOnInsert="true">
<DesignTime>
<Attr Name="_SequenceStart" Value="1"/>
<Attr Name="_SequenceName" Value="EntityB_SEQ"/>
</DesignTime>
</Attribute>
...the key (the god one)
<Key
Name="FkEntityB">
<DesignTime>
<Attr Name="_isCascadeDelete" Value="true"/>
<Attr Name="_referencedKey" Value="EntityA_PRIMARY_KEY_10"/>
<Attr Name="_isForeign" Value="true"/>
<Attr Name="_DBObjectName" Value="FK_EntityB"/>
</DesignTime>
<AttrArray Name="Attributes">
<Item Value="project1.EntityB.EntityBEntityBId"/>
</AttrArray>
</Key>
...the bad one
<Key
Name="FkEntityB">
<DesignTime>
<Attr Name="_isCascadeDelete" Value="true"/>
<Attr Name="_referencedKey" Value="EntityA_PRIMARY_KEY_10"/>
<Attr Name="_isForeign" Value="true"/>
<Attr Name="_DBObjectName" Value="FK_EntityB"/>
</DesignTime>
<AttrArray Name="Attributes">
<Item Value="project1.EntityB.EntityBEntityBId"/>
</AttrArray>
</Key>
...Sorry if is too long.
What might be wrong? It's that enough to determine the error?
Thanks again.
PS: I did try look for NQ1 as kdario said and nothing was found. I had already done regenerate the association as 969750 said and still habe the same error. -
Table or views does not exists on create package body
Hi folks.....
I',m having a problem....
I am trying to create the pakage body, but i can't because i'm get the error ORA-000942 TABLE OR VIEWS DOES NOT EXIST, i don't understand !!!!
When i create de procedure, it's suscessful
I did GRANT ALL ON GEMCO.CAD_FILIAL TO USR_MLADMIN;
But the error persisits
Someone has any idea ?
Tanks SpaulonciIs USR_MLADMIN a role or a schema?
You need to grant the privileges directly to the schema and not through a role -
How to handle ORA-00942: table or view does not exist
Hii All,
I'm trying to drop a table dynamically irrespective of its existence in a procedure. Its working fine when table exists but when table doesn't exist I'm facing following error
ORA-00942: table or view does not existI made use of pragma exception_init and modified my code as below
Create or replace Procedure sp_FSASA_FEEDUPLOAD_process
p_test_dir in varchar2,
p_feed_file_name in varchar2
is
l_exttable_str varchar2(32000) ;
l_log_file constant varchar2(200) := 'logfile_rgh.log';
l_table_doesnt_exist Exception;
pragma exception_init(l_table_doesnt_exist,-00492);
Begin
Begin
execute immediate 'drop table FSASA_FEEDUPLOAD_EXT purge' ;
Exception
when l_table_doesnt_exist then
null;
End;
l_exttable_str := 'Create table FSASA_FEEDUPLOAD_EXT ';
l_exttable_str := l_exttable_str||' ( ';
l_exttable_str := l_exttable_str||' Category_No varchar2(1), ';
l_exttable_str := l_exttable_str||' Financial_Category varchar2(300), ';
l_exttable_str := l_exttable_str||' GFCID number, ';
l_exttable_str := l_exttable_str||' Balance number(34,14), ';
l_exttable_str := l_exttable_str||' Refernce_no varchar2(20), ';
l_exttable_str := l_exttable_str||' Account_no varchar2(20), ';
l_exttable_str := l_exttable_str||' ce_trans_id varchar2(20) ';
l_exttable_str := l_exttable_str||' ) ';
l_exttable_str := l_exttable_str||' Organization external ';
l_exttable_str := l_exttable_str||' ( ';
l_exttable_str := l_exttable_str||' type oracle_loader ';
l_exttable_str := l_exttable_str||' default directory '||p_test_dir;
l_exttable_str := l_exttable_str||' Access parameters ';
l_exttable_str := l_exttable_str||' ( ';
l_exttable_str := l_exttable_str||' records delimited by newline ';
l_exttable_str := l_exttable_str||'BADFILE '||q'[']'||p_test_dir||q'[']'||':'||q'[']'||'feed.bad '||q'[']' ;
l_exttable_str := l_exttable_str||'LOGFILE '||q'[']'||p_test_dir||q'[']'||':'||q'[']'||':feed.log '||q'[']' ;
l_exttable_str := l_exttable_str||q'[FIELDS TERMINATED BY X'09']';
l_exttable_str := l_exttable_str||' missing field values are null ';
l_exttable_str := l_exttable_str||')location('||q'[']'||p_feed_file_name||q'[']';
l_exttable_str := l_exttable_str||')' ;
l_exttable_str := l_exttable_str||' )Reject limit unlimited ';
dbg_print(l_log_file,'l_exttable_str : '||l_exttable_str);
execute immediate l_exttable_str;
End;But still I'm unable to get rid of it. Pls help me.
1)I need to drop it as I need to immediately create table with different file name and from different path.
2)The last thing I don't like to do is to check the table name in USER_OBJECTS and then drop.
3)Also suggest me whether creating an external table dynamically is correct approach or not.
4)Till now we were using utl_file for reading feed file but I'm much interested in using EXTERNAL TABLE concept.
5)As the filename and path gets changed I need to create my external table at runtime.
please suggest me whether I can alter my filename and path at runtimeYou will need to use WHEN OTHERS EXCEPTION handler which is not a good idea to do so if you dont handle the same approprialtly then the exception would go un-noticed:
SQL> ed
Wrote file afiedt.buf
1 begin
2 execute immediate 'drop table my_Test';
3 exception
4 when others then
5 dbms_output.put_line(SQLCODE||SQLERRM);
6* end;
SQL> /
-942ORA-00942: table or view does not exist
PL/SQL procedure successfully completed.
SQL> -
Error in Upload file-table or view does not exist-wwv_flow_file_objects$
Hi,
i am trying to upload a file and then store the contents of the file into one of my tables in the schema.I wrote one package for uploading the file and then a process to insert each record in the uploaded file to the table in my schema.When i try compiling the package it gives an error.
PL/SQL: ORA-00942: table or view does not exist
The name of the table is wwv_flow_file_objects$
The package is as follows-
CREATE OR REPLACE PACKAGE BODY Text_File_Pkg AS
FUNCTION get_file_lines (
p_file_name IN VARCHAR2,
p_lines IN OUT line_tab_type,
p_rec_sep IN VARCHAR2 DEFAULT dos_new_line
) RETURN INTEGER
IS
v_binary_file BLOB;
v_text_file CLOB;
v_dest_offset INTEGER := 1;
v_src_offset INTEGER := 1;
v_lang_context INTEGER := DBMS_LOB.default_lang_ctx;
v_warning INTEGER;
v_rec_sep_len CONSTANT INTEGER := LENGTH(p_rec_sep);
v_start_pos INTEGER := 1;
v_end_pos INTEGER := 1;
v_line_num INTEGER := 1;
v_file_length INTEGER;
BEGIN
IF p_file_name IS NULL
THEN
RETURN 1;
END IF;
IF p_rec_sep IS NULL
THEN
RETURN 2;
END IF;
SELECT blob_content
INTO v_binary_file
FROM wwv_flow_file_objects$
WHERE NAME = p_file_name
AND (mime_type = 'text/plain' OR mime_type = 'application/octet-stream')
AND doc_size > 0;
DBMS_LOB.createtemporary(v_text_file, TRUE);
DBMS_LOB.converttoclob(v_text_file, v_binary_file,
DBMS_LOB.lobmaxsize, v_dest_offset,
v_src_offset, DBMS_LOB.default_csid,
v_lang_context, v_warning);
IF v_warning = DBMS_LOB.warn_inconvertible_char
THEN
-- Unable to convert file.
RETURN 3;
END IF;
v_file_length := DBMS_LOB.getlength(v_text_file);
LOOP
EXIT WHEN v_start_pos > v_file_length;
v_end_pos := DBMS_LOB.INSTR(v_text_file, p_rec_sep, v_start_pos);
IF v_end_pos = 0
THEN
v_end_pos := v_file_length + 1;
END IF;
IF (v_end_pos - v_start_pos) > 4000
THEN
-- Line exceeds 4000 characters.
RETURN 4;
END IF;
p_lines(v_line_num) := DBMS_LOB.SUBSTR(v_text_file, v_end_pos - v_start_pos, v_start_pos);
v_line_num := v_line_num + 1;
v_start_pos := v_end_pos + v_rec_sep_len;
END LOOP;
RETURN 0;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN 5;
END get_file_lines;
END Text_File_Pkg;
Any suggestions.
Many Thanks,
SanjaiHi,
i am trying to upload a file and then store the contents of the file into one of my tables in the schema.I wrote one package for uploading the file and then a process to insert each record in the uploaded file to the table in my schema.When i try compiling the package it gives an error.
PL/SQL: ORA-00942: table or view does not exist
The name of the table is wwv_flow_file_objects$
The package is as follows-
CREATE OR REPLACE PACKAGE BODY Text_File_Pkg AS
FUNCTION get_file_lines (
p_file_name IN VARCHAR2,
p_lines IN OUT line_tab_type,
p_rec_sep IN VARCHAR2 DEFAULT dos_new_line
) RETURN INTEGER
IS
v_binary_file BLOB;
v_text_file CLOB;
v_dest_offset INTEGER := 1;
v_src_offset INTEGER := 1;
v_lang_context INTEGER := DBMS_LOB.default_lang_ctx;
v_warning INTEGER;
v_rec_sep_len CONSTANT INTEGER := LENGTH(p_rec_sep);
v_start_pos INTEGER := 1;
v_end_pos INTEGER := 1;
v_line_num INTEGER := 1;
v_file_length INTEGER;
BEGIN
IF p_file_name IS NULL
THEN
RETURN 1;
END IF;
IF p_rec_sep IS NULL
THEN
RETURN 2;
END IF;
SELECT blob_content
INTO v_binary_file
FROM wwv_flow_file_objects$
WHERE NAME = p_file_name
AND (mime_type = 'text/plain' OR mime_type = 'application/octet-stream')
AND doc_size > 0;
DBMS_LOB.createtemporary(v_text_file, TRUE);
DBMS_LOB.converttoclob(v_text_file, v_binary_file,
DBMS_LOB.lobmaxsize, v_dest_offset,
v_src_offset, DBMS_LOB.default_csid,
v_lang_context, v_warning);
IF v_warning = DBMS_LOB.warn_inconvertible_char
THEN
-- Unable to convert file.
RETURN 3;
END IF;
v_file_length := DBMS_LOB.getlength(v_text_file);
LOOP
EXIT WHEN v_start_pos > v_file_length;
v_end_pos := DBMS_LOB.INSTR(v_text_file, p_rec_sep, v_start_pos);
IF v_end_pos = 0
THEN
v_end_pos := v_file_length + 1;
END IF;
IF (v_end_pos - v_start_pos) > 4000
THEN
-- Line exceeds 4000 characters.
RETURN 4;
END IF;
p_lines(v_line_num) := DBMS_LOB.SUBSTR(v_text_file, v_end_pos - v_start_pos, v_start_pos);
v_line_num := v_line_num + 1;
v_start_pos := v_end_pos + v_rec_sep_len;
END LOOP;
RETURN 0;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
RETURN 5;
END get_file_lines;
END Text_File_Pkg;
Any suggestions.
Many Thanks,
Sanjai -
Scheduling error causing - ORA-00942: table or view does not exist
Hello
I have the following problem, I created an scenario that its supposed to run every 1 hour, it has an interface that moves an amount of records from one table to another (the amount of records is not fixed it changes). The problem arises when the amount of data to move is so big that the hour between executions is not enough and the scenario is still running when a second execution of the same scenario starts to run (as scheduled), so in the interface when the second process is trying to run the loading step it fails and I got the error ODI-1228 Caused By: java.sql.BatchUpdateException: ORA-00942: table or view does not exists. So the scenario fails and it logs this error. I think the error is due to the table in stage being locked by the first execution of the scenario.
I don't want to change the amount of time between executions because it is usually enough, I just want to avoid the execution of a scenario when there is another execution of the same scenario still running, is there any way to do this?.
Thanks
LJHello
Thanks for your answer, I already have the "Interval between repetitions" property set to 1 hour, but when one execution takes more than one hour the scheduler starts another and I have 2 processes accessing the same table and it is when I have a concurrence error on the staging table.
How can I ensure that I wont have two or more executions of the same scenario running at the same time?.
Thanks,
LJ -
Error(20,22): PL/SQL: ORA-00942: table or view does not exist
I am getting currently getting an error when I try and insert into a table from a different schema from my Stored Procedure:
Error(20,22): PL/SQL: ORA-00942: table or view does not exist
I am explicitly calling the table with the schema name infront i.e.
INSERT INTO SAPSR3.ZTREC_NAME_TYPE
MASTER_ID,
NAME_TYPE,
FAMILY_NAME,
FIRST_NAME,
MIDDLE_NAME,
TITLE
VALUES
In_MasterID,
In_NameType,
In_FamilyName,
In_FirstName,
In_MiddleName,
In_Title
I only get this error when I try and compile my stored procedure. If I try this insert not within a stored procedure (i.e. a blank script) it works perfectly.
Can anyone tell me what Im doing wrong?
Thanks.Hi,
It sounds like you (the procedure owner) have privileges on that table only through a role.
Roles don't count in stored procedures created with AUTHID OWNER (which is the default).
Either
(1) Have user SAPSR3 grant the necessary privileges directly to you (or to PUBLIC), or
(2) change the procedure so that it runs with the caller's privileges, by adding AUTHID CURRENT_USER after the argument list but before the keyword IS (os AS) like this:
CREATE OR REPLACE PROCEDURE foo
( x IN NUMBER
AUTHID CURRENT_USER
IS ... -
Error while deploy mapping ora-06550 table or view does not exist
Hi everyone,
i have a target source 'U_BCK' that cointains some Oracle table.
I have also created a target schema 'BCK_OWNER' where i create some dimensions and cubes with mappings.
My mappings connect some table from U_BCK with dimension or cube from BCK_OWNER.
My repository owner is called 'rep_owner' and i used this user to create every metadata.
Now i'm trying to deploy, and i don't have any problem until deploying mappings. When i try to deploy mappings i get some errors like ora-06550,ora-00942 table or view does not exist and statement ignored.
Please help me and sorry for my english...
Thanks,
Alex.The mapping, that drives the data from one table to another is deployed to the database as a PL/SQL package. When deploying your mapping fails, it most often means that the resulting PL/SQL package doesn't compile in the database.
Using Oracle SQL Developer (or Toad, SQL Navigator or any other tool) connect to the schema on the database where you have deployed the mapping. Open the pl/sql package and compile it. That should show you the place where the compilation fails, and give you an idea as to what table it can not find. Otherwise, in SQLPLUS, you can simply give the following command:
ALTER PACKAGE THE_PACKAGE_NAME_GOES_HERE compile body;
show errors;
As the database user who owns the source tables, make sure to issue a GRANT command for each of the source tables, granting SELECT access to the database user who owns the mapping:
grant select on TABLENAME to TARGETSCHEMA.
hope this helps
Borkur -
Error while deploying map: ORA-00942 Table or view does not exist
Hi OWB experts,
I'm having yet another problem with OWB, this time when I try to deploy a mapping I get this error:
ORA-06550: line 59, column 3:
PL/SQL: ORA-00942: table or view does not exist
DIM_01_ESTCON_MAP
ORA-06550: line 93, column 3:
PL/SQL: SQL Statement ignored
If I open the package that OWB created I see the errors:
CURSOR "DEDUP_SRC_0_IN2_c" IS
SELECT
"DEDUP_INPUT_SUBQUERY2$1"."ESTADOCONEXION_ID" "ESTADOCONEXION_ID",
"DEDUP_INPUT_SUBQUERY2$1"."ESTADOCONEXION_COD_ESTCON" "ESTADOCONEXION_COD_ESTCON",
"DEDUP_INPUT_SUBQUERY2$1"."ESTADOCONEXION_DESC_ESTCON" "ESTADOCONEXION_DESC_ESTCON",
"DEDUP_INPUT_SUBQUERY2$1"."STANDARD_TOTAL_COD_TTL" "STANDARD_TOTAL_COD_TTL"
FROM
(SELECT
DISTINCT
"DIM_01_ESTCON_MAP"."GET_CONST_CA_0_ESTADOCO" "ESTADOCONEXION_ID",
"ESTADOS"."ESTADO" "ESTADOCONEXION_COD_ESTCON",
"ESTADOS"."DESC_EST" "ESTADOCONEXION_DESC_ESTCON",
"DIM_01_ESTCON_MAP"."GET_TOTAL_C_0_TTLID" "STANDARD_TOTAL_COD_TTL"
FROM
"CONSULTA"."ESTADOS"@"PROD@AYADEV_LOCATION" "ESTADOS"
WHERE
( estado LIKE 'EC%' )) "DEDUP_INPUT_SUBQUERY2$1";
Where AYADEV_LOCATION points to the module/schema/location where my source data is.
Now, I have defined three modules:
SOURCE, where I defined the tables and other objects from the original database (source data)
STAGE, where I am performing all the transformations; here I defined all the maps
TARGET, this holds the dimensions and fact tables.
Now all three modules point to different databases. The dblink for AYADEV_LOCATION has been created and shouldn't present any problems. The username that I'm using to log on to the source database is current and I can connect to it through SQL+ or any other program (TOAD, SQLDeveloper).
What could be happening here? I'm using OWB 10g R2, with Oracle DB 10g R2.
I'd really appreciate any help you could provide.
Best Regards,
--Osvaldo
[osantos]Hi,
I'm still having problems but I found out why these tables are returning errors. The username I've been given by the DBA to connect to the database is CONSULTA, but this user is only for querying purposes, the actual objects reside on a differente schema, of course, which is PROD. So the line:
"CONSULTA"."ESTADOS"@"PROD@AYADEV_LOCATION" "ESTADOS"
raises an exception because the table ESTADOS is not located on that schema, but on PROD. If I query the table from SQL Plus with:
SELECT *
FROM [email protected]@AYADEV_LOCATION
then there's no problem at all.
Why is this? How do I instruct OWB to point to the correct schema or to avoind fully qualifying the table name?
Please help me, I'm kind of confused here.
Best Regards,
--oswaldo.
[osantos]
Maybe you are looking for
-
Can i copy playlists from one library to another
Hello i have just found out how to set up another library (by holding the 'alt' keydown when i open itunes - if there's another better way please tell me). what i really want is a way to separate my playlists from my child's, so i think i'm doing the
-
Error while running the SAP JCO java program running via command line
Hi, We are facing an issue while using SAP JCO. When i try to run the sample program using RAD 8.0 ( IBM IDE tool For Java Development) its working fine. The same sample program if i try to run using command line, Then its giving below exception
-
Hello, we are in the process of starting to implement WDS and have well over 100 access points. I've read 2 different docs from Cisco, 1 saying that the max # of APs in each WDS should be 30 and another document saying 100. Does anyone have any sugge
-
Hi, I'm trying to bring in P2 footage that has already been transferred to a GRaid drive using ShotPut. I watched Shane's excellent tutorial <http://library.creativecow.net/articles/rossshane/tapeless-workflowfcp-7/video-tutorial> about importing P2
-
Screen off while charging?
I seem to recall a settig where you have your Incredible screen off while charging....but I cannot find it again. Is there such a setting,or am I confusing it with something else? If there is this setting, how can I access it?