ASE安装语法数据库提供在线帮助信息支持

ASE有个可选数据库:sybsyntax,此数据库是帮助信息数据库,数据库不大。安装完该数据库sybsyntax后,可以在isql或其它客户端工具上在线查看T-SQL以及命令、dbcc等命令的语法。

如:

1> sp_syntax "update statistics"
2> go
 Syntax Help
 ------------------------------------------------------------------------------
 Transact-SQL

   update statistics table_name
              [ [index_name] | [( column_list ) ] ]
              [using step values]
              [with consumers = consumers ]
      update index statistics table_name [index_name]
              [using step values]
              [with consumers = consumers ]

(return status = 0)

 

安装步骤如下:

第一步:为数据库sybsyntax初始化设备:sybsyntaxdev

该数据库不大,并且以后几乎为”只读“数据库,除非你自己往里面添加帮助信息

disk init name="sybsyntaxdev",physname="c:\sybase\sybsyntaxdev.dat",size="200M"
go

 

检验一下刚才初始化的设备是否正确?
 

sp_helpdevice sybsyntaxdev
 go

第二步:在设备sybsyntadev上创建数据库,数据和日志段都分配在sybsyntaxdev这个设备上

create database sybsyntax on sybsyntaxdev="200M"

go

CREATE DATABASE: allocating 102400 logical pages (200.0 megabytes) on disk
'sybsyntaxdev' (102400 logical pages requested).
Database 'sybsyntax' is now online.

第三步:加载语法数据库sybsyntax的帮助信息脚本

C:\Sybase\ASE-15_0\scripts>isql -Usa -iins_syn_sql -w9999 -oins_syn_sql.out

 

第四步:开始使用在线帮助信息

用isql登录ASE数据库后,当前数据库为任何数据库都可以发出sp_syntax过程来查询帮助信息。

存储过程sp_syntax的语法为:

Usage: sp_syntax command [, module [, language]]

1> sp_syntax
2> go
sp_syntax provides syntax help for Sybase products.
These modules are installed on this Server:

 Module
 --------------------
 DB-Library/C
 dbcc Procedure
 ESP
 System Procedure
 Transact-SQL
 UNIX Utility
 Windows NT Utility

Usage: sp_syntax command [, module [, language]]
(return status = 0)

如想查看select命令的详细语法,可以使用sp_syntax "select"

1> sp_syntax "select"
2> go
 Syntax Help
 ------------------------------------------------------------------------------
 Transact-SQL
 select - Retrieves rows from database objects.
   select  ::=
      select   [ all | distinct ] select_list
      [into_clause]
      [from_clause]
      [where_clause]
      [group_by_clause]
      [having_clause]
      [order_by_clause]
      [compute_clause]
      [read_only_clause]
      [isolation_clause]
      [browse_clause]
      [plan_clause]
      select_list ::=
      For details, see "Keywords and options" in the SAG
      into_clause ::=
      into [[database.]owner.]table_name
      [  lock {datarows | datapages | allpages } ]
      [ with into_option [, into_option] ...]
    into_option ::=
    | max_rows_per_page = num_rows
    | exp_row_size = num_bytes
    | reservepagegap = num_pages
    | identity_gap = gap
      from_clause ::=
      from table_reference [,table_reference]...
      table_reference ::=
      table_view_name | ANSI_join
      table_view_name ::=
        [[database.]owner.] {table_name | view_name}
        [as] [correlation_name]
        [index {index_name | table_name }]
        [parallel [degree_of_parallelism]]
        [prefetch size ][lru | mru]}
        [holdlock | noholdlock]
        [readpast]
        [shared]
        ANSI_join ::=
        table_reference join_type join table_reference join_condition
        join_type ::= inner | left [outer] | right [outer]
        join_conditions ::= on search_conditions
      where_clause ::=
      where search_conditions
      group_by_clause ::=
      group by [all] aggregate_free_expression
      [, aggregate_free_expression]...
      having_clause ::=
      having search_conditions
      order_by_clause ::=
      order by sort_clause [, sort_clause]...
        sort_clause ::=
        { [[[database.]owner.]{table_name.|view_name.}]column_name
        | select_list_number | expression }
        [asc | desc]
      compute_clause ::=
      compute row_aggregate(column_name)
      [, row_aggregate(column_name)]...
      [by column_name [, column_name]...]
      read_only_clause ::=
      for {read only | update [of column_name_list]}
      isolation_clause ::=
      at isolation
              { read uncommitted | 0 }
              | { read committed | 1 }
              | { repeatable read | 2  }
              | { serializable | 3  }
      browse_clause ::=
      for browse
      plan_clause ::=
      plan "abstract plan"

(return status = 0)

其它命令自己尝试吧。所有的帮助信息都放在数据库sybsyntax的表sybsyntax中。上面执行的查看select命令帮助信息的语句:sp_syntax "select"

和执行SQL语句:select * from sybsyntax ..sybsyntax where commandname like '%select%'  很像。不过还是用sp_syntax直观。建议大家使用!

  • 本文链接地址:http://www.dbainfo.net/ase-install-sybsyntax-db-support-online-help.htm
  • 本文为dbainfo个人原创,请在尊重作者劳动成果的前提下进行转载;
  • 转载务必注明原始出处 : Sybase数据库技术,数据库恢复专家
  • 对《ASE安装语法数据库提供在线帮助信息支持》有何疑问或见解,请在本文下方发表;
  • 对网站还有其他问题或建议,请提交在留言板,谢谢!
  • 目前还没有任何评论.
    :wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-D :-? :) :( :!: 8-O 8)