1

这是代码:

http://sqlfiddle.com/#!4/ee7da/4247


CREATE TABLE supportContacts 
(
 id int primary key, 
 type varchar2(20), 
 details varchar2(40)
)
/

INSERT INTO supportContacts
(id, type, details)
VALUES
(1, 'Email', 'admin@sqlfiddle.com')

/

INSERT INTO supportContacts
(id, type, details)
VALUES
(2, 'Twitter', '@sqlfiddle')


DECLARE
 x supportContacts.type%type;
 y supportContacs.details%type;
BEGIN 
  select type,details into x,y from supportContacts where id = 1;
  dbms_output.put_line(x);
  dbms_output.put_line(y);
END; 
/

我想知道为什么这不起作用?

4

2 回答 2

3

这个: y supportContacs.details%type;

应该:y supportContacts.details%type;

如果我做出改变,它对我有用。

于 2013-03-25T03:17:07.690 回答
1

您需要使用右下角按钮(如组合框)更改查询终止符;见证明 SQLFiddle

于 2013-03-25T08:56:36.297 回答