my proc is:
create or replace PROCEDURE SP_TBL_COMPARE_TEST3(
SRC_COLS IN VARCHAR2,
TGT_COLS IN VARCHAR2)
IS
CNT1 NUMBER(5);
SQL_TEXT2 VARCHAR(4000);
BEGIN
SQL_TEXT2:= 'select count(*) from (select regexp_substr('||src_cols||','||'[^,]+'||', +1, level) from dual connect by regexp_substr('||src_cols||','||'[^,]+'||', +1, level) is not null )';
EXECUTE IMMEDIATE SQL_TEXT2 into CNT4;
END
I am trying to get the input for the src cols and separating to count them but i am getting invalid identifier error. but the columns are available in the input and it is accurate
Connecting to the database sp_test. ORA-00936: missing expression ORA-06512: at "SP_TEST.SP_TBL_COMPARE_TEST3", line 19 ORA-06512: at line 13 Process exited. Disconnecting from the database sp_test
can anyone tell me what is wrong?
select regexp_count('1,2,3,4', ',')+1 from dual;. Of course make sure the data does not contain the delimiter.