473,394 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

can not drop table but can not find dependence either

I try to drop a table as:
drop table sch.tab;
I got: During SQL processing it returned:
SQL0478N The object type "TABLE" cannot be dropped because there is
an object "sch.SQL070515104729271", of type "FUNCTION", which depends
on it. SQLSTATE=42893

Then I tried to do
>drop function sch.SQL070515104729271
but it says this is not defined. Actually, I tried to search that
function with
SELECT tabname FROM SYSCAT.TABLES
union SELECT procname FROM SYSCAT.procedures
union SELECT funcname FROM SYSCAT.functions
union SELECT pkgname FROM SYSCAT.packages
but failed to find that function name. I also search dependency by:
select bschema, bname, dschema, dname from sysibm.sysdependencies;
I found:
BSCHEMA BNAME DSCHEMA DNAME
sch tab sch SQL070515104729271
What does this mean to me? since I can not find what the heck is the
object "SQL070515104729271"
Thanks!

May 17 '07 #1
15 10759
uw****@gmail.com wrote:
I try to drop a table as:
>drop table sch.tab;

I got: During SQL processing it returned:
SQL0478N The object type "TABLE" cannot be dropped because there is
an object "sch.SQL070515104729271", of type "FUNCTION", which depends
on it. SQLSTATE=42893

Then I tried to do
>>drop function sch.SQL070515104729271

but it says this is not defined. Actually, I tried to search that
function with
I think that this is the *specific name*, try:

drop specific function sch.SQL070515104729271

You probably want to look at the function before dropping it, you should
be able to find it with:

select funcname, body from syscat.functions where specificname =
'SQL070515104729271'
/Lennart

May 17 '07 #2
Thanks for the quick reply!

I found the definition of the function SQL070515104729271 using the
command:
select funcname, body from syscat.functions where specificname =
'SQL070515104729271'
And I get:

SUMSALARIES CREATE FUNCTION SUMSALARIES(DEPT CHAR(3))
RETURNS DECIMAL(9,2)
LANGUAGE SQL
RETURN
SELECT sum(salary)
FROM employee
WHERE workdept = dept

However, as I try to drop this function: using either
drop specific function SQL070515104729271 ;
I get: SQL0658N The object "sch.SUMSALARIES" cannot be explicitly
dropped.
SQLSTATE=42917

I also tried:
drop function sumsalaries;
Which gives me the same error. How should I do then? thanks again!

On May 17, 2:18 pm, Lennart <erik.lennart.jons...@gmail.comwrote:
uwc...@gmail.com wrote:
I try to drop a table as:
drop table sch.tab;
I got: During SQL processing it returned:
SQL0478N The object type "TABLE" cannot be dropped because there is
an object "sch.SQL070515104729271", of type "FUNCTION", which depends
on it. SQLSTATE=42893
Then I tried to do
>drop function sch.SQL070515104729271
but it says this is not defined. Actually, I tried to search that
function with

I think that this is the *specific name*, try:

drop specific function sch.SQL070515104729271

You probably want to look at the function before dropping it, you should
be able to find it with:

select funcname, body from syscat.functions where specificname =
'SQL070515104729271'

/Lennart

May 17 '07 #3
uw****@gmail.com wrote:
However, as I try to drop this function: using either
drop specific function SQL070515104729271 ;
I believe you need to include the schema name as well as the specific
name of the function, i.e.:

DROP SPECIFIC FUNCTION SCH.SQL070515104729271;

I also tried:
drop function sumsalaries;

Which gives me the same error. How should I do then? thanks again!
Again, include the schema name. Furthermore, if the function has
overloaded versions (functions with the same name, but a different
parameter list), you will need to include the parameter list to
distinguish exactly which overloaded version you wish to drop, i.e.:

DROP FUNCTION SCH.SUMSALARIES(CHAR(3));

Alternatively, change the current schema to the schema containing the
function you wish to drop:

SET SCHEMA SCH;
DROP FUNCTION SUMSALARIES(CHAR(3));
HTH,

Dave.

--

May 17 '07 #4
uw****@gmail.com wrote:
I try to drop a table as:
>drop table sch.tab;

I got: During SQL processing it returned:
SQL0478N The object type "TABLE" cannot be dropped because there is
an object "sch.SQL070515104729271", of type "FUNCTION", which depends
on it. SQLSTATE=42893
Something else that the other posts didn't cover: your schema name is in
lower case. Thus, you have to put double-quotes around it so that DB2
won't convert it to upper case first and then search for the function in
the wrong schema. (Note that your shell may interfere with quotes. The
simples way to avoid that is to start a DB2 interactive shell.)

db2 =drop specific function "sch"."SQL070515104729271"

I used double-quotes for the (unqualified) function name as well, even if it
would not have been necessary because it is all upper case.
but it says this is not defined. Actually, I tried to search that
function with
SELECT tabname FROM SYSCAT.TABLES
union SELECT procname FROM SYSCAT.procedures
union SELECT funcname FROM SYSCAT.functions
union SELECT pkgname FROM SYSCAT.packages
Search in SYSCAT.ROUTINES and use the LIKE predicate on the SPECIFIC name.

SELECT *
FROM syscat.routines
WHERE specificname LIKE '%SQL070515104729271'
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
May 17 '07 #5
I doubled checked, and I did include the schema name with it. It
still can not find it. Moreover, I fail to select from
syscat.routines,
this is exactly what I copied from terminal:

select * from SYSCAT.ROUTINES;
SQL0204N "SYSCAT.ROUTINES" is an undefined name. SQLSTATE=42704
I am sure my function is not overloaded, and I tried:

db2set schema dedehaan;
db2drop table employee;
SQL0478N The object type "TABLE" cannot be dropped because there is
an object
"DEDEHAAN.SQL070515104729271", of type "FUNCTION", which depends on
it.
SQLSTATE=42893

db2 =drop function DEDEHAAN.SQL070515104729271;
SQL0204N "DEDEHAAN.SQL070515104729271" is an undefined name.
SQLSTATE=42704
Any clue? btw, I am using db2 :

$ db2level
DB21085I Instance "db2_inst" uses DB2 code release "SQL07020" with
level
identifier "03010105" and informational tokens "DB2 v7.1.0.40",
"s010415" and
"U475377".
May 18 '07 #6
Any clue? btw, I am using db2 :
>
$ db2level
DB21085I Instance "db2_inst" uses DB2 code release "SQL07020" with
level
identifier "03010105" and informational tokens "DB2 v7.1.0.40",
"s010415" and
"U475377".
Oh! Replace SYSCAT.ROUTINES with SYSCAT.FUNCTIONS
And ROUTINENAME with FUNCNAME in your queries.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 18 '07 #7
uw****@gmail.com wrote:
Thanks for the quick reply!

I found the definition of the function SQL070515104729271 using the
command:
> select funcname, body from syscat.functions where specificname =
'SQL070515104729271'
And I get:

SUMSALARIES CREATE FUNCTION SUMSALARIES(DEPT CHAR(3))
RETURNS DECIMAL(9,2)
LANGUAGE SQL
RETURN
SELECT sum(salary)
FROM employee
WHERE workdept = dept

However, as I try to drop this function: using either
>drop specific function SQL070515104729271 ;

I get: SQL0658N The object "sch.SUMSALARIES" cannot be explicitly
dropped.
SQLSTATE=42917

I also tried:
>drop function sumsalaries;

Which gives me the same error. How should I do then? thanks again!
either do:

drop specific function SQL070515104729271 restrict

or

select funcschema, funcname, body from syscat.functions where specificname =
'SQL070515104729271'

then:

drop function <funcschema>.<funcnamerestrict

also beware Knuts info regarding ucase

/Lennart

>

On May 17, 2:18 pm, Lennart <erik.lennart.jons...@gmail.comwrote:
>uwc...@gmail.com wrote:
I try to drop a table as:
>drop table sch.tab;
I got: During SQL processing it returned:
SQL0478N The object type "TABLE" cannot be dropped because there is
an object "sch.SQL070515104729271", of type "FUNCTION", which depends
on it. SQLSTATE=42893
Then I tried to do
>>drop function sch.SQL070515104729271
but it says this is not defined. Actually, I tried to search that
function with

I think that this is the *specific name*, try:

drop specific function sch.SQL070515104729271

You probably want to look at the function before dropping it, you should
be able to find it with:

select funcname, body from syscat.functions where specificname =
'SQL070515104729271'

/Lennart

May 18 '07 #8
On May 19, 2:08 am, %NAME% <huaxinzh...@gmail.comwrote:
db2set schema dedehaan;
db2drop table employee;
SQL0478N The object type "TABLE" cannot be dropped because there is
an object
"DEDEHAAN.SQL070515104729271", of type "FUNCTION", which depends on
it.
SQLSTATE=42893

db2 =drop function DEDEHAAN.SQL070515104729271;
SQL0204N "DEDEHAAN.SQL070515104729271" is an undefined name.
SQLSTATE=42704

Any clue? btw, I am using db2 :
How about this?
db2drop specific function DEDEHAAN.SQL070515104729271;

May 19 '07 #9
I guess my problem is more serious than i once thought. I have
tried all possible means as you guys suggested, so here are them all:

db2 =select funcschema, funcname, specificname from syscat.functions
where funcschema='DEDEHAAN'

FUNCSCHEMA FUNCNAME SPECIFICNAME
-------------------------------------------------------------------------------------
DEDEHAAN SUMSALARIES SQL070515104729271
DEDEHAAN DEPTSALARIESF SQL070515141344272

2 record(s) selected.
db2=drop function DEDEHAAN.sumsalaries
SQL0658N The object "DEDEHAAN.SUMSALARIES" cannot be explicitly
dropped.
SQLSTATE=42917

db2 =drop specific function "DEDEHAAN"."SQL070515104729271"
SQL0658N The object "DEDEHAAN.SUMSALARIES" cannot be explicitly
dropped.
SQLSTATE=42917

It occurs me to see the dependency, so I tried below:

db2 =select * from sysibm.sysdependencies

BNAME BSCHEMA BTYPE DNAME DSCHEMA TABAUTH
DTYPE
-----------------------------------------------------------------------------------------------------------
------- -----
P3650010 DB2_INST K DRPSCHEMA DB2_INST
0 L
EMPLOYEE DEDEHAAN T SQL070515104729271 DEDEHAAN 32 F
EMPLOYEE DEDEHAAN T SQL070515141344272 DEDEHAAN 32 F
P1344330 DEDEHAAN K SQL070515141344330 DEDEHAAN 0
L
P1345740 DEDEHAAN K SQL070515141345750 DEDEHAAN 0
L

5 record(s) selected.

But this does not tell me what to do

I also tried :

==drop specific function SQL070515104729271 restrict
(syntax error)

SO... I have no clue what to do next...
Thanks for your help again....

May 23 '07 #10
Ian
uw****@gmail.com wrote:
>
SO... I have no clue what to do next...
Thanks for your help again....
Out of curiosity, what is the create_time in SYSCAT.FUNCTIONS for these
objects? Is it in the future?
May 23 '07 #11
Do you have distinct types? Are these cast functions?
Or are these really METHODS in a structured type?

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 23 '07 #12
uw****@gmail.com wrote:
I guess my problem is more serious than i once thought. I have
tried all possible means as you guys suggested, so here are them all:

db2 =select funcschema, funcname, specificname from syscat.functions
where funcschema='DEDEHAAN'

FUNCSCHEMA FUNCNAME SPECIFICNAME
-------------------------------------------------------------------------------------
DEDEHAAN SUMSALARIES SQL070515104729271
DEDEHAAN DEPTSALARIESF SQL070515141344272

2 record(s) selected.
db2=drop function DEDEHAAN.sumsalaries
SQL0658N The object "DEDEHAAN.SUMSALARIES" cannot be explicitly
dropped.
SQLSTATE=42917

db2 =drop specific function "DEDEHAAN"."SQL070515104729271"
SQL0658N The object "DEDEHAAN.SUMSALARIES" cannot be explicitly
dropped.
SQLSTATE=42917
Can you post the code for DEDEHAAN.sumsalaries? If its an sql function
you can find it in syscat.functions (body?)

/Lennart

[...]
May 24 '07 #13
Lennart wrote:
[...]
>
Can you post the code for DEDEHAAN.sumsalaries? If its an sql function
you can find it in syscat.functions (body?)
and deptsalaries as well

/Lennart

[...]
May 24 '07 #14
Here is the function definition:
CREATE FUNCTION DEPTSALARIESF(DEPT CHAR(3))
RETURNS TABLE(SALARY DECIMAL(9,2))
LANGUAGE SQL
RETURN
SELECT salary
FROM employee
WHERE workdept = dept
CREATE FUNCTION SUMSALARIES(DEPT CHAR(3))
RETURNS DECIMAL(9,2)
LANGUAGE SQL
RETURN
SELECT sum(salary)
FROM employee
WHERE workdept = dept

Here is the definition of the table:
db2 =describe table dedehaan.employee;
Column Type Type
name schema name Length
Scale Nulls
------------------------------ --------- ------------------ --------
----- -----
EMPNO SYSIBM CHARACTER
6 0 No
FIRSTNME SYSIBM VARCHAR
12 0 No
MIDINIT SYSIBM CHARACTER
1 0 No
LASTNAME SYSIBM VARCHAR
15 0 No
WORKDEPT SYSIBM CHARACTER
3 0 Yes
PHONENO SYSIBM CHARACTER
4 0 Yes
HIREDATE SYSIBM DATE
4 0 Yes
JOB SYSIBM CHARACTER
8 0 Yes
EDLEVEL SYSIBM SMALLINT
2 0 No
SEX SYSIBM CHARACTER
1 0 Yes
BIRTHDATE SYSIBM DATE
4 0 Yes
SALARY SYSIBM DECIMAL
9 2 Yes
BONUS SYSIBM DECIMAL
9 2 Yes
COMM SYSIBM DECIMAL
9 2 Yes
I can not drop the table, nor any of the two functions defined on it.
there is no
user-defined data structure in the functions, as i can see....
>
Can you post the code for DEDEHAAN.sumsalaries? If its an sql function
you can find it in syscat.functions (body?)

and deptsalaries as well
/Lennart
[...]- Hide quoted text -

- Show quoted text -

May 24 '07 #15
I think this should be a PMR.
A db2trc should be run to find out what DB2 is upset about.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 24 '07 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Leslie | last post by:
I have 2 dlls and they reference each other, thus causing the circular dependence error. I have read about other cases and people say use Interfaces to solve the problem with the shared methods. ...
5
by: simon_s_li | last post by:
Hi, I have 5 fields in line where I need to drag and drop the text from one field to another field and then all the fields need to re-order themselves. So for instance if I drag the text in...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
2
by: tpaulson | last post by:
I have a couple of DIV's that I hide/display based on radio buttons. On the DIV's, I have multiple drop down boxes. The source shows that they are populated, but I can't make them drop down. Only...
2
by: Timbo | last post by:
Hi there, I’m not used to working in VB and I think this situation calls for excactly that. I use Access 97 SR-2. My first table is a table containing all the Tickets I got. The field ”Ticket”...
3
by: Rahul B | last post by:
Hi, I have a user UCLDEV1 which is a part of staff and a group(db2schemagrp1) to which i have not given any permissions. The authorizations of that user are shown as db2 =get authorizations...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
4
by: Joseph | last post by:
Can i drop a cloumn from a table in DB2 for Z/OS?
10
by: Dean | last post by:
My client has a db I am working that uses temp tables. During an update procedure, I had the code If fTableExists(tempTblName) = True Then DoCmd.DeleteObject acTable, tempTblName Then I thought...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.