https://github.com/mono/old-code

https://wiki.scn.sap.com/wiki/display/SQLANY/SQL+Anywhere+and+Microsoft+.NET

http://www.mono-project.com/docs/database-access/providers/sybase/

http://dcx.sybase.com/sa160/en/pdf/index.html

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sqlanywhere.12.0.1/dbprogramming/adodotnet-development-secta-3832474.html

示例數据庫:C:\Program Files\Sybase\SQL Anywhere 5.0\sademo.db
用戶名:DBA 密碼:sql
示例腳本: jcatalog.sql

  1. if (exists (select * from sysobjects
  2. where name = 'spt_datatype_info' and type = 'U'))
  3. drop table spt_datatype_info
  4. go
  5. create table spt_datatype_info
  6. (
  7. ss_dtype tinyint not null,
  8. TYPE_NAME varchar(30) not null,
  9. DATA_TYPE smallint not null,
  10. typelength int not null,
  11. LITERAL_PREFIX varchar(32) null,
  12. LITERAL_SUFFIX varchar(32) null,
  13. CREATE_PARAMS varchar(32) null,
  14. NULLABLE smallint not null,
  15. CASE_SENSITIVE smallint not null,
  16. SEARCHABLE smallint not null,
  17. UNSIGNED_ATTRIBUTE smallint null,
  18. FIXED_PREC_SCALE smallint not null,
  19. -- MONEY smallint not null,
  20. AUTO_INCREMENT smallint null,
  21. LOCAL_TYPE_NAME varchar(128) not null,
  22. MINIMUM_SCALE smallint null,
  23. MAXIMUM_SCALE smallint null,
  24. SQL_DATA_TYPE smallint null,
  25. SQL_DATETIME_SUB smallint null,
  26. NUM_PREC_RADIX smallint null
  27. -- INTERVAL_PRECISION smallint null
  28. )
  29. go
  30.  
  31. grant select on spt_datatype_info to PUBLIC
  32. go
  33.  
  34. insert into spt_datatype_info values
  35. (48, 'tinyint', -6, 3, NULL, NULL, NULL, 1, 0, 2, 1, 0, 0, 'tinyint',
  36. NULL, NULL, NULL, NULL, NULL)
  37. insert into spt_datatype_info values
  38. (34, 'image', -4, 2147483647, '0x', NULL, NULL, 1, 0, 1, NULL, 0, NULL,
  39. 'image', NULL, NULL, NULL, NULL, NULL)
  40. insert into spt_datatype_info values
  41. (37, 'varbinary', -3, 255, '0x', NULL, 'max length', 1, 0, 2, NULL, 0,
  42. NULL, 'varbinary', NULL, NULL, NULL, NULL, NULL)
  43. insert into spt_datatype_info values
  44. (45, 'binary', -2, 255, '0x', NULL, 'length', 1, 0, 2, NULL, 0, NULL,
  45. 'binary', NULL, NULL, NULL, NULL, NULL)
  46. insert into spt_datatype_info values
  47. (35, 'text', -1, 2147483647, '''', '''', NULL, 1, 1, 1, NULL, 0, NULL,
  48. 'text', NULL, NULL, NULL, NULL, NULL)
  49. insert into spt_datatype_info values
  50. (47, 'char', 1, 255, '''', '''', 'length', 1, 1, 3, NULL, 0, NULL,
  51. 'char', NULL, NULL, NULL, NULL, NULL)
  52. insert into spt_datatype_info values
  53. (63, 'numeric', 2, 38, NULL, NULL, 'precision,scale', 1, 0, 2, 0, 0, 0,
  54. 'numeric', 0, 38, NULL, NULL, NULL)
  55. insert into spt_datatype_info values
  56. (55, 'decimal', 3, 38, NULL, NULL, 'precision,scale', 1, 0, 2, 0, 0, 0,
  57. 'decimal', 0, 38, NULL, NULL, NULL)
  58. insert into spt_datatype_info values
  59. (60, 'money', 3, 12, '$', NULL, NULL, 1, 0, 2, 0, 1, 0, 'money', NULL,
  60. NULL, NULL, NULL, NULL)
  61. insert into spt_datatype_info values
  62. (122, 'smallmoney', 3, 8, '$', NULL, NULL, 1, 0, 2, 0, 1, 0,
  63. 'smallmoney', NULL, NULL, NULL, NULL, NULL)
  64. insert into spt_datatype_info values
  65. (56, 'int', 4, 4, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'int', NULL, NULL,
  66. NULL, NULL, NULL)
  67. insert into spt_datatype_info values
  68. (52, 'smallint', 5, 2, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'smallint',
  69. NULL, NULL, NULL, NULL, NULL)
  70. insert into spt_datatype_info values
  71. (62, 'float', 8, 8, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'double', NULL,
  72. NULL, NULL, NULL, 10)
  73. insert into spt_datatype_info values
  74. (59, 'real', 7, 7, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'real', NULL,
  75. NULL, NULL, NULL, 10)
  76. insert into spt_datatype_info values
  77. (61, 'datetime', 93, 23, '''', '''', NULL, 1, 0, 3, NULL, 0, NULL,
  78. 'datetime', NULL, NULL, 93, NULL, NULL)
  79. insert into spt_datatype_info values
  80. (58, 'smalldatetime', 93, 16, '''', '''', NULL, 1, 0, 3, NULL, 0, NULL,
  81. 'smalldatetime', NULL, NULL, 93, NULL, NULL)
  82. insert into spt_datatype_info values
  83. (39, 'varchar', 12, 255, '''', '''', 'max length', 1, 1, 3, NULL, 0,
  84. NULL, 'varchar', NULL, NULL, NULL, NULL, NULL)
  85. go
  86.  
  87. if exists (select * from sysobjects where name =
  88. 'sp_jdbc_function_escapes')
  89. begin
  90. drop procedure sp_jdbc_function_escapes
  91. end
  92. go
  93.  
  94. create procedure sp_jdbc_function_escapes
  95. as
  96. select * from DBA.jdbc_function_escapes
  97.  
  98. go
  99.  
  100. grant execute on sp_jdbc_function_escapes to PUBLIC
  101. go
  102.  
  103. /*
  104. ** sp_jdbc_tables
  105. **
  106. */
  107.  
  108. if exists (select * from sysobjects where name = 'sp_jdbc_tables')
  109. begin
  110. drop procedure sp_jdbc_tables
  111. end
  112. go
  113.  
  114. create procedure sp_jdbc_tables
  115. @table_name varchar(128) = null,
  116. @table_owner varchar(128) = null,
  117. @table_qualifier varchar(128) = null,
  118. @table_type varchar(64) = null
  119. as
  120. declare @id int
  121. declare @searchstr char(10)
  122.  
  123. if @table_name is null select @table_name = '%'
  124.  
  125. select @id = id from sysobjects where name like @table_name
  126. if (@id is null)
  127. begin
  128. raiserror 17461 'Table does not exist'
  129. return (3)
  130. end
  131.  
  132. if (patindex('%table%',lcase(@table_type)) > 0)
  133. select @table_type = 'base'
  134.  
  135. if (patindex('%base%',lcase(@table_type)) > 0)
  136. select @searchstr = 'base'
  137.  
  138. else if (patindex('%view%',lcase(@table_type)) > 0)
  139. select @searchstr = 'view'
  140.  
  141. else if @table_type is null
  142. select @searchstr = '%'
  143. else
  144. begin
  145. raiserror 99998 'Only valid table types are TABLE, BASE, VIEW or null'
  146. return(3)
  147. end
  148.  
  149. if @table_owner is null select @table_owner = '%'
  150.  
  151. select
  152. TABLE_CAT = substring(db_name(),1,length(db_name())),
  153. TABLE_SCHEM= substring(user_name(creator),1,length(user_name(creator))),
  154. TABLE_NAME = substring(table_name,1,length(table_name)),
  155. TYBLE_TYPE = substring(table_type,1,length(table_type)),
  156. REMARKS= remarks
  157. from systable where table_name like @table_name and
  158. user_name(creator) like @table_owner and table_type like @searchstr
  159. order by TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, TABLE_NAME
  160.  
  161. go

  

Sybase SQL anywhere5.5的更多相关文章

  1. Csharp: read Sybase SQL anywhere5.5 using c#

    private void button1_Click(object sender, EventArgs e) { try { //OdbcConnection conn = new OdbcConne ...

  2. SUP (SAP Mobile SDK 2.2) 连接 Sybase SQL Anywhere sample 数据库

    安装了   SAP Mobile SDK 2.2   后发现,这个版本没有自带Sybase SQL Anywhere  数据库. 解决办法: 1. 免费下载 SQL Anywhere Develope ...

  3. SQL Anywhere5.5: Metadata

    http://dcx.sybase.com/1101/en/dbprogramming_en11/ianywhere-data-sqlanywhere-saconnection-getschem633 ...

  4. SQL 教程数据库包括:Oracle, Sybase, SQL Server, DB2, Access 等等,您将学到如何使用 SQL 访问和处理数据系统中的数据

    SQL 基础教程 SQL 教程 SQL 简介 SQL 语法 SQL select SQL distinct SQL where SQL AND & OR SQL Order By SQL in ...

  5. sybase sql anywhere 5.0 安装后sybase central中无法打开视图等的解决办法

    无法打开的原因初步分析要用英文版的xp,后来在如下处发现问题,是sql anywhere的版本太旧了, 可能没有使用Unicode编码,设置一下如下选项可以解决问题.

  6. sybase SQL记录

    在一个表中复制一行,主键是MLID ';

  7. [译]流言终结者 —— SQL Server 是Sybase的产品而不是微软的

    http://www.cnblogs.com/xxxtech/archive/2011/12/30/2307859.html by Euan Garden 这些年来我听说过关于这个流言的许多版本,其中 ...

  8. [转帖]流言终结者 —— “SQL Server 是Sybase的产品而不是微软的”

    流言终结者 —— “SQL Server 是Sybase的产品而不是微软的” https://www.cnblogs.com/xxxtech/archive/2011/12/30/2307859.ht ...

  9. FireDAC 连接SQL Server一些要注意的地方

    TFDConnection: FetchOptions.Mode 设置为fmAll, 返回全部结果, 否则默认只返回前50条, 效果与open以后再执行FetchAll一样 Specifies how ...

随机推荐

  1. Latex一次添加两个图(并列),半栏

    \begin{figure}[t] \centering \includegraphics[width=0.9\columnwidth, clip=true, trim=0 0 0 32]{figur ...

  2. 找出数组中求和等于y的所有子数组

    算法记录: 给定一个数组x,每个元素都是正整数,找出其中满足条件"求和等于y"的所有子数组.(简化问题,每个元素都不相等) x=[x1,...,xn],暴力搜索,复杂度O(2^n) ...

  3. Azure DevOps Server(TFS): 在Excel中解除服务器同步

    通过Azure DevOps Server 提供与Excel集成的功能,用户可以非常便捷地使用Excel,实现工作项数据的同步. 对于需要批量处理数据.离线工作.制作临时报表的用户来说,这个功能必定成 ...

  4. Kaldi如何准备自己的数据

    Introduction 跑完kaldi的一些脚本例子,你可能想要自己用Kaldi跑自己的数据集.这里将会阐述如何准备好数据. run.sh较上的部分是有关数据准备的,通常local与数据集相关. 例 ...

  5. iOS-微信支付商户支付下单id非法

    最近在APP中WKWebView中调用微信支付的时候,一直报商户支付下单id非法.看了n边微信文档,度娘了n次-----仍未解决.因为安卓的支付是没有问题的所以就跟安卓兄弟要了最终调用微信的字符串: ...

  6. docker配置仓储库时出错:无法安全地用该源进行更新,所以默认禁用该源

    在Ubuntu上安装docker,配置仓储库时第一次使用了阿里去的镜像,如下 sudo add-apt-repository "deb [arch=amd64] http://mirrors ...

  7. 转载 用Python实现设计模式——工厂模式

    转载自 SegmentFault作者 夏秋, https://segmentfault.com/a/1190000013053013 非常感谢这位作者的深入浅出的讲解. 前言 工厂模式,顾名思义就是我 ...

  8. Python模块——HashLib与base64

    摘要算法(hashlib) Python的hashlib提供了常见的摘要算法,如MD5,SHA1等等. 什么是摘要算法呢?摘要算法又称哈希算法.散列算法.它通过一个函数,把任意长度的数据转换为一个长度 ...

  9. Python——破解极验滑动验证码

    极验滑动验证码 以上图片是最典型的要属于极验滑动认证了,极验官网:http://www.geetest.com/. 现在极验验证码已经更新到了 3.0 版本,截至 2017 年 7 月全球已有十六万家 ...

  10. python基础学习笔记 - 备忘

    基础中的基础 Python标识符 命名规则: Python标识符区分大小写. 可以包括英文.数字以及下划线,但不能以数字开头. 以下划线开头的标识符是有特殊意义的: a)         以单下划线开 ...