ASA9_SQL_Reference.pdf
(
3254 KB
)
Pobierz
351399608 UNPDF
Adaptive Server
®
Anywhere
SQL Reference
Part number: 38129-01-0900-01
Last modified: June 2003
Copyright © 1989–2003 Sybase, Inc. Portions copyright © 2001–2003 iAnywhere Solutions, Inc. All rights reserved.
No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual,
optical, or otherwise, without the prior written permission of iAnywhere Solutions, Inc. iAnywhere Solutions, Inc. is a subsiduary of
Sybase, Inc.
Sybase, SYBASE (logo), AccelaTrade, ADA Workbench, Adaptable Windowing Environment, Adaptive Component Architecture,
Adaptive Server, Adaptive Server Anywhere, Adaptive Server Enterprise, Adaptive Server Enterprise Monitor, Adaptive Server
Enterprise Replication, Adaptive Server Everywhere, Adaptive Server IQ, Adaptive Warehouse, AnswerBase, Anywhere Studio,
Application Manager, AppModeler, APT Workbench, APT-Build, APT-Edit, APT-Execute, APT-Library, APT-Translator, ASEP,
AvantGo, AvantGo Application Alerts, AvantGo Mobile Delivery, AvantGo Mobile Document Viewer, AvantGo Mobile Inspection,
AvantGo Mobile Marketing Channel, AvantGo Mobile Pharma, AvantGo Mobile Sales, AvantGo Pylon, AvantGo Pylon Application
Server, AvantGo Pylon Conduit, AvantGo Pylon PIM Server, AvantGo Pylon Pro, Backup Server, BayCam, Bit-Wise, BizTracker,
Certified PowerBuilder Developer, Certified SYBASE Professional, Certified SYBASE Professional (logo), ClearConnect, Client
Services, Client-Library, CodeBank, Column Design, ComponentPack, Connection Manager, Convoy/DM, Copernicus, CSP, Data
Pipeline, Data Workbench, DataArchitect, Database Analyzer, DataExpress, DataServer, DataWindow, DB-Library, dbQueue,
Developers Workbench, Direct Connect Anywhere, DirectConnect, Distribution Director, Dynamic Mobility Model, Dynamo, e-ADK,
E-Anywhere, e-Biz Integrator, E-Whatever, EC Gateway, ECMAP, ECRTP, eFulfillment Accelerator, Electronic Case Management,
Embedded SQL, EMS, Enterprise Application Studio, Enterprise Client/Server, Enterprise Connect, Enterprise Data Studio, Enterprise
Manager, Enterprise Portal (logo), Enterprise SQL Server Manager, Enterprise Work Architecture, Enterprise Work Designer,
Enterprise Work Modeler, eProcurement Accelerator, eremote, Everything Works Better When Everything Works Together, EWA,
Financial Fusion, Financial Fusion (and design), Financial Fusion Server, Formula One, Fusion Powered e-Finance, Fusion Powered
Financial Destinations, Fusion Powered STP, Gateway Manager, GeoPoint, GlobalFIX, iAnywhere, iAnywhere Solutions, ImpactNow,
Industry Warehouse Studio, InfoMaker, Information Anywhere, Information Everywhere, InformationConnect, InstaHelp,
InternetBuilder, iremote, iScript, Jaguar CTS, jConnect for JDBC, KnowledgeBase, Logical Memory Manager, M-Business Channel,
M-Business Network, M-Business Server, Mail Anywhere Studio, MainframeConnect, Maintenance Express, Manage Anywhere
Studio, MAP, MDI Access Server, MDI Database Gateway, media.splash, Message Anywhere Server, MetaWorks, MethodSet,
ML Query, MobiCATS, My AvantGo, My AvantGo Media Channel, My AvantGo Mobile Marketing, MySupport, Net-Gateway,
Net-Library, New Era of Networks, Next Generation Learning, Next Generation Learning Studio, O DEVICE, OASiS, OASiS (logo),
ObjectConnect, ObjectCycle, OmniConnect, OmniSQL Access Module, OmniSQL Toolkit, Open Biz, Open Business Interchange,
Open Client, Open Client/Server, Open Client/Server Interfaces, Open ClientConnect, Open Gateway, Open Server, Open
ServerConnect, Open Solutions, Optima++, Partnerships that Work, PB-Gen, PC APT Execute, PC DB-Net, PC Net Library,
PhysicalArchitect, Pocket PowerBuilder, PocketBuilder, Power Through Knowledge, Power++, power.stop, PowerAMC,
PowerBuilder, PowerBuilder Foundation Class Library, PowerDesigner, PowerDimensions, PowerDynamo, Powering the New
Economy, PowerJ, PowerScript, PowerSite, PowerSocket, Powersoft, Powersoft Portfolio, Powersoft Professional, PowerStage,
PowerStudio, PowerTips, PowerWare Desktop, PowerWare Enterprise, ProcessAnalyst, QAnywhere, Rapport, Relational Beans,
RepConnector, Replication Agent, Replication Driver, Replication Server, Replication Server Manager, Replication Toolkit, Report
Workbench, Report-Execute, Resource Manager, RW-DisplayLib, RW-Library, S.W.I.F.T. Message Format Libraries, SAFE,
SAFE/PRO, SDF, Secure SQL Server, Secure SQL Toolset, Security Guardian, SKILS, smart.partners, smart.parts, smart.script,
SQL Advantage, SQL Anywhere, SQL Anywhere Studio, SQL Code Checker, SQL Debug, SQL Edit, SQL Edit/TPU,
SQL Everywhere, SQL Modeler, SQL Remote, SQL Server, SQL Server Manager, SQL Server SNMP SubAgent, SQL Server/CFT,
SQL Server/DBM, SQL SMART, SQL Station, SQL Toolset, SQLJ, Stage III Engineering, Startup.Com, STEP, SupportNow, Sybase
Central, Sybase Client/Server Interfaces, Sybase Development Framework, Sybase Financial Server, Sybase Gateways, Sybase
Learning Connection, Sybase MPP, Sybase SQL Desktop, Sybase SQL Lifecycle, Sybase SQL Workgroup, Sybase Synergy Program,
Sybase User Workbench, Sybase Virtual Server Architecture, SybaseWare, Syber Financial, SyberAssist, SybMD, SyBooks,
System 10, System 11, System XI (logo), SystemTools, Tabular Data Stream, The Enterprise Client/Server Company, The Extensible
Software Platform, The Future Is Wide Open, The Learning Connection, The Model For Client/Server Solutions, The Online
Information Center, The Power of One, TradeForce, Transact-SQL, Translation Toolkit, Turning Imagination Into Reality, UltraLite,
UltraLite.NET, UNIBOM, Unilib, Uninull, Unisep, Unistring, URK Runtime Kit for UniCode, Versacore, Viewer, VisualWriter, VQL,
Warehouse Control Center, Warehouse Studio, Warehouse WORKS, WarehouseArchitect, Watcom, Watcom SQL, Watcom SQL
Server, Web Deployment Kit, Web.PB, Web.SQL, WebSights, WebViewer, WorkGroup SQL Server, XA-Library, XA-Server, and
XP Server are trademarks of Sybase, Inc. or its subsidiaries.
All other trademarks are property of their respective owners.
ii
Contents
About This Manual xi
SQL Anywhere Studio documentation . . . . . . . . . . . . . . . . .
xii
Documentation conventions . . . . . . . . . . . . . . . . . . . . . . .
xv
The Adaptive Server Anywhere sample database . . . . . . . . . . .
xvii
Finding out more and providing feedback . . . . . . . . . . . . . . . .
xviii
I SQL
1
1 SQL Language Elements 3
Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4
Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7
Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
Search conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
Special values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
32
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
37
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
47
NULL value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
2 SQL Data Types 51
Character data types . . . . . . . . . . . . . . . . . . . . . . . . . . .
52
Numeric data types . . . . . . . . . . . . . . . . . . . . . . . . . . . .
56
Money data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
63
BIT data type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
64
Date and time data types . . . . . . . . . . . . . . . . . . . . . . . . .
65
Binary data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72
Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
74
Data type conversions . . . . . . . . . . . . . . . . . . . . . . . . . .
76
Year 2000 compliance . . . . . . . . . . . . . . . . . . . . . . . . . .
78
3 SQL Functions 83
Function types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
Alphabetical list of functions . . . . . . . . . . . . . . . . . . . . . . .
97
4 SQL Statements 213
Using the SQL statement reference . . . . . . . . . . . . . . . . . . .
220
ALLOCATE DESCRIPTOR statement [ESQL] . . . . . . . . . . . . .
223
iii
ALTER DATABASE statement . . . . . . . . . . . . . . . . . . . . . .
225
ALTER DBSPACE statement . . . . . . . . . . . . . . . . . . . . . . .
229
ALTER EVENT statement . . . . . . . . . . . . . . . . . . . . . . . .
231
ALTER FUNCTION statement . . . . . . . . . . . . . . . . . . . . . .
233
ALTER INDEX statement . . . . . . . . . . . . . . . . . . . . . . . . .
234
ALTER PROCEDURE statement . . . . . . . . . . . . . . . . . . . .
236
ALTER PUBLICATION statement . . . . . . . . . . . . . . . . . . . .
238
ALTER REMOTE MESSAGE TYPE statement [SQL Remote] . . . .
240
ALTER SERVER statement . . . . . . . . . . . . . . . . . . . . . . .
241
ALTER SERVICE statement . . . . . . . . . . . . . . . . . . . . . . .
243
ALTER SYNCHRONIZATION SUBSCRIPTION statement [MobiLink]
246
ALTER SYNCHRONIZATION USER statement [MobiLink] . . . . . .
248
ALTER TABLE statement . . . . . . . . . . . . . . . . . . . . . . . . .
250
ALTER TRIGGER statement . . . . . . . . . . . . . . . . . . . . . . .
258
ALTER VIEW statement . . . . . . . . . . . . . . . . . . . . . . . . .
259
ALTER WRITEFILE statement . . . . . . . . . . . . . . . . . . . . . .
261
BACKUP statement . . . . . . . . . . . . . . . . . . . . . . . . . . . .
263
BEGIN statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
267
BEGIN TRANSACTION statement . . . . . . . . . . . . . . . . . . .
270
CALL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
273
CASE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
275
CHECKPOINT statement . . . . . . . . . . . . . . . . . . . . . . . .
278
CLEAR statement [Interactive SQL] . . . . . . . . . . . . . . . . . . .
279
CLOSE statement [ESQL] [SP] . . . . . . . . . . . . . . . . . . . . .
280
COMMENT statement . . . . . . . . . . . . . . . . . . . . . . . . . .
282
COMMIT statement . . . . . . . . . . . . . . . . . . . . . . . . . . . .
284
CONFIGURE statement [Interactive SQL] . . . . . . . . . . . . . . .
286
CONNECT statement [ESQL] [Interactive SQL] . . . . . . . . . . . .
287
CREATE COMPRESSED DATABASE statement . . . . . . . . . . .
290
CREATE DATABASE statement . . . . . . . . . . . . . . . . . . . . .
292
CREATE DBSPACE statement . . . . . . . . . . . . . . . . . . . . .
297
CREATE DECRYPTED FILE statement . . . . . . . . . . . . . . . .
299
CREATE DOMAIN statement . . . . . . . . . . . . . . . . . . . . . .
300
CREATE ENCRYPTED FILE statement . . . . . . . . . . . . . . . .
302
CREATE EVENT statement . . . . . . . . . . . . . . . . . . . . . . .
304
CREATE EXISTING TABLE statement . . . . . . . . . . . . . . . . .
310
CREATE EXTERNLOGIN statement . . . . . . . . . . . . . . . . . .
313
CREATE FUNCTION statement . . . . . . . . . . . . . . . . . . . . .
315
CREATE INDEX statement . . . . . . . . . . . . . . . . . . . . . . .
319
CREATE MESSAGE statement [T-SQL] . . . . . . . . . . . . . . . .
323
CREATE PROCEDURE statement . . . . . . . . . . . . . . . . . . .
324
CREATE PROCEDURE statement [T-SQL] . . . . . . . . . . . . . . .
332
CREATE PUBLICATION statement . . . . . . . . . . . . . . . . . . .
334
iv
CREATE REMOTE MESSAGE TYPE statement [SQL Remote] . . .
337
CREATE SCHEMA statement . . . . . . . . . . . . . . . . . . . . . .
339
CREATE SERVER statement . . . . . . . . . . . . . . . . . . . . . .
341
CREATE SERVICE statement . . . . . . . . . . . . . . . . . . . . . .
343
CREATE STATISTICS statement . . . . . . . . . . . . . . . . . . . .
346
CREATE SUBSCRIPTION statement [SQL Remote] . . . . . . . . .
347
CREATE SYNCHRONIZATION SUBSCRIPTION statement [MobiLink]
349
CREATE SYNCHRONIZATION USER statement [MobiLink] . . . . .
351
CREATE TABLE statement . . . . . . . . . . . . . . . . . . . . . . .
361
CREATE TRIGGER statement . . . . . . . . . . . . . . . . . . . . . .
373
CREATE TRIGGER statement [SQL Remote] . . . . . . . . . . . . .
377
CREATE TRIGGER statement [T-SQL] . . . . . . . . . . . . . . . . .
380
CREATE VARIABLE statement . . . . . . . . . . . . . . . . . . . . .
381
CREATE VIEW statement . . . . . . . . . . . . . . . . . . . . . . . .
382
CREATE WRITEFILE statement . . . . . . . . . . . . . . . . . . . . .
384
DEALLOCATE statement . . . . . . . . . . . . . . . . . . . . . . . .
386
DEALLOCATE DESCRIPTOR statement [ESQL] . . . . . . . . . . .
387
Declaration section [ESQL] . . . . . . . . . . . . . . . . . . . . . . .
388
DECLARE statement . . . . . . . . . . . . . . . . . . . . . . . . . . .
389
DECLARE CURSOR statement [ESQL] [SP] . . . . . . . . . . . . . .
390
DECLARE CURSOR statement [T-SQL] . . . . . . . . . . . . . . . .
395
DECLARE LOCAL TEMPORARY TABLE statement . . . . . . . . .
397
DELETE statement . . . . . . . . . . . . . . . . . . . . . . . . . . . .
399
DELETE (positioned) statement [ESQL] [SP] . . . . . . . . . . . . .
401
DESCRIBE statement [ESQL] . . . . . . . . . . . . . . . . . . . . . .
403
DISCONNECT statement [ESQL] [Interactive SQL] . . . . . . . . . .
407
DROP statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
408
DROP DATABASE statement . . . . . . . . . . . . . . . . . . . . . .
410
DROP CONNECTION statement . . . . . . . . . . . . . . . . . . . .
411
DROP EXTERNLOGIN statement . . . . . . . . . . . . . . . . . . . .
412
DROP PUBLICATION statement . . . . . . . . . . . . . . . . . . . .
413
DROP REMOTE MESSAGE TYPE statement [SQL Remote] . . . .
414
DROP SERVER statement . . . . . . . . . . . . . . . . . . . . . . . .
415
DROP SERVICE statement . . . . . . . . . . . . . . . . . . . . . . .
416
DROP STATEMENT statement [ESQL] . . . . . . . . . . . . . . . . .
417
DROP STATISTICS statement . . . . . . . . . . . . . . . . . . . . . .
418
DROP SUBSCRIPTION statement [SQL Remote] . . . . . . . . . . .
419
DROP SYNCHRONIZATION SUBSCRIPTION statement [MobiLink]
420
DROP SYNCHRONIZATION USER statement [MobiLink] . . . . . .
421
DROP VARIABLE statement . . . . . . . . . . . . . . . . . . . . . . .
422
EXCEPT operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .
423
EXECUTE statement [ESQL] . . . . . . . . . . . . . . . . . . . . . .
425
EXECUTE statement [T-SQL] . . . . . . . . . . . . . . . . . . . . . .
427
v
Plik z chomika:
Koriolan_new
Inne pliki z tego folderu:
Sybase_ASA_programming_dbpgen10.pdf
(4333 KB)
ASA9_ReviewersGuide.pdf
(290 KB)
ASA9_Error_Messages9.pdf
(1466 KB)
UL9_embedded_UG.pdf
(589 KB)
dbs_remoter_UG_9.pdf
(1571 KB)
Inne foldery tego chomika:
Sybase 5 doc
Sybase 6 doc
Zgłoś jeśli
naruszono regulamin