- 论坛徽章:
- 0
|
本帖最后由 hartball38 于 2014-08-29 13:44 编辑
您好:
請問
若有一個表格:
CREATE TABLE student (
id smallint PRIMARY KEY,
first_name VARCHAR(80) NOT NULL,
last_name VARCHAR(80) NOT NULL);
insert into student VALUES(10,'AA','A01');
insert into student VALUES(30,'BB','B01');
---MSSSQL OK
declare @v_first varchar(10);
set @v_first='AA';
select * from student where first_name=@v_first;
但是在ORACLE, 該如何來用呢?
---以下語法錯誤...
declare v_first varchar2(10);
BEGIN
v_first :='AA';
select * from student where first_name= v_first;
END;
---->
命令的第 19 行開始發生錯誤 -
declare v_first varchar2(10);
BEGIN
v_first :='AA';
select * from student where first_name= v_first;
END;
錯誤報告 -
ORA-06550: 第 4 行, 第 3 個欄位:
PLS-00428: 在此 SELECT 敘述句中預期會出現一個 INTO 子句
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action: |
|