[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] why isn't this working?



I think you may need to use brackets around your variables for
Begin-Select and Begin-Sql blocks.

grant select on [&table_name] to [$user_name]

You might have to move &table_name to a $ variable first.



Daniel Brinkley
Programmer/Analyst
Techneglas, Inc.
Columbus, OH

>>> ceprn@hotmail.com 05/16/2003 10:36:36 AM >>>
SQR v
Psoft v8.4 AR
db2 udb v7.2
RS/6000 AIX 4.3.3 ML10

I have created an SQR to create user aliases and apply grants for all
the 
34,000 objects that the idiots of peoplesoft have created and I am
getting 
an error message.  I know it is possible to perform ddl with an SQR,
but is 
this a limitation?

code:

!
------*-*-----------------------&---------(--,----)------------*-*---+
!        - CREATE GRANT -                                         |
!        - desc :                                                    - 
  |
!        - proc : 11                                              -   
|
!        - from :  8                                              -   
|
!        - 30-Apr-2003 [CW]                                       -   
|
!
------*-*-----------------------&---------(--,----)------------*-*---+

begin-procedure create_grant

show 'Entering CREATE GRANT :  proc 11 '
let $error_routine = 'CREATE GRANT'
#debug show ' Now in CREATE GRANT'
show 'Table name = |' &table_name '|'
show 'User  name = |' $user_name '|'

begin-sql   on-error = invalid_sql

grant select on &table_name to $user_name

end-sql

show 'Exiting  CREATE GRANT'

end-procedure ! CREATE GRANT

error:

Entering BEGIN PROGRAM :  proc  0
Entering START UP :  proc  4
Exiting  START UP
Entering GET PASSED VALUES :  proc 10
Please input the user to create grants and aliases for : : loriv
Exiting  GET PASSED VALUES
Entering MAIN :  proc  8
Entering CREATE GRANT :  proc 11
Table name = |PS_1099C_CUST_DATA|
User  name = |loriv|
Entering INVALID SQL :  proc 14
SQL0104N  An unexpected token "? to ?" was found following "grant
select on 
".

Expected tokens may include:  "<spa


Error message number:    -104
Entering HEADING :  proc  e
Exiting  HEADING
Entering SUB HEADING :  proc  1
Exiting  SUB HEADING
Exiting  HEADING
Entering FOOTING :  proc  f
Exiting  FOOTING

Cursor Status:

Does anyone have any ideas on how to get this to work?  I don't want to
have 
to do this nonsense by hand, or have to create an sql script.

clark 'the dragon' willis


PSA: Salary <> Slavery.  If you earn a salary, your employer is renting
your 
services for 40 hours a week, not purchasing your soul.  Your time is
the 
only real finite asset that you have, and once used it can never be 
recovered, so don't waste it by giving it away.

"Time is the coin of your life. It is the only coin you have, and only
you 
can determine how it will be spent.  Be careful lest you let other
people 
spend it for you."

Carl Sandburg
(1878 - 1967)

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users