学习pl/sql中有个习题:
编写一个过程为班级每位同学创建一个用户,用户名和密码都是:“班级号+学号”, 并为每位用户授权:CONNECT 和 RESOURCE。
编写了如下过程语言,运行时提示出错,请大侠帮忙看看!
DECLARE
CURSOR curs IS SELECT * FROM scott.stu_infos;
crow scott.stu_infos%ROWTYPE;
account_pwd VARCHAR(30);
sql_mt VARCHAR(100);
BEGIN
FOR crow in curs LOOP
account_pwd:=TO_CHAR(crow.classno) || TO_CHAR(crow.stuno);
dbms_output.put_line(account_pwd);
CREATE USER account_pwd IDENTIFIED BY account_pwd ACCOUNT UNLOCK;
GRANT CONNECT TO account_pwd;
GRANT RESOURCE TO account_pwd;
END LOOP;
END;
报错:
对你这段编写方式,看着很费解。第一命名规则不统一,格式不统一。大小写不统一,等等,最后还没看懂
老哥,稳!