You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-31Lines changed: 34 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,9 +46,7 @@ Copyright 2023 Teradata. All Rights Reserved.
46
46
*[CSV Export Results](#CSVExportResults)
47
47
*[Change Log](#ChangeLog)
48
48
49
-
Table of Contents links do not work on PyPI due to a [PyPI limitation](https://github.com/pypa/warehouse/issues/4064).
50
-
51
-
<aname="Features"></a>
49
+
<aid="Features"></a>
52
50
53
51
### Features
54
52
@@ -77,15 +75,15 @@ At the present time, the driver offers the following features.
77
75
* Stored Procedure Dynamic Result Sets.
78
76
* FastLoad and FastExport.
79
77
80
-
<aname="Limitations"></a>
78
+
<aid="Limitations"></a>
81
79
82
80
### Limitations
83
81
84
82
* The UTF8 session character set is always used. The `charset` connection parameter is not supported.
85
83
* No support yet for Recoverable Network Protocol and Redrive.
86
84
* Monitor partition support is not available yet.
87
85
88
-
<aname="Installation"></a>
86
+
<aid="Installation"></a>
89
87
90
88
### Installation
91
89
@@ -105,7 +103,7 @@ Platform | Command
105
103
macOS or Linux | `pip install --no-cache-dir -U teradatasql`
106
104
Windows | `py -3 -m pip install --no-cache-dir -U teradatasql`
107
105
108
-
<aname="License"></a>
106
+
<aid="License"></a>
109
107
110
108
### License
111
109
@@ -115,15 +113,15 @@ When the driver is installed, the `LICENSE` and `THIRDPARTYLICENSE` files are pl
115
113
116
114
In addition to the license terms, the driver may contain beta/preview features ("Beta Features"). As such, by downloading and/or using the driver, in addition to the licensing terms, you acknowledge that the Beta Features are experimental in nature and that the Beta Features are provided "AS IS" and may not be functional on any machine or in any environment.
117
115
118
-
<aname="Documentation"></a>
116
+
<aid="Documentation"></a>
119
117
120
118
### Documentation
121
119
122
120
When the driver is installed, the `README.md` file is placed in the `teradatasql` directory under your Python installation directory. This permits you to view the documentation offline, when you are not connected to the Internet.
123
121
124
122
The `README.md` file is a plain text file containing the documentation for the driver. While the file can be viewed with any text file viewer or editor, your viewing experience will be best with an editor that understands Markdown format.
125
123
126
-
<aname="SamplePrograms"></a>
124
+
<aid="SamplePrograms"></a>
127
125
128
126
### Sample Programs
129
127
@@ -161,7 +159,7 @@ Program
161
159
[StoredProc.py](https://github.com/Teradata/python-driver/blob/master/samples/StoredProc.py) | Demonstrates how to create and call a SQL stored procedure
@@ -187,7 +185,7 @@ Connection parameters specified using a combination:
187
185
188
186
When a combination of parameters are specified, connection parameters specified as `kwargs` take precedence over same-named connection parameters specified in the JSON string.
`column_name` | `"false"` | quoted boolean | Controls the behavior of cursor `.description` sequence `name` items. Equivalent to the Teradata JDBC Driver `COLUMN_NAME` connection parameter. False specifies that a cursor `.description` sequence `name` item provides the AS-clause name if available, or the column name if available, or the column title. True specifies that a cursor `.description` sequence `name` item provides the column name if available, but has no effect when StatementInfo parcel support is unavailable.
205
203
`connect_failure_ttl` | `"0"` | quoted integer | Specifies the time-to-live in seconds to remember the most recent connection failure for each IP address/port combination. The driver subsequently skips connection attempts to that IP address/port for the duration of the time-to-live. The default value of zero disables this feature. The recommended value is half the database restart time. Equivalent to the Teradata JDBC Driver `CONNECT_FAILURE_TTL` connection parameter.
206
204
`connect_function` | `"0"` | quoted integer | Specifies whether the database should allocate a Logon Sequence Number (LSN) for this session, or associate this session with an existing LSN. Specify `0` for a session with no LSN (the default). Specify `1` to allocate a new LSN for the session. Specify `2` to associate the session with the existing LSN identified by the `logon_sequence_number` connection parameter. The database only permits sessions for the same user to share an LSN. Equivalent to the Teradata JDBC Driver `CONNECT_FUNCTION` connection parameter.
205
+
`connect_timeout` | `"0"` | quoted integer | Specifies the timeout in milliseconds for establishing a TCP socket connection. Zero means no timeout.
207
206
`cop` | `"true"` | quoted boolean | Specifies whether COP Discovery is performed. Equivalent to the Teradata JDBC Driver `COP` connection parameter.
208
207
`coplast` | `"false"` | quoted boolean | Specifies how COP Discovery determines the last COP hostname. Equivalent to the Teradata JDBC Driver `COPLAST` connection parameter. When `coplast` is `false` or omitted, or COP Discovery is turned off, then no DNS lookup occurs for the coplast hostname. When `coplast` is `true`, and COP Discovery is turned on, then a DNS lookup occurs for a coplast hostname.
209
208
`database` | | string | Specifies the initial database to use after logon, instead of the user's default database. Equivalent to the Teradata JDBC Driver `DATABASE` connection parameter.
`logdata` | | string | Specifies extra data for the chosen logon authentication method. Equivalent to the Teradata JDBC Driver `LOGDATA` connection parameter.
226
225
`logmech` | `"TD2"` | string | Specifies the logon authentication method. Equivalent to the Teradata JDBC Driver `LOGMECH` connection parameter. Possible case-insensitive values are `TD2` (the default), `BROWSER`, `JWT`, `LDAP`, `KRB5` for Kerberos, or `TDNEGO`. Browser Authentication is supported for Windows and macOS.
227
226
`logon_sequence_number` | | quoted integer | Associates this session with an existing Logon Sequence Number (LSN) when `connect_function` is `2`. The database only permits sessions for the same user to share an LSN. An LSN groups multiple sessions together for workload management. Using an LSN is a three-step process. First, establish a control session with `connect_function` as `1`, which allocates a new LSN. Second, obtain the LSN from the control session using the escape function `{fn teradata_logon_sequence_number}`. Third, establish an associated session with `connect_function` as `2` and the logon sequence number. Equivalent to the Teradata JDBC Driver `LOGON_SEQUENCE_NUMBER` connection parameter.
227
+
`logon_timeout` | `"0"` | quoted integer | Specifies the logon timeout in seconds. Zero means no timeout.
228
228
`manage_error_tables` | `"true"` | quoted boolean | Controls whether the driver manages the FastLoad error tables.
229
229
`max_message_body` | `"2097000"` | quoted integer | Specifies the maximum Response Message size in bytes. Equivalent to the Teradata JDBC Driver `MAX_MESSAGE_BODY` connection parameter.
230
230
`oidc_scope` | `"openid"` | string | Specifies the OpenID Connect (OIDC) scope to use for Browser Authentication. Beginning with Teradata Database 17.20.03.11, the default scope can be specified in the database's `TdgssUserConfigFile.xml` file, using the `IdPConfig` element's `Scope` attribute. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `OIDC_SCOPE` connection parameter.
`tmode` | `"DEFAULT"` | string | Specifies the transaction mode. Equivalent to the Teradata JDBC Driver `TMODE` connection parameter. Possible values are `DEFAULT` (the default), `ANSI`, or `TERA`.
245
245
`user` | | string | Specifies the database username. Equivalent to the Teradata JDBC Driver `USER` connection parameter.
246
246
247
-
<aname="COPDiscovery"></a>
247
+
<aid="COPDiscovery"></a>
248
248
249
249
### COP Discovery
250
250
@@ -279,7 +279,7 @@ The driver masks connection failures to down COPs, thereby hiding most connectio
279
279
280
280
If COP Discovery is turned off, or no COP hostnames are defined in DNS, the driver connects directly to the hostname specified in the `host` connection parameter. This permits load distribution schemes other than the COP Discovery approach. For example, round-robin DNS or a TCP/IP load distribution product can be used. COP Discovery takes precedence over simple database hostname lookup. To use an alternative load distribution scheme, either ensure that no COP hostnames are defined in DNS, or turn off COP Discovery with `cop` as `false`.
281
281
282
-
<aname="StoredPasswordProtection"></a>
282
+
<aid="StoredPasswordProtection"></a>
283
283
284
284
### Stored Password Protection
285
285
@@ -473,7 +473,7 @@ Before decryption, the driver calculates the MAC using the ciphertext, transform
473
473
474
474
Finally, the driver uses the decrypted password to log on to the database.
475
475
476
-
<aname="ClientAttributes"></a>
476
+
<aid="ClientAttributes"></a>
477
477
478
478
### Client Attributes
479
479
@@ -526,7 +526,7 @@ Field | Source | Description
526
526
7 | driver | The client program name
527
527
8 | driver | The string `01 LSS` to indicate the `LogonSource` string version `01`
528
528
529
-
<aname="TransactionMode"></a>
529
+
<aid="TransactionMode"></a>
530
530
531
531
### Transaction Mode
532
532
@@ -549,7 +549,7 @@ A drawback of using ANSI mode is that you can only call stored procedures that w
549
549
550
550
Refer to the Teradata Reference / *SQL Request and Transaction Processing* for complete information regarding the differences between ANSI and TERA transaction modes.
551
551
552
-
<aname="AutoCommit"></a>
552
+
<aid="AutoCommit"></a>
553
553
554
554
### Auto-Commit
555
555
@@ -603,7 +603,7 @@ Please note that neither previous example shows best practices. Best practices r
603
603
cur.execute("insert into mytable2 values(3, 4)")
604
604
con.commit()
605
605
606
-
<aname="DataTypes"></a>
606
+
<aid="DataTypes"></a>
607
607
608
608
### Data Types
609
609
@@ -669,7 +669,7 @@ Transforms are used for SQL `ARRAY` data values, and they can be transferred to
669
669
670
670
Transforms are used for structured UDT data values, and they can be transferred to and from the database as `VARCHAR` values.
671
671
672
-
<aname="NullValues"></a>
672
+
<aid="NullValues"></a>
673
673
674
674
### Null Values
675
675
@@ -689,7 +689,7 @@ To avoid database error 3532 in this situation, your application must use the th
689
689
690
690
cur.execute("{fn teradata_parameter(1, BYTE(4))}update mytable set bytecolumn = ?", [None])
691
691
692
-
<aname="CharacterExportWidth"></a>
692
+
<aid="CharacterExportWidth"></a>
693
693
694
694
### Character Export Width
695
695
@@ -721,7 +721,7 @@ Or wrap query in a view with `CAST` or `TRIM` to avoid trailing space padding:
721
721
722
722
This technique is also demonstrated in sample program `CharPadding.py`.
723
723
724
-
<aname="ModuleConstructors"></a>
724
+
<aid="ModuleConstructors"></a>
725
725
726
726
### Module Constructors
727
727
@@ -769,7 +769,7 @@ Creates and returns a `datetime.datetime` value.
769
769
770
770
Creates and returns a `datetime.datetime` value corresponding to the specified number of seconds after 1970-01-01 00:00:00.
771
771
772
-
<aname="ModuleGlobals"></a>
772
+
<aid="ModuleGlobals"></a>
773
773
774
774
### Module Globals
775
775
@@ -789,7 +789,7 @@ Integer constant `2` indicating that threads may share this module, and threads
789
789
790
790
String constant `"qmark"` indicating that prepared SQL requests use question-mark parameter markers.
791
791
792
-
<aname="ModuleExceptions"></a>
792
+
<aid="ModuleExceptions"></a>
793
793
794
794
### Module Exceptions
795
795
@@ -801,7 +801,7 @@ String constant `"qmark"` indicating that prepared SQL requests use question-mar
801
801
*`teradatasql.OperationalError` is raised for errors related to the database's operation.
802
802
*`teradatasql.ProgrammingError` is raised for SQL object existence errors and SQL syntax errors. Not supported yet.
803
803
804
-
<aname="ConnectionMethods"></a>
804
+
<aid="ConnectionMethods"></a>
805
805
806
806
### Connection Methods
807
807
@@ -835,7 +835,7 @@ Creates and returns a new Cursor object for the Connection.
835
835
836
836
Rolls back the current transaction.
837
837
838
-
<aname="CursorAttributes"></a>
838
+
<aid="CursorAttributes"></a>
839
839
840
840
### Cursor Attributes
841
841
@@ -868,7 +868,7 @@ Read-only attribute consisting of a sequence of seven-item sequences that each d
868
868
869
869
Read-only attribute indicating the number of rows returned from, or affected by, the current SQL statement.
870
870
871
-
<aname="CursorMethods"></a>
871
+
<aid="CursorMethods"></a>
872
872
873
873
### Cursor Methods
874
874
@@ -946,7 +946,7 @@ Has no effect.
946
946
947
947
Has no effect.
948
948
949
-
<aname="TypeObjects"></a>
949
+
<aid="TypeObjects"></a>
950
950
951
951
### Type Objects
952
952
@@ -980,7 +980,7 @@ Identifies a SQL `CHAR`, `CLOB`, `INTERVAL`, `PERIOD`, or `VARCHAR` column as a
@@ -1246,7 +1246,7 @@ To represent a double-quote character in a string enclosed in double-quote chara
1246
1246
1247
1247
{fn teradata_field_quote("""")}
1248
1248
1249
-
<aname="FastLoad"></a>
1249
+
<aid="FastLoad"></a>
1250
1250
1251
1251
### FastLoad
1252
1252
@@ -1301,7 +1301,7 @@ Your application ends FastLoad by committing or rolling back the current transac
1301
1301
1302
1302
Warning and error information remains available until the next batch is inserted or until the commit or rollback. Each batch execution clears the prior warnings and errors. Each commit or rollback clears the prior warnings and errors.
1303
1303
1304
-
<aname="FastExport"></a>
1304
+
<aid="FastExport"></a>
1305
1305
1306
1306
### FastExport
1307
1307
@@ -1332,7 +1332,7 @@ Your application can prepend other optional escape functions to the query:
1332
1332
After beginning a FastExport, your application can obtain the Logon Sequence Number (LSN) assigned to the FastExport by prepending the following escape functions to the query:
1333
1333
*`{fn teradata_nativesql}{fn teradata_logon_sequence_number}` returns the string form of an integer representing the Logon Sequence Number (LSN) for the FastExport. Returns an empty string if the request is not a FastExport.
1334
1334
1335
-
<aname="CSVBatchInserts"></a>
1335
+
<aid="CSVBatchInserts"></a>
1336
1336
1337
1337
### CSV Batch Inserts
1338
1338
@@ -1363,7 +1363,7 @@ Limitations when using CSV batch inserts:
1363
1363
* For SQL batch insert, some records may be inserted before a parsing error occurs. A list of the parser errors will be returned. Each parser error will include the line number (starting at line 1) and the column number (starting at zero).
1364
1364
* Using a CSV file with FastLoad has the same limitations and is used the same way as described in the [FastLoad](#FastLoad) section.
1365
1365
1366
-
<aname="CSVExportResults"></a>
1366
+
<aid="CSVExportResults"></a>
1367
1367
1368
1368
### CSV Export Results
1369
1369
@@ -1415,10 +1415,13 @@ Limitations when exporting to CSV files:
1415
1415
* Not all data types are supported. For example, `BLOB`, `BYTE`, and `VARBYTE` are not supported and if one of these column types are present in the result set, an error will be returned.
1416
1416
*`CLOB`, `XML`, `JSON`, and `DATASET STORAGE FORMAT CSV` data types are supported for SQL query results and are exported as string values, but these data types are not supported by FastExport.
0 commit comments