oracle数据库笔记---pl/sql的基础使用方法
发布日期:2021-06-29 18:04:16 浏览次数:2 分类:技术文章

本文共 1410 字,大约阅读时间需要 4 分钟。

2.pl/sql的使用:创建表:
a.输入账户,密码进入后,
b.在左侧下拉框选择All objects,中的tables有很多,是系统自带的表;
在左侧下拉框选择My objects,中的tables没有表存在,在这里可以创建自己的表
c.创建自己的表:tables上,右键new一个新表;在General标签下,Name:users,注意这里不能
填写user,因为user是关键字,columns是字段:创建id type:number name:varchar2(10),
pwd type:varchar2(10),点击keys添加主键,给主键起名为pk_users type:Primary 选上
Enabled.
d.点击view sql查看sql语句:
-- Create table
create table USERS
(
ID NUMBER not null,
NAME NVARCHAR2(10),
PWD NVARCHAR2(10)
)
tablespace TEST
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table USERS
add constraint PK_USES primary key (ID)
using index
tablespace TEST
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
minextents 1
maxextents unlimited
);
--------------------------------------------------------------
3.往新建的users表中添加数据
在左侧的tables中选中users表,右键,选择edit data:
添加数据 id 1 name:admin pwd:123
id 2 name:user pwd:123
每添加一条数据:就点击一下菜单栏的向下的一个箭头,表示提交事务
-------------------------------------------------------------------------
4.从新建的表users中查询数据:
在左侧的tables中选中users表,右键,选择query data:
-----------------------------------------------------
5.更改新建表users的表结构
在左侧的tables中选中users表,右键,选择Edit:
--------------------------------------------
6.在新建表users中执行sql语句:
在左侧的tables中选中users表,右键,选择query data:
在sql视图中写sql语句,写完后,点击一个齿轮的图标执行;
----------------------------------------------------------

转载地址:https://credream.blog.csdn.net/article/details/8546208 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:oracle求助---win7下oracle配置相关疑问Starting Oracle Enterprise Manager 10g Database Control ...发生系统错误 5。
下一篇:plsql数据库异常---plsql 登录后,提示数据库字符集(AL32UTF8)和客户端字符集(ZHS16GBK)不一致

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年04月22日 10时16分58秒