Advertisement

Quick Links

ODBC Manual: SAP DB

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DB:ODBC and is the answer not in the manual?

Questions and answers

Summary of Contents for SAP DB:ODBC

  • Page 1 ODBC Manual: SAP DB...
  • Page 2 SAP AG November 2002 Copyright © Copyright 2002 SAP AG. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation.
  • Page 3: Typographic Conventions

    Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. <Example text> Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries. ODBC Manual: SAP DB...
  • Page 4: Table Of Contents

    SAP AG November 2002 ODBC Manual: SAP DB ......................5 Supported ODBC Versions ....................5 Properties of the SAP DB ODBC Driver ................5 Supported Data Types ....................... 6 SQL Data Types ......................6 C Data Types........................6 Conversion of SQL and C Data Types................7 Processing SQL Statements ....................
  • Page 5: Odbc Manual: Sap Db

    The SAP DB ODBC driver allows access to the SAP DB database system. Data is accessed using the Structured Query Language (SQL). Depending on the operating system, the SAP DB ODBC driver is both 32 bit- and 64 bit- compatible. It runs on Linux, Microsoft Windows as of Microsoft Windows 95 and all UNIX systems that are supported by SAP DB.
  • Page 6: Supported Data Types

    (scale), and the number of valid digits (precision). For more information about the data types defined for the SAP DB database system, see the Reference Manual: SAP DB 7.4, data type [See SAP DB Library] section.
  • Page 7: Conversion Of Sql And C Data Types

    SQLUINTEGER fraction;} SQL_C_BIT SQLCHAR unsigned char Conversion of SQL and C Data Types The SAP DB ODBC driver allows the conversion for all supported data types [Page See also: Microsoft Homepage (http://www.microsoft.com/data/ODBC) in the ODBC Software Development Kit (SDK) under ODBC Programmer‘s Reference, Converting Data from SQL to C Data Types and Converting Data from C to SQL Data Types sections.
  • Page 8: Database Procedures

    As SAP DB can lock row-by-row, a user can change data in a table even if another user has also opened parts of this table. The prerequisite for this is that the rows to be changed are outside the part of the table that the other user has opened.
  • Page 9: Core Api

    November 2002 Core API [Page 9] Level 1 API [Page 10] Level 2 API [Page 19] Core API Overview of the functions that are defined in the SAP DB ODBC driver for the core API Function Remarks SQLAllocConnect SQLAllocEnv SQLAllocStmt...
  • Page 10: Level 1 Api

    SQLSetCursorName SQLTransact Level 1 API Overview of the functions that are defined in the SAP DB ODBC driver for the Level 1 Function Remark SQLBindParameter If you want to process more than one LONG column with an INSERT,...
  • Page 11: Remark For Sqlgetconnectattr

    The SAP DB ODBC driver supports the following table types (szTableType): ALIAS, RESULT, SNAPSHOT, SYSTEM, SYSTEM TABLE, TABLE, UNLOADED, VIEW Remark for SQLGetConnectAttr List of all supported attributes and return values of the SAP DB ODBC driver Attributes Return Values SQL_ ATTR_ACCESS_MODE pvParam = SQL_MODE_READ_WRITE...
  • Page 12 SQL_API_SQLBINDPARAM SQL_API_SQLBINDPARAMETER SQL_API_SQLBROWSECONNECT SQL_API_SQLBULKOPERATIONS SQL_API_SQLCANCEL SQL_API_SQLCLOSECURSOR SQL_API_SQLCOLATTRIBUTES SQL_API_SQLCOLUMNPRIVILEGES SQL_API_SQLCOLUMNS SQL_API_SQLCONNECT SQL_API_SQLCOPYDESC SQL_API_SQLDATASOURCES SQL_API_SQLDESCRIBECOL SQL_API_SQLDESCRIBEPARAM SQL_API_SQLDISCONNECT SQL_API_SQLDRIVERCONNECT SQL_API_SQLDRIVERS SQL_API_SQLENDTRAN SQL_API_SQLERROR SQL_API_SQLEXECDIRECT SQL_API_SQLEXECUTE SQL_API_SQLEXTENDEDFETCH SQL_API_SQLFETCH SQL_API_SQLFETCHSCROLL SQL_API_SQLFOREIGNKEYS SQL_API_SQLFREECONNECT SQL_API_SQLFREEENV SQL_API_SQLFREEHANDLE SQL_API_SQLFREESTMT SQL_API_SQLGETCONNECTATTR SQL_API_SQLGETCONNECTOPTION SQL_API_SQLGETCURSORNAME SQL_API_SQLGETDATA SQL_API_SQLGETDESCFIELD SQL_API_SQLGETDESCREC SQL_API_SQLGETDIAGFIELD ODBC Manual: SAP DB...
  • Page 13 November 2002 SQL_API_SQLGETDIAGREC SQL_API_SQLGETENVATTR SQL_API_SQLGETFUNCTIONS SQL_API_SQLGETINFO SQL_API_SQLGETSTMTATTR SQL_API_SQLGETSTMTOPTION SQL_API_SQLGETTYPEINFO SQL_API_SQLMORERESULTS SQL_API_SQLNATIVESQL SQL_API_SQLNUMPARAMS SQL_API_SQLNUMRESULTCOLS SQL_API_SQLPARAMDATA SQL_API_SQLPARAMOPTIONS SQL_API_SQLPREPARE SQL_API_SQLPRIMARYKEYS SQL_API_SQLPROCEDURECOLUMNS SQL_API_SQLPROCEDURES SQL_API_SQLPUTDATA SQL_API_SQLROWCOUNT SQL_API_SQLSETCONNECTATTR SQL_API_SQLSETCONNECTOPTION SQL_API_SQLSETCURSORNAME SQL_API_SQLSETDESCFIELD SQL_API_SQLSETDESCREC SQL_API_SQLSETENVATTR SQL_API_SQLSETPARAM SQL_API_SQLSETPOS SQL_API_SQLSETSCROLLOPTIONS SQL_API_SQLSETSTMTATTR SQL_API_SQLSETSTMTOPTION SQL_API_SQLSPECIALCOLUMNS SQL_API_SQLSTATISTICS SQL_API_SQLTABLEPRIVILEGES SQL_API_SQLTABLES SQL_API_SQLTRANSACT ODBC Manual: SAP DB...
  • Page 14: Remark For Sqlgetinfo

    SAP AG November 2002 Remark for SQLGetInfo List of all attributes and return values supported by the SAP DB ODBC driver Attributes Return Values SQL_ACCESSIBLE_PROCEDURES rgbInfoValue = "N" SQL_ACCESSIBLE_TABLES rgbInfoValue = "N" SQL_ACTIVE_CONNECTIONS rgbInfoValue = 0 SQL_ACTIVE_STATEMENTS rgbInfoValue = 32767...
  • Page 15 | SQL_CB_DELETED (SQLMode = ANSI) SQL_DATA_SOURCE_NAME rgbInfoValue = (Name of the opened data source) SQL_DATA_SOURCE_READ_ONLY rgbInfoValue = "N" SQL_DBMS_NAME rgbInfoValue = "SAP DB" SQL_DBMS_VER rgbInfoValue = "/07.03.nnn" SQL_DEFAULT_TXN_ISOLATION rgbInfoValue = SQL_TXN_READ_COMMITTED SQL_DRIVER_HDBC rgbInfoValue = (Handle of the driver logon) SQL_DRIVER_HENV...
  • Page 16 SQL_MAX_ROW_SIZE rgbInfoValue = 0 SQL_MAX_ROW_SIZE_INCLUDES_LONG rgbInfoValue = "N" SQL_MAX_SCHEMA_NAME_LEN rgbInfoValue = 32 SQL_MAX_STATEMENT_LEN rgbInfoValue = 0 SQL_MAX_TABLE_NAME_LEN rgbInfoValue = 32 SQL_MAX_TABLES_IN_SELECT rgbInfoValue = 64 SQL_MAX_USER_NAME_LEN rgbInfoValue = 32 SQL_MULT_RESULT_SETS rgbInfoValue = "Y" SQL_MULTIPLE_ACTIVE_TXN rgbInfoValue = "Y" ODBC Manual: SAP DB...
  • Page 17 | SQL_OU_TABLE_DEFINITION | SQL_OU_INDEX_DEFINITION | SQL_OU_PRIVILEGE_DEFINITION SQL_POS_OPERATIONS rgbInfoValue = SQL_POS_UPDATE | SQL_POS_DELETE | SQL_POS_ADD (only allowed with dynamic cursors) | SQL_POS_POSITION | SQL_POS_REFRESH rgbInfoValue = SQL_POSITIONED_STATEMENTS SQL_PS_POSITIONED_DELETE | SQL_PS_POSITIONED_UPDATE | SQL_PS_SELECT_FOR_UPDATE SQL_PROCEDURE_TERM rgbInfoValue = "stored procedure" ODBC Manual: SAP DB...
  • Page 18 | SQL_FN_STR_LCASE | SQL_FN_STR_REPLACE | SQL_FN_STR_RIGHT | SQL_FN_STR_RTRIM | SQL_FN_STR_SUBSTRING | SQL_FN_STR_UCASE | SQL_FN_STR_SOUNDEX SQL_SUBQUERIES rgbInfoValue = SQL_SQ_COMPARISON | SQL_SQ_EXISTS | SQL_SQ_IN | SQL_SQ_CORRELATED_SUBQUERIES SQL_SYSTEM_FUNCTIONS rgbInfoValue = SQL_FN_SYS_USERNAME | SQL_FN_SYS_DBNAME | SQL_FN_SYS_IFNULL SQL_TABLE_TERM rgbInfoValue = "Table" ODBC Manual: SAP DB...
  • Page 19: Level 2 Api

    SQL_UNION rgbInfoValue = SQL_U_UNION | SQL_U_UNION_ALL SQL_USER_NAME rgbInfoValue = (Name of the active user) Level 2 API Overview of the functions that are defined in the SAP DB ODBC driver for the Level 2 Function Remark SQLBrowseConnect SQLColumnPrivileges SQLDataSources SQLDescribeParam...
  • Page 20: Unicode Support

    SQLConnectW is called in the ODBC driver. The conversions between ASCII and Unicode are performed by the Driver Manager. Overview of the functions that are defined in the SAP DB ODBC driver for access to Unicode data...
  • Page 21: Sap Db Odbc Driver Under Microsoft Windows

    These options differ only in the default value of the system for storing the installed software. If you install the SAP DB ODBC driver as part of the server package, the system default value for the installation path up to database version 7.3 is the <dependent_data_path>, as of database version 7.4, the <independent_data_path>.
  • Page 22 Library] section Procedure Check whether a SAP DB Server is already installed on your server. If this is the case, the SAP DB ODBC driver is also already installed, and no further steps are necessary. Otherwise, proceed as follows: Open the InstallShield Wizard for the SAP DB ODBC driver by double clicking the file odbc7x-setup.exe.
  • Page 23: Creating Data Sources Under Microsoft Windows

    Settings (ODBC). This opens the ODBC Data Source Administrator. 2. Choose Add. 3. From the displayed list of the installed ODBC drivers, choose the entry SAP DB and confirm your choice by choosing Finish. 4. Make the following entries: Data Source Name Name of the data source.
  • Page 24: Sql Mode (Microsoft Windows)

    Source Administrator on the Tracing tab page. SQL Mode (Microsoft Windows) If you specify the option SQL Mode, you can use the SAP DB ODBC driver in a different SQL mode. This means that the driver can process not only the ODBC and SAP DB-specific SQL syntax, but also the ORACLE or DB2 syntax, for example.
  • Page 25: Logging Sql Statements (Microsoft Windows)

    6. Confirm the windows until the ODBC Data Source Administrator closes. Result The next time that you log on to the database server using this data source, the SAP DB ODBC driver functions with the selected lock operation type. Logging SQL Statements (Microsoft Windows) Select the Trace On option for a data source, if you want to log the SQL statements that are transferred from the application to the database system.
  • Page 26: Installed Files (Microsoft Windows 95 And Following)

    You have various options for installing the SAP DB ODBC driver: • As part of the SAP DB server package The software for the SAP DB ODBC driver is stored under the <dependent_data_path> up to database version 7.3 and under the <independent_data_path> as of database version 7.4.
  • Page 27: Integrating The Sap Db Odbc Driver

    ODBC driver into the Driver Manager. Use without a Driver Manager If you are not using a Driver Manager, you must use an editor to enter the data for the SAP DB ODBC driver manually, either in the file ~/.odbc.ini or the file /var/spool/sql/ini/odbc.ini.
  • Page 28: Creating And Changing Data Sources Under Unix/Linux

    Your entries become effective when the next ODBC connection is created. Options for Data Sources (UNIX/Linux) You can specify various options to influence the functioning of the SAP DB ODBC driver. These options become active the next time that you log on to the database server.
  • Page 29: Sql Mode (Unix/Linux)

    SQL Mode (UNIX/Linux) By changing the option SQLMode, you can use the SAP DB ODBC driver in a different SQL mode. This means that the driver can process not only the ODBC and SAP DB-specific SQL syntax, but also the ORACLE or DB2 syntax, for example.
  • Page 30: Logging Sql Statements (Unix/Linux)

    If this option is not set, no log is written (system default value). Syntax TraceFileName = <file_name> <file_name> ::= [<path_name>/]file_identifier Procedure To change the TraceFileName option, follow the procedure described under Creating and Changing Data Sources Under UNIX/Linux [Page 28]. ODBC Manual: SAP DB...
  • Page 31: Installed Files (Unix/Linux)

    (See also: Installation Under UNIX/Linux [Page 26]) Filename Description libsqlod.a, libsqlod.so SAP DB ODBC driver library incl/sql.h ODBC driver header file (Core API) incl/sqlext.h ODBC driver header file (Level 1 API and Level 2 API) incl/sqltypes.h ODBC driver header file (Data types) incl/WINDOWS.H...

Table of Contents