DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: DDL in Stored Procedure

  1. #1
    Join Date
    Dec 2000
    Posts
    87
    Hi all,

    I'm trying to have these lines below as part of a procedure

    cSql_statement:='create user '||AddNewFITSUser.MDSUser||' identified by '||AddNewFITSUser.MDSUser;

    execute immediate cSql_statement;

    cSql_statement:='grant maintenance to '||AddNewFITSUser.MDSUser;

    execute immediate cSql_statement;

    compiler didn't complain nor when I was calling the procedure, it said procedure executed successfully. But when I check the user, it wasn't created. Anybody know why?

    Thanks.

  2. #2
    Join Date
    Jul 2000
    Posts
    296
    Maybe there is an error, but it's handled in the exception handler, something like:
    WHEN OTHERS THEN
    NULL;


  3. #3
    Join Date
    Dec 2000
    Posts
    87
    Can't found what's wrong! Tried everything possible.

  4. #4
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    I doubt that you can run the DDL in a procedure. The way to do this would be to call the dbms_sql.execute and pass the statement to that. That would help you to execute the DDL, I hope. It had been a v.long time I was in the coding.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  5. #5
    Join Date
    Oct 2000
    Posts
    123
    Run DDL in procedure like this way is possible, i suspect some role related problems? Try set role none or all separately, and then run test the code.

    Take care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width