欢迎投稿

今日深度:

PL/SQL Developer下设置“长SQL自动换行”,developer自

PL/SQL Developer下设置“长SQL自动换行”,developer自动换行


***********************************************声明*********************************************************************** 

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处,否则追究版权法律责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/39932149

****************************************************************************************************************************

进入到ToolsPreferencesEditor下进行相关设置,步骤如下图:

点击“Editor”项进行设置,如下图:

本次设置,为了实现长代码自动换行,勾选“wrap lines”即可。

长代码自动换行了,更易于显示阅读了,如下所示:

补充上图SQL是错误的,只为演示长SQL换行,正常书写应该为:

SQL> create table cool ("1" number(4),"2" varchar2(10),"3" varchar2(9),"4" number(4),"5" date,"6" number(7,2),"7" number(7,2),"8" number(2));
Table created  

***********************************************声明*********************************************************************** 

原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处,否则追究版权法律责任。

深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/39932149

****************************************************************************************************************************


PL/SQL Developer 该软件怎设置字体的大小与颜色?

工具->首选项->用户界面->字体(编辑器里面也有一些)
 

在pl/sql developer里的主键自动生成方式为何不可以设置成自增长

oracle不能实现字段数值的自增长。可以通过序列和触发器来实现一行数据在insert前实现某字段的自增。

首先随便建立一个表,menuId是需要自增的字段
create table menu( menuId number(10) not null primary key,
name varchar2(40) not null,
id_parent number(10) not null,
url varchar2(300) null);
然后建立一个序列,最小值是minvalue,从1开始,步进为1递增,无循环,无缓存。
关于create sequence的详细用法。
create sequence menu_autoinc_seq
minvalue 1
start with 1
increment by 1
nocycle
nocache;
然后建立一个触发器,在插入tun_menu表之前触发,选取序列的nextval作为新值。
关于create trigger的详细用法。
create or replace trigger menu_autoinc_tg
before insert on menu for each row
begin
select menu_autoinc_seq.nextval into :new.id from dual;
end menu_autoinc_tg;

然后测试一下: insert into menu values('','个人事务',0,'indi.php');
insert into menu values('','公共事务',0,'public.php');
insert into menu values('','信息维护',0,'maintain.php');
insert into menu values('','后台管理',0,'manage.php');
 

www.htsjk.Com true http://www.htsjk.com/shujukunews/3738.html NewsArticle PL/SQL Developer下设置“长SQL自动换行”,developer自动换行 ***********************************************声明*********************************************************************** 原创作品,出自 “深蓝的blog”...
评论暂时关闭