Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 22 Feb 2008 @ 18:22:05 GMT

  <Prev Next>  
Next> Last>>  

Subj:   Stored Procedure error SPL1031
From:   Hassinger, Bill

I am creating a stored procedure to revoke logons for dormant account. Below is the Text and error codes, can someone help me correct the problem?

     CREATE PROCEDURE sysdba.DormantUser()
     /* declare Variables */
     DECLARE userid CHAR(8);
     /* create cursor */
     FOR Dormant AS secondcurse CURSOR FOR
     SELECT UserName
     FROM DBC.Allusers
     WHERE (UserName LIKE 'student_1%')
     /* process records */
     SET userid = Dormant.UserName ;
     REVOKE Logon ON ALL TO :userid ;
     INSERT   INTO  mmadmindb.removeaccess(
           loginid      ,DateofAction    ,   ReasonCode ,
     CommentText ,                        AdminID)
     SELECT   :UserId      ,DATE                      ,'r'
     , 'Logon Revoked as Dormant Account' ,
             USER ;
     END FOR;


     SPL1031:E(L12), Referring to undefined alias 'UserName'._

     SPL1027:E(L13), Missing/Invalid SQL statement'E(3707):Syntax error,
     expected something like a name between the 'TO' keyword and  ...


Bill H

  <Prev Next>  
Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020