oracle into 一次給多個變數賦值

2021-06-06 16:42:29 字數 3185 閱讀 8930

--建表,插資料

prompt pl/sql developer import file

prompt created on 2023年5月23日 by administrator

set feedback off

set define off

prompt creating student...

create table student

(studentid  number not null,

name       varchar2(20) not null,

***        char(2) not null,

age        number not null,

department varchar2(20) not null

)tablespace users

pctfree 10

initrans 1

maxtrans 255

storage

(initial 64k

minextents 1

maxextents unlimited

);comment on column student.department

is '部門';

alter table student

add constraint pk_student_id primary key (studentid)

using index

tablespace users

pctfree 10

initrans 2

maxtrans 255

storage

(initial 64k

minextents 1

maxextents unlimited

);prompt disabling triggers for student...

alter table student disable all triggers;

prompt truncating student...

truncate table student;

prompt loading student...

insert into student (studentid, name, ***, age, department)

values (1, '熊敏', '男', 24, '學習部');

insert into student (studentid, name, ***, age, department)

values (2, '熊偉', '男', 23, '技術部');

insert into student (studentid, name, ***, age, department)

values (3, '熊無名', '男', 19, '學習部');

insert into student (studentid, name, ***, age, department)

values (5, '楊茹', '女', 19, '生活部');

insert into student (studentid, name, ***, age, department)

values (4, '黃維', '女', 22, '生活部');

insert into student (studentid, name, ***, age, department)

values (12, '熊敏', '男', 25, 'abc');

insert into student (studentid, name, ***, age, department)

values (13, '熊敏', '男', 25, 'abc');

insert into student (studentid, name, ***, age, department)

values (14, '熊敏', '男', 25, 'abc');

insert into student (studentid, name, ***, age, department)

values (7, '林文偉', '男', 23, '學習部');

insert into student (studentid, name, ***, age, department)

values (8, '王正國', '男', 23, '學習部');

insert into student (studentid, name, ***, age, department)

values (9, '王正國', '男', 23, '學習部');

insert into student (studentid, name, ***, age, department)

values (10, '黃廣', '男', 23, '學習部');

insert into student (studentid, name, ***, age, department)

values (11, '黃雲生', '男', 23, '學習部');

insert into student (studentid, name, ***, age, department)

values (6, '龍寒', '男', 23, '學習部');

commit;

prompt 14 records loaded

prompt enabling triggers for student...

alter table student enable all triggers;

set feedback on

set define on

prompt done.

--儲存過程

create or replace procedure insert_student

asstudent_id number;

student_name varchar2(20);

student_*** varchar2(20);

student_age number;

student_department varchar2(20);

begin

select name,*** into student_name,student_*** from student where studentid = 1;

dbend insert_student;

一次新增多個帳戶

關於一次新增多個帳戶。dn,objectclass,samaccountname,userprincipalname,displayname,useraccountcontrol cn mary,ou market,dc sina,dc com user,mary,mary sina.com,mar...

SqlClr 一次查詢多個DB

一 c using system using system.data using system.data.sqlclient using system.data.sqltypes using microsoft.sqlserver.server using system.security.permi...

MQTT一次訂閱多個主題

利用mqtt一次訂閱多個主題 在做智慧型家居相關的應用時候,需要利用訂閱所有裝置的主題。這個時候我們需要利用mqtt的萬用字元的功能,乙個訂閱可能包含特殊字元,允許你一次定義多個主題。主題層次分隔符被用來在主題中引入層次。多層的萬用字元和單層萬用字元可以被使用,但他們不能被使用來做發布者的訊息。1....