Oracle 无法解决ORA-06550错误pl/sql代码

Oracle 无法解决ORA-06550错误pl/sql代码,oracle,select,plsql,Oracle,Select,Plsql,我看到有几个类似的问题,但没有一个答案能够解决我的问题,这就是为什么我在这里发布代码。我感谢你的帮助。当我运行代码时,我得到: ORA-06550: line 23, column 25: PL/SQL: ORA-00933: SQL command not properly ended ORA-06550: line 23, column 1: PL/SQL: SQL Statement ignored create table city (cityid numeric(10), cityn

我看到有几个类似的问题,但没有一个答案能够解决我的问题,这就是为什么我在这里发布代码。我感谢你的帮助。当我运行代码时,我得到:

ORA-06550: line 23, column 25:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 23, column 1:
PL/SQL: SQL Statement ignored

create table city
(cityid numeric(10),
cityname varchar2(20),
cityregion varchar(20),
citypopulation INT,
constraint city_pk primary key (cityid));


declare
c_id  number := 0 ;
c_name varchar2(30) ;
c_region varchar2(30);
c_pop number;
time_now timestamp;
time_after timestamp;
cityid_copy city.cityid%type;

begin
while (c_id <= 3000)
loop
c_name    := 'City' || c_id;
c_region  := 'Region' || c_id;
c_pop     := c_id + 500;
INSERT INTO city
(cityid,cityname,cityregion,citypopulation)
values(c_id,c_name,c_region,c_pop);
c_id := c_id +1;
end loop;
time_now := systimestamp;
select cityid from city into cityid_copy
where cityid = 1;
time_after := systimestamp;
Dbms_Output.Put_Line((time_after)- (time_now));
ORA-06550:第23行第25列:
PL/SQL:ORA-00933:SQL命令未正确结束
ORA-06550:第23行第1列:
PL/SQL:SQL语句被忽略
创建表格城市
(城市ID数字(10),
城市名称varchar2(20),
城市地区瓦查尔(20),
城市人口,
约束city_pk主键(cityid));
声明
c_id编号:=0;
c_name varchar2(30);
c_区varchar2(30);
c_pop编号;
时间戳;
时间戳后的时间;
城市ID_复制城市。城市ID%类型;
开始

而(c_id您还没有完全掌握PL/SQL
SELECT…INTO…
语句的语法。您要选择的变量必须位于
FROM
子句之前

若要修复错误,请替换此行

select cityid from city into cityid_copy
select cityid into cityid_copy from city 
用这条线

select cityid from city into cityid_copy
select cityid into cityid_copy from city 

您还没有完全理解PL/SQL
SELECT…INTO…
语句的语法。您要选择的变量必须位于
FROM
子句之前

若要修复错误,请替换此行

select cityid from city into cityid_copy
select cityid into cityid_copy from city 
用这条线

select cityid from city into cityid_copy
select cityid into cityid_copy from city 

您还没有完全理解PL/SQL
SELECT…INTO…
语句的语法。您要选择的变量必须位于
FROM
子句之前

若要修复错误,请替换此行

select cityid from city into cityid_copy
select cityid into cityid_copy from city 
用这条线

select cityid from city into cityid_copy
select cityid into cityid_copy from city 

您还没有完全理解PL/SQL
SELECT…INTO…
语句的语法。您要选择的变量必须位于
FROM
子句之前

若要修复错误,请替换此行

select cityid from city into cityid_copy
select cityid into cityid_copy from city 
用这条线

select cityid from city into cityid_copy
select cityid into cityid_copy from city 

对不起,我终于弄明白了。INTO子句应该紧跟在投影之后:选择cityid到cityid\u copy from city

对不起,我终于弄明白了。INTO子句应该紧跟在投影之后:选择cityid到cityid\u copy from city

对不起,我终于弄明白了。INTO子句应该ld follow紧跟在投影之后:选择cityid到cityid\u copy from city

对不起,我终于弄明白了。into子句应该紧跟在投影之后:选择cityid到cityid\u copy from city