run string as query in oracle
问题 i got a little problem in Oracle. I try to create a sequence for generating IDs in a table that already has data in it. I try to use the following anonymous block. declare y varchar2(2000); BEGIN SELECT 'CREATE SEQUENCE ID_SEQ MINVALUE 1 MAXVALUE 9999999999 START WITH ' || (max(ID)+1) || ' INCREMENT BY 1 CACHE 20;' INTO y FROM TEST_TABLE; --dbms_output.put_line(y); execute immediate y; end; I get the following error: Error report: ORA-00911: invalid character ORA-06512: at line 5 00911. 00000