user creation

Database
Enthusiast

user creation

Hi All,

i need a procedure/macro to create a new user in teradata system.

any relative threads or posts, please comment them

thanks in advance.

4 REPLIES
Teradata Employee

Re: user creation

You need to put the following command in a macro/SP, havent tried that if there is any limitation for it in SP/Macro .... but command is fairly simple:

CREATE USER marks

     FROM finance AS

     PERMANENT = 1000000,

     PASSWORD = finan1,

     SPOOL = 1200000,

     FALLBACK PROTECTION,

     DUAL AFTER JOURNAL,

     DEFAULT JOURNAL TABLE = finance.journals,

     DEFAULT DATABASE = finance,

     STARTUP = 'EXEC setpf;'

     ACCOUNT = '$mfinance','$hfinance';

 


Enthusiast

Re: user creation

hi adeel,

i have tried the above in sp/macro both and failed.

the basic proc i have is below and it is also failing with the error "Invalid SQL statement", please correct.

CREATE procedure NewUser (uname varchar, oner varchar, pwd varchar ) 

AS

(

CREATE USER :uname FROM :oner AS PERMANENT = 0

,PASSWORD = :pwd

,SPOOL = 0

);

Teradata Employee

Re: user creation

Build a character string containing the DDL statement, then execute it as dynamic SQL.

Enthusiast

Re: user creation

Hi Fred,

i am new to it so can you please help me with the query......

thanks in advance.....:)