我想为某些特定的表设置特权。这些tableNames也存储在类似架构(schemaName)的变量(tableName)中。我的任务是将这些变量隐藏为schemaName.tableName。
我尝试隐藏这些变量,但最终导致未定义变量。
GRANT SELECT ON schemaName || "." || tableName TO roleName;
有没有办法像PHP中那样使用变量变量? example
答案 0 :(得分:0)
您不能使用静态语句来执行此操作。 GRANT语句不允许将变量用于架构或表名称。
在存储过程中,可以改为使用动态语句。像这样:
var responce;
var n1, n2, n3, n4, sum;
var m1, m2, mion;
responce = window.confirm("Click OK to add,\nClick Cancel to subtract");
if (responce) {
function add(number1, number2, number3, number4) {
sum = n1 + n2 + n3 + n4;
document.write("Adding your numbers gives you the effect of:" + sum);
}
n1 = parseFloat(prompt("Enter a Number", "0"));
n2 = parseFloat(prompt("Enter a second number", "0"));
n3 = parseFloat(prompt("Give a third number", "0"));
n4 = parseFloat(prompt("Enter a fourth number", "0"));
} else {
function noadd(number5, number6) {
mion = m1 - m2;
document.write("Subtracting your numbers is the result that is:" + mion);
}
m1 = parseFloat(prompt("Enter a Number", "0"));
m2 = parseFloat(prompt("Enter a second number", "0"));
}
add(n1, n2, n3, n4);
noadd(m1, m2);