Link to home
Start Free TrialLog in
Avatar of vemulayugandhar
vemulayugandhar

asked on

Problem while querying..

Hi
I have created a user tempdev1,i have given all the priveleges and he created some tables,it worked fine this morning.Its allowing to connect,but when he is trying to select..
select * from tab; its giving error ORA-00932,inconsistent datatypes?

Thanks
Avatar of vemulayugandhar
vemulayugandhar

ASKER

I will appreciate your help
Thanks
yugandhar
This is what Oracle manual says:
ORA-00932: inconsistent datatypes
Cause: Either

An attempt was made to perform an operation on incompatible datatypes. For example, adding a character field to a date field (dates may only be added to numeric fields) or concatenating a character field with a long field.
An attempt was made to perform an operation on a database object (such as a table or view) that is not intended for normal use. For example, system tables cannot be modified by a user. Note that on rare occasions this error occurs because a misspelled object name matched a restricted object's name.
An attempt was made to use an undocumented view.
Action: If the cause is

different datatypes, then use consistent datatypes. For example, convert the character field to a numeric field with the TO_NUMBER function before adding it to the date field. Functions may not be used with long fields.
an object not intended for normal use, then do not access the restricted object.
I did not find any errors in alert log file.I found that user did nothing,by looking into v$sqlarea.
Hi Try to select like this,

SELECT * FROM sys.tab;
Avatar of Mark Geerlings
Try:
select table_name from all_tables;

and
select view_name from all_view;

These two selects should be the almost the equivalent of "select * from tab;".
i did try to select connecting as that user,tempdev/tempdev but still its giving the same error.
If you connect as SYSTEM can you do a select?  Are there other user accounts that work fine?  Can your tempdev (or tempdev1?) user do inserts, updates or deletes?
Yes,i can select as system and also as another user,but cannot select connecting to this user only..
Do you have a standard script or procedure to create users?  If so, did you leave out a step?

Did you create this account manually in SQL*Plus or did you use a GUI tool like Enterprise Manager?  Can you do any selects as this user?
I created users manually at SVRMGR.
I cannot select any thing as this user.
If you create users manually in svrmgr or SQL*Plus, you should have (or develop) a script to help with this to make sure that you do not forget a privilege.

If you don't have data in tables owned by this user and if you do not have other objects (packages, procedures, views, etc.) for this user, you may want to drop this user and create a new user, making sure that you give the user the privileges he needs.
As markgeer says; your best bet is to drop and recreate this user and grant the user all the required privelege
My user has created around five tables and wrote some procedures on that table,now how can i drop that user...
Consider the following:
1. Use exp to export the user's schema
2. Assuming you have no LONG type columns, you can use the sql*plus copy command, or create table as select to copy tables and their data to another database user (you may need to perform grants first).
3. Use scripts or Enterprise manager to get all definitions of objects in the schema .
4. You can do selects from dba_objects to create a checklist of objects to re-create after dropping and recreating the user and his objects.
It is simpler than cadabra indicates.
1. Use export to export the users' schema.
2. From SQL*Plus as a DBA, do:
"drop user [username] cascade;"
3. Create the new user and give that account the security it needs.
4. Use import with "fromuser" and "touser" specified to get everything from the previous user's account into the new user's account.

All of this assumes that there is something seriously wrong with your current user's account.  Try creating another new user first, and make sure that that account can do what it should be able to do, before you do a "drop user" with the current account.
ASKER CERTIFIED SOLUTION
Avatar of DarkOra
DarkOra

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial