今天我有下一个问题:
使用此代码,我试图从新表中获取值:
declare
env_tablaname VARCHAR2(250) := :envtablaname;
contador number;
query_acciones VARCHAR2(500);
query_select VARCHAR2(32500);
query_delete VARCHAR2(32500);
query_select_local VARCHAR2(32500);
TYPE TiposDeAcciones IS REF CURSOR;
acciones TiposDeAcciones;
accion_record LOCAL_TEST_TABLE%ROWTYPE;
select_columns sys_refcursor;
first BOOLEAN := true;
re_table VARCHAR2(100);
re_column VARCHAR2(100);
re_upcomment VARCHAR2(100);
re_locomment VARCHAR2(100);
l_sep VARCHAR2(1) := chr(10);
l_tab VARCHAR2(1) := chr(9);
begin
query_select_local := 'select ';
open select_columns for
SELECT c.table_name,
uc.column_name,
upper(co.comments) up_comments,
co.comments low_comment
FROM user_constraints c
INNER JOIN user_cons_columns uc ON ( c.constraint_name = uc.constraint_name )
inner join user_col_comments co on ( co.table_name = c.table_name and uc.column_name = co.column_name)
WHERE c.table_name = upper(env_tablaname)
AND c.constraint_type IN ('U');
LOOP FETCH select_columns INTO
re_table,
re_column,
re_upcomment,
re_locomment;
EXIT WHEN select_columns%notfound;
IF NOT first THEN
query_select_local := query_select_local || ',';
END IF;
first := false;
query_select_local := query_select_local || re_upcomment;
end loop;
close select_columns;
query_select_local := query_select_local || ' from local_test_table where action not like (''='')';
dbms_output.put_line('query_select_local: ' || l_sep || query_select_local);
OPEN acciones FOR query_select_local;
LOOP FETCH acciones INTO
accion_record;
EXIT WHEN acciones%NOTFOUND;
dbms_output.put_line(l_rec.origin);
end loop;
close acciones;
end;
但是我有下一个错误:
Informe de error -
ORA-01007: la variable no está en la lista de selección
ORA-06512: en línea 63
01007. 00000 - "variable not in select list"
*Cause:
*Action:
我不知道怎么了? 有可能这样做吗?
有人可以帮助我理解这一点并解决我的问题吗?
最诚挚的问候