Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/211.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
For loop 将序列号插入Oracle PL/SQL数据库_For Loop_Plsql_Oracle10g - Fatal编程技术网

For loop 将序列号插入Oracle PL/SQL数据库

For loop 将序列号插入Oracle PL/SQL数据库,for-loop,plsql,oracle10g,For Loop,Plsql,Oracle10g,我试图在数据库中插入一系列数字。这是我的代码,但不起作用: DECLARE j number(10) ; BEGIN FOR j IN 1001020930..1001021930 LOOP INSERT INTO PROD.issue_id(j,'NEW',null) END LOOP; END; 表结构: VARCHAR2 (128 BYTE) VARCHAR2 (10 BYTE) DATE 这是错误代码: Error starting at line 1 in

我试图在数据库中插入一系列数字。这是我的代码,但不起作用:

DECLARE 
  j number(10) ;
BEGIN
  FOR j IN 1001020930..1001021930
  LOOP
    INSERT INTO PROD.issue_id(j,'NEW',null)
  END LOOP;
END;
表结构:

VARCHAR2 (128 BYTE)
VARCHAR2 (10 BYTE)
DATE
这是错误代码:

Error starting at line 1 in command:
DECLARE 
  j number(10) ;
BEGIN
  FOR j IN 1001020930..1001021930
  LOOP
    INSERT INTO PROD.issue_id(j,'NEW',null)
  END LOOP;
END;
Error report:
ORA-06550: line 6, column 42:
PL/SQL: ORA-01747: invalid user.table.column, table.column, or column specification
ORA-06550: line 6, column 5:
PL/SQL: SQL Statement ignored
ORA-06550: line 8, column 4:
PLS-00103: Encountered the symbol ";" when expecting one of the following:

   loop
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

我不理解这些错误,因为我对PL/SQL非常陌生,您在insert语句中遗漏了
命令,并且insert语句没有以分号结尾

    DECLARE
    j    NUMBER (10);
BEGIN
    FOR j IN 1001020930 .. 1001021930
    LOOP
        INSERT INTO   issue_id
              VALUES   (j, 'NEW', SYSDATE);
    END LOOP;
END;