database - How to write connect user/password in procedure in oracle?
问题描述
I try to create a procedure to allow the user (with the username 'c##administrator' and password 'addm')to login into the oracle using the connect <user_name>/<password_name> like this. But it said that click here to see the errors that oracle said. When I try to detect what is wrong on my script, I realize that the script cannot execute the command EXECUTE IMMEDIATE 'connect c##administrator/addm;';
and said that it is invalid sql command :<. But I don't know why it said that. I'm sure my password and my username is both correct.
Please help me fix it :( Thank you so much
CREATE OR REPLACE PROCEDURE system.SYS_KTraTaiKhoanAdmin (adUsername IN varchar2, adPassword IN varchar2)
IS
ex EXCEPTION;
BEGIN
IF (adUsername != 'c##administrator' AND adPassword != 'addm') THEN
dbms_output.put_line('PLEASE LOG IN AGAIN');
ELSE
dbms_output.put_line('LOG IN SUCCESSFULLY!');
EXECUTE IMMEDIATE 'connect c##administrator/addm;';
END IF;
EXCEPTION
WHEN ex THEN
Raise_application_error(-1, 'Error');
END;
/
BEGIN
system.SYS_KTraTaiKhoanAdmin('c##administrator', 'addm');
--rollback;
END;
/
解决方案
推荐阅读
- html - Prettier:删除自闭标签前的额外空格 />
- cassandra - KairosDB H2 与 Cassandra
- javascript - Node js:当我从快速路由调用异步函数时,为什么会出现```TypeError: Cannot read property 'json' of undefined```?
- powershell - Azure Datalake Gen1 到 Azure 分析服务的服务到服务身份验证失败
- javascript - 单元测试角度ngrx组件
- wordpress - FPDF 图片不工作 - wordpress 插件
- javascript - 如何在 Cypress 中使用安全限制处理登录
- networking - 新的 Lamp Stack 部署网络接口不起作用
- amazon-s3 - 从 S3 复制数据时尝试映射列出现错误 SQL 编译错误:在“s3:bucket/file.csv.gz”中找到无效的 URL 前缀
- powershell - Powershell上的7zip命令无法解析?