ISO/IEC 9075-3:2023
(Main)Information technology — Database languages SQL — Part 3: Call-Level Interface (SQL/CLI)
Information technology — Database languages SQL — Part 3: Call-Level Interface (SQL/CLI)
ISO/IEC 9075-3:2016 defines the structures and procedures that can be used to execute statements of the database language SQL from within an application written in a programming language in such a way that procedures used are independent of the SQL statements to be executed.
Technologies de l’information — Langage de base de données SQL — Partie 3: Interface de niveau d’appel (SQL/CLI)
General Information
Relations
Standards Content (Sample)
INTERNATIONAL ISO/IEC
STANDARD 9075-3
Sixth edition
2023-06
Information technology —
Database languages SQL —
Part 3:
Call-Level Interface (SQL/CLI)
Reference number
© ISO/IEC 2023
© ISO/IEC 2023
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii
© ISO/IEC 2023 – All rights reserved
ISO/IEC9075-3:2023(E)
Contents Page
Foreword.ix
Introduction.xi
1 Scope.1
2 Normativereferences.2
3 Termsanddefinitions.3
4 Concepts.4
4.1 Notationsandconventions.4
4.1.1 Notations.4
4.1.2 Specificationofroutinedefinitions.4
4.2 IntroductiontoSQL/CLI.4
4.3 Return codes.8
4.4 DiagnosticsareasinSQL/CLI.9
4.4.1 IntroductiontodiagnosticsareasinSQL/CLI.9
4.4.2 SettingofROW_NUMBERandCOLUMN_NUMBERfields.12
4.5 Miscellaneous characteristics.12
4.5.1 Handles.12
4.5.2 Null-terminated strings.12
4.5.3 Null pointers.13
4.5.4 Environment attributes.13
4.5.5 Connectionattributes.13
4.5.6 Statementattributes.14
4.5.7 CLIdescriptorareas.14
4.5.8 Obtainingdiagnosticsduringmulti-rowfetch.15
4.6 SQL-invokedroutines.16
4.6.1 ResultsetsreturnedbySQL-invokedprocedures.16
4.7 Cursors.16
4.7.1 Generaldescriptionofcursors.16
4.8 Client-server operation.16
5 Lexicalelements.17
5.1 and.17
6 Call-LevelInterfacespecifications.18
6.1 .18
6.2 invocation.26
6.3 Implicitsetconnection.29
6.4 Preparingastatement.30
6.5 Executingastatement.33
6.6 ImplicitCLIpreparedcursor.35
6.7 ImplicitCLIproceduralresultcursor.37
©ISO/IEC2023–Allrightsreserved iii
ISO/IEC9075-3:2023(E)
6.8 InitialCLIcursor.38
6.9 ImplicitDESCRIBEUSINGclause.39
6.10 ImplicitEXECUTEUSINGandOPENUSINGclauses.45
6.11 ImplicitCALLUSINGclause.51
6.12 Fetchingarowset.56
6.13 ImplicitFETCHUSINGclause.60
6.14 Characterstringretrieval.66
6.15 Binarystringretrieval.68
6.16 Deferredparametercheck.70
6.17 DescriptionofCLIitemdescriptorareas.71
6.18 OthertablesassociatedwithCLI.82
6.19 SQL/CLIdatatypecorrespondences.106
7 SQL/CLIroutines.116
7.1 IntroductiontoSQL/CLIroutines.116
7.2 AllocConnect().116
7.3 AllocEnv().117
7.4 AllocHandle().118
7.5 AllocStmt().122
7.6 BindCol().123
7.7 BindParameter().125
7.8 Cancel().129
7.9 CloseCursor().131
7.10 ColAttribute().132
7.11 ColumnPrivileges().134
7.12 Columns().140
7.13 Connect().149
7.14 CopyDesc().153
7.15 DataSources().154
7.16 DescribeCol().156
7.17 Disconnect().158
7.18 EndTran().160
7.19 Error().164
7.20 ExecDirect().166
7.21 Execute().167
7.22 Fetch().168
7.23 FetchScroll().169
7.24 ForeignKeys().170
7.25 FreeConnect().182
7.26 FreeEnv().183
7.27 FreeHandle().184
7.28 FreeStmt().187
7.29 GetConnectAttr().189
7.30 GetCursorName().191
7.31 GetData().192
7.32 GetDescField().198
7.33 GetDescRec().200
7.34 GetDiagField().202
iv ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-3:2023(E)
7.35 GetDiagRec().211
7.36 GetEnvAttr().213
7.37 GetFeatureInfo().215
7.38 GetFunctions().218
7.39 GetInfo().219
7.40 GetLength().223
7.41 GetParamData().225
7.42 GetPosition().231
7.43 GetSessionInfo().233
7.44 GetStmtAttr().235
7.45 GetSubString().238
7.46 GetTypeInfo().240
7.47 MoreResults().244
7.48 NextResult().245
7.49 NumResultCols().246
7.50 ParamData().247
7.51 Prepare().252
7.52 PrimaryKeys().253
7.53 PutData().258
7.54 RowCount().261
7.55 SetConnectAttr().262
7.56 SetCursorName().264
7.57 SetDescField().266
7.58 SetDescRec().271
7.59 SetEnvAttr().273
7.60 SetStmtAttr().275
7.61 SpecialColumns().279
7.62 StartTran().286
7.63 TablePrivileges().288
7.64 Tables().293
8 Additionaldatamanipulationrules.300
8.1 Effectofopeningacursor.300
9 DynamicSQL.301
9.1 .301
10 Statuscodes.302
10.1 SQLSTATE.302
11 Conformance.305
11.1 ClaimsofconformancetoSQL/CLI.305
11.2 AdditionalconformancerequirementsforSQL/CLI.305
11.3 ImpliedfeaturerelationshipsofSQL/CLI.305
AnnexA(informative) SQLconformancesummary.306
AnnexB(informative) Implementation-defined elements.308
AnnexC(informative) Implementation-dependent elements.329
AnnexD(informative) SQLoptionalfeaturetaxonomy.334
AnnexE(informative) Deprecatedfeatures.335
©ISO/IEC2023–Allrightsreserved v
ISO/IEC9075-3:2023(E)
AnnexF(informative) IncompatibilitieswithISO/IEC9075:2016.336
AnnexG(informative) DefectReportsnotaddressedinthiseditionofthisdocument.337
AnnexH(informative) Exampleheaderfiles.338
H.1 Cheaderfilesqlcli.h.338
H.2 COBOLlibraryitemSQLCLI.349
AnnexI(informative) ExampleCprograms.357
I.1 IntroductiontoExampleCprograms.357
I.2 Createtable,insert,select.357
I.3 Interactive Query.360
I.4 ProvidinglongdynamicargumentsatExecutetime.363
Index.366
vi ©ISO/IEC2023–Allrightsreserved
ISO/IEC9075-3:2023(E)
Tables
Table Page
1 HeaderfieldsinSQL/CLIdiagnosticsareas.10
2 StatusrecordfieldsinSQL/CLIdiagnosticsareas.10
3 SupportedcallingconventionsofSQL/CLIroutinesbylanguage.
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.