0

I am accessing a Sybase database and have created a new user using:

CREATE USER "ThisNewUser" IDENTIFIED BY "ThisNewPassword";

I then granted privleges:

GRANT ALL TO "ThisNewUser"

I used the output from this:

select 'grant all on ' + name + ' to "ThisNewUser";' from sysobjects where type = 'U' or type = 'P'
go

Looking at the results from this query, my new user has all permissions:

SELECT DISTINCT SU.name, 
                SP.selectauth, 
                SP.insertauth, 
                SP.deleteauth, 
                SP.updateauth, 
                SP.updatecols, 
                SP.alterauth 
FROM SYSTABLEPERM SP
JOIN SYSUSERS SU on SU.uid = SP.grantee
ORDER BY SU.Name

When I search for all tables in the current database, I can see the tables I want:

select table_name from systable order by table_name

When I try doing a basic select query SELECT * FROM Customers, I get the error Table Customer not found

My queries work just fine if I log in as the root user, but not with my new user account. What am I missing here?

FYI, The server is running dbeng16.exe, but when I installed the Sybase Central 16 GUI to connect, I got the message that the DB version was version 10 and needed to be upgraded. I have no trouble accessing the old DB using the dbisqlc app, which has let me run all the commands on it, and I exported the DB to a new upgraded DB where I also tested, but neither situations work.

10
  • Does ThisNewUser own the Customers table? if not, have you tried adding the owner to the query, eg, assuming 'DBA' owns the Customers table the query would be: select * from DBA.Customers?
    – markp-fuso
    Aug 30, 2018 at 16:32
  • I did try using the owner account as you suggested, it still could not find the table
    – Alan
    Aug 30, 2018 at 16:36
  • what user did you issue the 'grant' commands under?
    – markp-fuso
    Aug 30, 2018 at 16:45
  • I used the same user that had access to those tables
    – Alan
    Aug 30, 2018 at 16:53
  • have you tried issuing the grant's by the user that owns the tables in question?
    – markp-fuso
    Aug 30, 2018 at 17:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.