当前位置:Gxlcms > 数据库问题 > 初学oracle,sql,DML向表中插入某个值

初学oracle,sql,DML向表中插入某个值

时间:2021-07-01 10:21:17 帮助过:29人阅读


Table created.
SQL> select * from qq;  查询表qq的信息
no rows selected
SQL> insert into qq(name) values(‘zhangsan‘); 指定某个队列插入数据,未设置NULL
1 row created.
SQL> select * from qq;
NAME           SALARY
---------- ----------
zhangsan
                        插入数据,尝试发现,NUMBER数值8,2表示,小数点保持两位,六位的整数位
           values2为字符型,汉子一个字代表两个字节,英文及特殊字符一个,我这汉子显示不出来,字符汉字括号内加引号
SQL> insert into qq(salary) values(123456.78);
1 row created.
SQL> select * from qq;
NAME           SALARY
---------- ----------
zhangsan
            123456.78
SQL> insert into qq values(‘lisi‘,12345678);
insert into qq values(‘lisi‘,12345678)
                             *ERROR at line 1:
ORA-01438: value larger than specified precision allowed for this column
SQL> insert into qq values(‘lisi‘,5000);
1 row created.
SQL> select * from qq;
NAME           SALARY
---------- ----------
zhangsan
            123456.78
lisi             5000
SQL> insert into qq values(1);
insert into qq values(1)
            *ERROR at line 1:
ORA-00947: not enough values
SQL> insert into qq(salary) values(11);
1 row created.
SQL> select * from qq;
NAME           SALARY
---------- ----------
zhangsan
            123456.78
lisi             5000
                   1

SQL> roll                              回滚操作
Rollback complete.
SQL> select * from qq;

no rows selected

1

 

初学oracle,sql,DML向表中插入某个值

标签:show   color   汉字   指定   查询   column   队列   acl   插入   

人气教程排行