【例题】Oracle中怎么在一个多个表格中一次性插入多个insert语句;

ORACLE多表多插

在Oracle中,一次性在多个表格中插入多个语句,具体代码如下:(红色为关键字)

In Oracle,you can insert several sentences at one time,now the specific code is below:

**********代码开始start**********

insert all

into +表名1+(id,name,password,image,age)values (1,'xiaohuang','123456','dog','27')

into +表名2+(id,uid,money,phone,email) values (1,1,'100','18888888888','1491527416@qq.com')

select * from dual;

**********代码结束end**********

注意:

pay attention:

1、这么分成4行写是为了书写美观,编译维护;也可以写成一行,但是辨识度不好,不推荐;

For buitiful and convenient ,I take this code sentence apart in 4 rows,you can also write in one row,but it may cause misunderstanding; 

2、括号内蓝色字体是两个表各自的属性(字段名,column)

The blue charachers in the blankets are the column  of their own table;

3、dual是万能表,处理特殊操作,是oracle中最小的表;

Word dual can use flexible,especially for particular usage,she is the smallest table in Oracle;

两个表格,分别是:

two tables are show below:

user(用户表)

字段名

类型

长度

默认值

是否为空

是否自增

主键

id

int

10

 

 name(用户名)

varchar

255

 

 

password(密码)

varchar

255

 

 

 

image(头像)

varchar

255

 

 

 

 

age(年龄)

varchar

4

 

 

 

 

 

 

 

 

 

 

 



userdetail(用户详细信息表)

id(id)

int

10

 

uid(用户id)

int

10

 

 

money(余额)

varchar

255

0

 

 

 

phone(联系方式)

varchar

255

 

 

 

 

email(邮箱)

varchar

255

 

 

 

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陶洲川

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值