您的位置:首页 > 博客中心 > 数据库 >

Oracle.PL.SQL.程序设计笔记 day01

时间:2022-03-14 17:53

自定义变量 技术分享   variable x varchar(20) 注:在变量x前加冒号,是表示这是一个变量。 技术分享   技术分享     设置了x变量,当CMD窗口关闭后,变量失效。 技术分享  技术分享     [glogin.sql] D:\app\Administrator\product\11.2.0\dbhome_1\sqlplus\admin\glogin.sql --
-- Copyright (c) 1988, 2005, Oracle.  All Rights Reserved.
--
-- NAME
--   glogin.sql
--
-- DESCRIPTION
--   SQL*Plus global login "site profile" file
--
--   Add any SQL*Plus commands here that are to be executed when a
--   user starts SQL*Plus, or uses the SQL*Plus CONNECT command.
--
-- USAGE
--   This script is automatically run
--

REM Number of lines of SELECT statement output before reprinting headers
SET PAGESIZE 999

REM Width of displayed page, expressed in characters
SET LINESIZE 132

REM Enable display of DBMS_OUTPUT messages. Use 1000000 rather than
REM "UNLIMITED" for databases earlier than Oracle Database 10g Release 2
SET SERVEROUTPUT ON SIZE UNLIMITED FORMAT WRAPPED

REM Change default to "vi improved" editor
DEFINE _EDITOR = /usr/local/bin/vim

REM Format misc columns commonly retrieved from data dictionary
COLUMN segment_name FORMAT A30 WORD_WRAP
COLUMN object_name FORMAT A30 WORD_WRAP

REM Set the prompt (works in SQL*Plus from Oracle9i Database or later0
SET SQLPROMPT "_USER‘@‘_CONNECT_IDENTIFIER > "


 技术分享   2.3.7 SQL*Plus中的错误处理 当运行脚本时,碰到错误时希望能停止运行。使用下面命令可以达到目的。   SQL> WHENEVER SQLERROR EXIT SQL.SQLcode (当错误时,返回值为非零。) 或者: SQL> WHENEVER SQLERROR SQL.SQLcode EXIT ROLLBACK (回滚处理)    

本类排行

今日推荐

热门手游