ISO/IEC 9075-9:2023
(Main)Information technology — Database languages SQL — Part 9: Management of External Data (SQL/MED)
Information technology — Database languages SQL — Part 9: Management of External Data (SQL/MED)
ISO/IEC 9075-9:2016 defines extensions to Database Language SQL to support management of external data through the use of foreign-data wrappers and datalink types.
Technologies de l'information — Langages de base de données SQL — Partie 9: Gestion des données externes (SQL/MED)
General Information
Relations
Standards Content (Sample)
INTERNATIONAL ISO/IEC
STANDARD 9075-9
Fifth edition
2023-06
Information technology —
Database languages SQL —
Part 9:
Management of External Data (SQL/
MED)
Technologies de l'information — Langages de base de données
SQL —
Partie 9: Gestion des données externes (SQL/MED)
Reference number
ISO/IEC 9075-9:2023(E)
© ISO/IEC 2023
---------------------- Page: 1 ----------------------
ISO/IEC 9075-9:2023(E)
COPYRIGHT PROTECTED DOCUMENT
© 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
---------------------- Page: 2 ----------------------
ISO/IEC9075-9:2023(E)
Contents Page
Foreword.xiii
Introduction.xv
1 Scope.1
2 Normativereferences.2
3 Termsanddefinitions.3
4 Concepts.6
4.1 Notationsandconventions.6
4.1.1 Notations.6
4.2 Data types.6
4.2.1 Namingofpredefinedtypes.6
4.2.2 Datatypeterminology.6
4.3 Columns,fields,andattributes.6
4.4 Tables.7
4.4.1 Introductiontotables.7
4.4.2 Basetables.7
4.4.2.1 Foreign tables.7
4.4.3 Uniqueidentificationoftables.7
4.4.4 Tabledescriptors.7
4.4.5 Syntacticanalysisofderivedtablesandcursors.7
4.5 Functional dependencies.8
4.5.1 Knownfunctionaldependenciesinaforeigntable.8
4.6 SQL-schemas.8
4.7 SQL-statements.8
4.7.1 SQL-statementsclassifiedbyfunction.8
4.7.1.1 SQL-schemastatements.8
4.7.1.2 SQL-sessionstatements.9
4.8 Basicsecuritymodel.9
4.8.1 Privileges.9
4.9 SQL-transactions.9
4.9.1 PropertiesofSQL-transactions.9
4.10 SQL-sessions.9
4.10.1 SQL-sessionproperties.9
4.11 IntroductiontoSQL/CLI.10
4.12 Foreign servers.10
4.13 Foreign-datawrappers.11
4.14 User mappings.12
4.15 Routinemappings.12
4.16 Genericoptions.13
©ISO/IEC2023–Allrightsreserved iii
---------------------- Page: 3 ----------------------
ISO/IEC9075-9:2023(E)
4.17 Capabilitiesandoptionsinformation.13
4.18 Datalinks.14
4.18.1 Introductiontodatalinks.14
4.18.2 Operationsinvolvingdatalinks.17
4.18.2.1 Operatorsthatoperateondatalinks.17
4.18.2.2 Otheroperatorsinvolvingdatalinks.18
4.19 Foreign-datawrapperinterface.18
4.19.1 Introductiontoforeign-datawrapperinterface.18
4.19.2 Handles.18
4.19.3 Foreignserversessions.20
4.19.4 Foreign-datawrapperinterfaceroutines.20
4.19.4.1 Introductiontoforeign-datawrapperinterfaceroutines.20
4.19.4.2 Handle routines.20
4.19.4.3 Initializationroutines.24
4.19.4.4 Accessroutines.24
4.19.4.5 Terminationroutines.25
4.19.4.6 Decompositionandpass-throughmodes.26
4.19.4.7 Sequenceofactionsduringtheexecutionofforeignserverrequests.26
4.19.5 Returncodes.38
4.19.6 Foreign-datawrapperdiagnosticsareas.38
4.19.7 Null pointers.40
4.19.8 Foreign-datawrapperdescriptorareas.40
5 Lexicalelements.44
5.1 and.44
5.2 Namesandidentifiers.46
6 Scalarexpressions.48
6.1 .48
6.2 .51
6.3 .52
6.4 .53
6.5 .57
6.6 .58
7 Queryexpressions.61
7.1 .61
8 Additionalcommonrules.68
8.1 Retrieval assignment.68
8.2 Storeassignment.69
8.3 Resultofdatatypecombinations.70
8.4 Typeprecedencelistdetermination.71
8.5 Determinationofidenticalvalues.72
8.6 Equalityoperations.73
8.7 Groupingoperations.74
8.8 Multisetelementgroupingoperations.75
8.9 Orderingoperations.76
9 Additionalcommonelements.77
9.1 .77
iv ©ISO/IEC2023–Allrightsreserved
---------------------- Page: 4 ----------------------
ISO/IEC9075-9:2023(E)
9.2 .78
10 Schemadefinitionandmanipulation.80
10.1 .80
10.2 .81
10.3 .82
10.4 .83
10.5 .84
10.6 .85
10.7 .86
10.8 .87
10.9 .88
10.10 .89
10.11 .90
10.12 .91
10.13 .92
10.14 .93
10.15 .94
10.16 .97
10.17 .98
10.18 .99
10.19 .100
10.20 .102
11 Accesscontrol.104
11.1 .104
11.2 .105
11.3 .106
11.4 .108
11.5 .109
12 SQL-clientmodules.110
12.1 .110
12.2 .111
12.3 .114
12.4 Datatypecorrespondences.115
13 Additionaldatamanipulationrules.118
13.1 Effectofdeletingrowsfrombasetables.118
13.2 Effectofinsertingtablesintobasetables.119
13.3 Effectofreplacingrowsinbasetables.121
14 Sessionmanagement.123
14.1 .123
15 DynamicSQL.125
15.1 DescriptionofSQLdescriptorareas.125
15.2 .126
15.3 .128
15.4 .129
15.5 .131
©ISO/IEC2023–Allrightsreserved v
---------------------- Page: 5 ----------------------
ISO/IEC9075-9:2023(E)
15.6 .135
15.7 .138
15.8 .139
15.9 .140
15.10 .141
15.11 .142
15.12 .143
15.13 .144
16 EmbeddedSQL.145
16.1 .145
16.2 .147
16.3 .148
16.4 .149
16.5 .150
16.6 .151
16.7 .152
17 Diagnosticsmanagement.153
17.1 .153
18 Call-LevelInterfacespecifications.155
18.1 .155
18.2 ImplicitDESCRIBEUSINGclause.156
18.3 DescriptionofCLIitemdescriptorareas.157
18.4 OthertablesassociatedwithCLI.158
18.5 SQL/CLIdatatypecorrespondences.160
19 SQL/CLIroutines.162
19.1 BuildDataLink().162
19.2 GetDataLinkAttr().163
19.3 GetInfo().165
20 URLs.166
20.1 URL format.166
21 Catalog manipulation.169
21.1 .169
21.2 .171
21.3 .172
21.4 .174
21.5 .176
21.6 .177
21.7 .178
21.8 .180
21.9 .181
21.10 .182
22 SQL/MEDcommonspecifications.183
22.1 Descriptionofforeign-datawrapperitemdescriptorareas.183
22.2 Implicitforeign-datawrappercursor.187
22.3 ImplicitDESCRIBEINPUTUSINGclauseforexternaldata.189
vi ©ISO/IEC2023–Allrightsreserved
---------------------- Page: 6 ----------------------
ISO/IEC9075-9:2023(E)
22.4 ImplicitDESCRIBEOUTPUTUSINGclauseforexternaldata.192
22.5 ImplicitEXECUTEUSINGandOPENUSINGclausesforexternaldata.196
22.6 ImplicitFETCHUSINGclauseforexternaldata.199
22.7 Characterstringretrievalforexternaldata.203
22.8 Binarystringretrievalforexternaldata.204
22.9 TablesusedwithSQL/MED.205
23 Foreign-datawrapperinterfaceroutines.216
23.1 .216
23.2 invocation.221
23.3 AdvanceInitRequest().223
23.4 AllocQueryContext().224
23.5 AllocWrapperEnv().225
23.6 Close().227
23.7 ConnectServer().228
23.8 FreeExecutionHandle().230
23.9 FreeFSConnection().232
23.10 FreeQueryContext().233
23.11 FreeReplyHandle().234
23.12 FreeWrapperEnv().235
23.13 GetNextReply().236
23.14 GetNumReplyBoolVE().237
23.15 GetNumReplyOrderBy().238
23.16 GetNumReplySelectElems().239
23.17 GetNumReplyTableRefs().240
23.18 GetOpts().241
23.19 GetReplyBoolVE().243
23.20 GetReplyCardinality().244
23.21 GetReplyDistinct().245
23.22 GetReplyExecCost().246
23.23 GetReplyFirstCost().247
23.24 GetReplyOrderElem().248
23.25 GetReplyReExecCost)(.249
23.26 GetReplySelectElem().250
23.27 GetReplyTableRef().251
23.28 GetSPDHandle().252
23.29 GetSRDHandle().253
23.30 GetStatistics().254
23.31 GetWPDHandle().256
23.32 GetWRDHandle().257
23.33 InitRequest().258
23.34 Iterate().262
23.35 Open().264
23.36 ReOpen().265
23.37 ExecutionofOpen().266
23.38 TransmitRequest().270
23.39 AllocDescriptor().273
23.40 FreeDescriptor().274
©ISO/IEC2023–Allrightsreserved vii
---------------------- Page: 7 ----------------------
ISO/IEC9075-9:2023(E)
23.41 GetAuthorizationId().275
23.42 GetBoolVE().276
23.43 GetDescriptor().277
23.44 GetDistinct().279
23.45 GetNumBoolVE().280
23.46 GetNumChildren().281
23.47 GetNumOrderByElems().282
23.48 GetNumRoutMapOpts().283
23.49 GetNumSelectElems().284
23.50 GetNumServerOpts().285
23.51 GetNumTableColOpts().286
23.52 GetNumTableOpts().288
23.53 GetNumTableRefElems().289
23.54 GetNumUserOpts().290
23.55 GetNumWrapperOpts().291
23.56 GetOrderByElem().292
23.57 GetRoutMapOpt().293
23.58 GetRoutMapOptName().295
23.59 GetRoutineMapping().297
23.60 GetSelectElem().298
23.61 GetSelectElemType().299
23.62 GetServerName().300
23.63 GetServerOpt().301
23.64 GetServerOptByName().303
23.65 GetServerType().305
23.66 GetServerVersion().306
23.67 GetSQLString().307
23.68 GetTableColOpt().308
23.69 GetTableColOptByName().310
23.70 GetTableOpt().312
23.71 GetTableOptByName().313
23.72 GetTableRefElem().315
23.73 GetTableRefElemType().316
23.74 GetTableRefTableName().317
23.75 GetTableServerName().318
23.76 GetTRDHandle().319
23.77 GetUserOpt().320
23.78 GetUserOptByName().322
23.79 GetValExprColName().324
23.80 GetValueExpDesc().325
23.81 GetValueExpKind().326
23.82 GetValueExpName().327
23.83 GetValueExpTable().328
23.84 GetVEChild().329
23.85 GetWrapperLibraryName().330
23.86 GetWrapperName().331
23.87 GetWrapperOpt().332
viii ©ISO/IEC2023–Allrightsreserved
---------------------- Page: 8 ----------------------
ISO/IEC9075-9:2023(E)
23.88 GetWrapperOptByName().334
23.89 SetDescriptor().336
23.90 GetDiagnostics().341
24 InformationSchema.345
24.1 InformationSchemadigitalartifact.345
24.2 ATTRIBUTES view.345
24.3 COLUMN_OPTIONS view.346
24.4 COLUMNSview.347
24.5 FOREIGN_DATA_WRAPPER_OPTIONSview.348
24.6 FOREIGN_DATA_WRAPPERSview.349
24.7 FOREIGN_SERVER_OPTIONS view.350
24.8 FOREIGN_SERVERSview.351
24.9 FOREIGN_TABLE_OPTIONSview.352
24.10 FOREIGN_TABLES view.353
24.11 ROUTINE_MAPPING_OPTIONSview.354
24.12 ROUTINE_MAPPINGS view.355
24.13 USER_MAPPING_OPTIONS view.356
24.14 USER_MAPPINGSview.357
24.15 Shortnameviews.358
25 DefinitionSchema.362
25.1 DefinitionSchemadigitalartifact.362
25.2 COLUMN_OPTIONSbasetable.362
25.3 DATA_TYPE_DESCRIPTORbasetable.364
25.4 FOREIGN_DATA_WRAPPER_OPTIONSbasetable.371
25.5 FOREIGN_DATA_WRAPPERSbasetable.372
25.6 FOREIGN_SERVER_OPTIONSbasetable.373
25.7 FOREIGN_SERVERSbasetable.374
25.8 FOREIGN_TABLE_OPTIONSbasetable.375
25.9 FOREIGN_TABLESbasetable.376
25.10 ROUTINE_MAPPING_OPTIONSbasetable.377
25.11 ROUTINE_MAPPINGSbasetable.378
25.12 SQL_SIZINGbasetable.
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.