Unix Technical Forum

numeric userids in db2 udb v8.1.9 linux

This is a discussion on numeric userids in db2 udb v8.1.9 linux within the DB2 forums, part of the Database Server Software category; --> Linux accepts the userid '00001', and I can login to my database with that userid. But when I try ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:14 AM
Bob Stearns
 
Posts: n/a
Default numeric userids in db2 udb v8.1.9 linux

Linux accepts the userid '00001', and I can login to my database with
that userid. But when I try to grant privileges to that userid I get:

DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC:
00001;user_animals TO USER;END-OF-STATEMENT
Message: An unexpected token "00001" was found following "user_animals
TO USER". Expected tokens may include: "END-OF-STATEMENT".

The grant statement is:

GRANT SELECT ON TABLE is3.user_animals TO USER 00001

The example in the SQL Reference Vol 2 is:

GRANT SELECT, INSERT ON CALENDAR TO USER PHIL, USER CLAIRE

TABLE is optional, I include for clarity. I an trying to grant only
SELECT to only USER 00001, so I think my general syntax is OK. My
question is:
Does db2 disallow purely numeric userids?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 08:14 AM
m
 
Posts: n/a
Default Re: numeric userids in db2 udb v8.1.9 linux

Bob Stearns wrote:
> Linux accepts the userid '00001', and I can login to my database with
> that userid. But when I try to grant privileges to that userid I get:
>
> DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC:
> 00001;user_animals TO USER;END-OF-STATEMENT
> Message: An unexpected token "00001" was found following "user_animals
> TO USER". Expected tokens may include: "END-OF-STATEMENT".
>
> The grant statement is:
>
> GRANT SELECT ON TABLE is3.user_animals TO USER 00001
>
> The example in the SQL Reference Vol 2 is:
>
> GRANT SELECT, INSERT ON CALENDAR TO USER PHIL, USER CLAIRE
>
> TABLE is optional, I include for clarity. I an trying to grant only
> SELECT to only USER 00001, so I think my general syntax is OK. My
> question is:
> Does db2 disallow purely numeric userids?


From the Administration Guide - Implementation:

General naming rules

7 Rules exist for the naming of all objects and *** users***. 7 Some of
these rules are specific to the platform you are working on. 7 For
example, there is a rule regarding the use of upper and lower case
letters in a name.

* On UNIX(R) platforms, names must be in lower case.
* On Windows(R) platforms, names can be in upper, lower, and
mixed-case.

Unless otherwise specified, all names can include the following characters:

* A through Z. When used in most names, characters A through Z are
converted from lowercase to uppercase.
* 0 through 9.
* 7 ! % ( ) { } . - ^ ~ _ (underscore) 7 @, #, $, and space.
* 7 \ (backslash).
---------------------------------------------------------------------
Names cannot begin with a number or with the underscore character.
---------------------------------------------------------------------

*** This means the userids that db2 likes CANNOT begin with a number......

Do not use SQL reserved words to name tables, views, columns, indexes,
or authorization IDs.

7 There are other special characters that might work separately
depending 7 on your operating system and where you are working with
DB2(R) Universal Database (DB2 UDB). 7 However, while they might work,
there is no guarantee that they will work. 7 It is not recommended that
you use these other special characters when naming objects in your database.

You also need to consider object naming rules, workstation naming rules,
naming rules in an NLS environment, and naming rules in a Unicode
environment.
Related concepts
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 08:14 AM
Bob Stearns
 
Posts: n/a
Default Re: numeric userids in db2 udb v8.1.9 linux

m wrote:

> Bob Stearns wrote:
>
>> Linux accepts the userid '00001', and I can login to my database with
>> that userid. But when I try to grant privileges to that userid I get:
>>
>> DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC:
>> 00001;user_animals TO USER;END-OF-STATEMENT
>> Message: An unexpected token "00001" was found following "user_animals
>> TO USER". Expected tokens may include: "END-OF-STATEMENT".
>>
>> The grant statement is:
>>
>> GRANT SELECT ON TABLE is3.user_animals TO USER 00001
>>
>> The example in the SQL Reference Vol 2 is:
>>
>> GRANT SELECT, INSERT ON CALENDAR TO USER PHIL, USER CLAIRE
>>
>> TABLE is optional, I include for clarity. I an trying to grant only
>> SELECT to only USER 00001, so I think my general syntax is OK. My
>> question is:
>> Does db2 disallow purely numeric userids?

>
>
> From the Administration Guide - Implementation:
>
> General naming rules
>
> 7 Rules exist for the naming of all objects and *** users***. 7 Some of
> these rules are specific to the platform you are working on. 7 For
> example, there is a rule regarding the use of upper and lower case
> letters in a name.
>
> * On UNIX(R) platforms, names must be in lower case.
> * On Windows(R) platforms, names can be in upper, lower, and
> mixed-case.
>
> Unless otherwise specified, all names can include the following characters:
>
> * A through Z. When used in most names, characters A through Z are
> converted from lowercase to uppercase.
> * 0 through 9.
> * 7 ! % ( ) { } . - ^ ~ _ (underscore) 7 @, #, $, and space.
> * 7 \ (backslash).
> ---------------------------------------------------------------------
> Names cannot begin with a number or with the underscore character.
> ---------------------------------------------------------------------
>
> *** This means the userids that db2 likes CANNOT begin with a number......
>
> Do not use SQL reserved words to name tables, views, columns, indexes,
> or authorization IDs.
>
> 7 There are other special characters that might work separately
> depending 7 on your operating system and where you are working with
> DB2(R) Universal Database (DB2 UDB). 7 However, while they might work,
> there is no guarantee that they will work. 7 It is not recommended that
> you use these other special characters when naming objects in your
> database.
>
> You also need to consider object naming rules, workstation naming rules,
> naming rules in an NLS environment, and naming rules in a Unicode
> environment.
> Related concepts

Thank you, I thought that might be the case, but the message is
certainly not clear.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:55 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com