Dyalog APL SQAPL Interface Guide Version 6.3
Total Page:16
File Type:pdf, Size:1020Kb
The tool of thought for expert programming Dyalog APL SQAPL Interface Guide Version 6.3 Dyalog Limited Minchens Court Minchens Lane Bramley Hampshire RG26 5BH United Kingdom Tel: +44 (0)1256 830030 Fax: +44 (0)1256 830031 email: [email protected] http://www.dyalog.com Dyalog is a trademark of Dyalog Limited Copyright 1982-2017 SQL Interface Guide 2 Copyright 2017 by Dyalog Limited. All rights reserved. Version 6.3.0 First Edition January 2013 Document version 20170627 No part of this publication may be reproduced in any form by any means without the prior written permission of Dyalog Limited, Minchens Court, Minchens Lane, Bramley, Hampshire, RG26 5BH, United Kingdom. Dyalog Limited makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose. Dyalog Limited reserves the right to revise this publication without notification. TRADEMARKS: IBM is a registered trademark of International Business Machines Corporation. Microsoft, MS and MS-DOS are registered trademarks of Microsoft Corporation. SQAPL is copyright of Insight Systems ApS. UNIX is a trademark of X/Open Ltd. Windows, Windows NT, Visual Basic and Excel are trademarks of Microsoft Corporation. All other trademarks and copyrights are acknowledged. SQL Interface Guide 3 Contents C H A P T E R 1 INTRODUCTION .............................................................................. 6 ODBC ................................................................................................................................................ 6 SQAPL ............................................................................................................................................... 7 The LOADDATA Workspace ............................................................................................................... 8 Integrating SQAPL with Your Application .......................................................................................... 9 C H A P T E R 2 INSTALLATION AND CONFIGURATION .................................. 10 SQAPL on macOS ............................................................................................................................ 10 SQAPL on Microsoft Windows ........................................................................................................ 11 C H A P T E R 3 GETTING STARTED ...................................................................... 13 Initialisation .................................................................................................................................... 13 Connecting to a Service .................................................................................................................. 13 Return Codes .................................................................................................................................. 14 SQAPL “Objects” ............................................................................................................................. 15 Disconnecting from a Service .......................................................................................................... 15 Data Dictionary ............................................................................................................................... 15 Executing SQL Statements .............................................................................................................. 16 Bind Variables ................................................................................................................................. 17 Output Variables ............................................................................................................................. 18 APL Types ....................................................................................................................................... 19 Explicit Type Conversions ................................................................................................................ 20 Data Types Supported by a DSN ...................................................................................................... 21 C H A P T E R 4 USING DATA TYPES ..................................................................... 22 Simple Numeric Types .................................................................................................................... 22 High Precision Numbers .................................................................................................................. 22 Complex Numbers .......................................................................................................................... 23 Character Data ................................................................................................................................ 23 Very Wide Char Columns ................................................................................................................ 24 UTF-8 Data ...................................................................................................................................... 24 Binary Data ..................................................................................................................................... 25 Dates and Timestamps.................................................................................................................... 26 APL Arrays ...................................................................................................................................... 28 Conversion Errors ........................................................................................................................... 28 C H A P T E R 5 PREPARE, EXEC, FETCH .............................................................. 29 Low Level Interface ......................................................................................................................... 29 SQA.Prepare ................................................................................................................................... 30 Nulls ............................................................................................................................................... 32 Errors During Statement Execution ................................................................................................. 33 SQA.Describe .................................................................................................................................. 34 SQA.ExecDirect ............................................................................................................................... 35 SQA.Fetch ....................................................................................................................................... 35 Fetching Nulls ................................................................................................................................. 35 SQL Interface Guide 4 Optimising Fetches ......................................................................................................................... 35 C H A P T E R 6 ADVANCED FEATURES ................................................................ 38 Large Objects and Partial Binding.................................................................................................... 38 SQA.PutData ................................................................................................................................... 38 SQA.GetData................................................................................................................................... 39 SCAR Conversion Functions............................................................................................................. 40 Transactions ................................................................................................................................... 41 Remote Procedure Calls .................................................................................................................. 42 C H A P T E R 7 TROUBLESHOOTING GUIDE ...................................................... 43 Common Error Codes ...................................................................................................................... 43 No Error Messages ...................................................................................................................... 43 Exception Handling ......................................................................................................................... 45 SQA.GetInfo .................................................................................................................................... 45 SQA.NativeSQL ............................................................................................................................... 46 FUNCTION REFERENCE ................................................................................................. 47 SQAPL Quick Reference Card .......................................................................................................... 48 SQA.Apl2Scar .......................................................................................................................... 49 SQA.BrowseConnect ............................................................................................................... 49 SQA.Cancel ............................................................................................................................