PLSQL错误-ORA-00984:此处不允许使用列 [英] PLSQL error - ORA-00984: column not allowed here
本文介绍了PLSQL错误-ORA-00984:此处不允许使用列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经编写了一个PL-SQL块
I have written a PL-SQL block
DECLARE
SchemaName VARCHAR2(50) :='REQ_SUNIL_5750';
userpassword VARCHAR2(50) :='XYZ';
stmt VARCHAR2(5000);
BEGIN
stmt :='INSERT INTO ' || SchemaName || '.USER_CREDS VALUES ('|| SchemaName ||', '|| userpassword ||' )';
DBMS_OUTPUT.PUT_LINE(stmt) ;
EXECUTE IMMEDIATE stmt;
commit;
END;
当我执行上面的代码块时,我将到达下面的代码, ORA-00984:此处不允许使用列
When I execute above block I am getting below, ORA-00984: column not allowed here
我创建了名称为'REQ_SUNIL_5750.USER_CREDS的表,它具有用户名和密码列 请帮助
I have created table with name 'REQ_SUNIL_5750.USER_CREDS and it has username and password columns Please help
推荐答案
您必须正确引用字符串值:
You have to quote your string values properly:
stmt :='INSERT INTO ' || SchemaName ||
'.USER_CREDS VALUES ('''|| SchemaName ||''', '''|| userpassword ||''' )';
这篇关于PLSQL错误-ORA-00984:此处不允许使用列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文