teradata

SQLAlchemy Unicode Error - Querying Teradata database

。_饼干妹妹 提交于 2019-12-08 11:29:25
问题 I'm trying to use Python's SQLAlchemy library to query a Teradata database. I was able to create the engine okay using the following code. from sqlalchemy import create_engine td_engine = create_engine('teradata://' + 'usrname' + ':' + 'pswrd' + '@' + 'myOdbcDataSource' + ':22/?charset=UTF8') But when I try to use the engine, I get the following error. ValueError: character U+590048 is not in range [U+0000; U+10ffff] This error occurs using all the functions that interact with the database

Multiprocessing with JDBC connection and pooling

点点圈 提交于 2019-12-08 11:12:50
问题 I would like to create a parallel process which gets Data from a Database. I am using a JDBC connector which works quite fine if i run my program not in parallel: conn = jaydebeapi.connect("com.teradata.jdbc.TeraDriver", "jdbc:teradata://DBNAME"+str(i)+"/LOGMECH=LDAP", ["LIB_NAME", "PWD"], "/home/user/TeraJDBC/terajdbc4.jar:/home/user/TeraJDBC/tdgssconfig.jar", ) curs = conn.cursor() However I want to fasten that process and so I am using: from joblib import Parallel, delayed, parallel

Teradata: How to add range partition to non empty table?

与世无争的帅哥 提交于 2019-12-08 10:19:15
问题 I have such table: CREATE SET TABLE ONLINE_BANKING.TRANSACTIONS ,NO FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKRATIO ( transaction_id INTEGER NOT NULL, date_of_transaction DATE FORMAT 'YYYYMMDD' NOT NULL, amount_of_transaction DECIMAL(38,2) NOT NULL, transaction_type_code BYTEINT NOT NULL DEFAULT 25 , UNIQUE PRIMARY INDEX ( transaction_id ); I would like to add partition to my filled with data table to date_of_transaction column. I tried this way:

Connecting R To Teradata VOLATILE TABLE

落爺英雄遲暮 提交于 2019-12-08 10:02:57
问题 I am using R to try and connect to a teradata database and am running into difficulties The steps in the process are below 1) Create Connection 2) Create a VOLATILE TABLE 3) Load information from a data frame into the Volatile table Here is where it fails, giving me an error message Error in sqlSave(conn, mydata, tablename = "TEMP", rownames = FALSE, : first argument is not an open RODBC channel The code is below # Import Data From Text File and remove duplicates mydata = read.table("Keys.txt

How can I bulk insert?

时光毁灭记忆、已成空白 提交于 2019-12-08 06:54:51
问题 I want to insert data to TERADATA with jdbc.But it is slow. How can I make it faster? I wrote this code: connection_tera= DriverManager.getConnection ( "jdbc:teradata://192.168.x.xx/database=DBC,tmode=ANSI,charset=UTF8","dbc","dbc" ); stmt_tera = connection_tera.prepareStatement("insert into a.b values(?)"); //some code here to start while loop stmt_tera.setObject(i,reset.getobject(i)); stmt_tera.addBatch(); if(addedBatchNumber%100==0) stmt_tera.executeBatch(); connection_tera.commit(); stmt

Snapshot too old error

送分小仙女□ 提交于 2019-12-08 06:28:09
问题 I am getting 'snapshot too old error' frequently while i am running my workflow when it runs for more than 5 hrs.My source is oracle and target is Teradata. Please help to solve this issue.Thanks in advance 回答1: The best explanation of the ORA-01555 snapshot too old error that I've read, is found in this AskTom thread Regards. 回答2: The snapshot too old error is more or less directly related to the running time of your queries (often a cursor of a FOR loop). So the best solution is to optimize

export result into excel sheet from teradata sql assistant

家住魔仙堡 提交于 2019-12-08 05:27:17
问题 I want to export the results into excel sheet by running the query in Teradata SQL Assistant. I used copy paste but it didnt work Thanks in advance. 回答1: If you return the answers to SQL Assistant you should be able to select Save Answerset from the File menu. You will then have the option to save it as a proper Excel file format. If you export the answers to a flat file directly the delimited text file can in turn be opened with ease in Excel and then saved as a proper Excel file format (XLS

Date Function in Teradata

送分小仙女□ 提交于 2019-12-08 05:04:24
问题 Is there a function in Teradata, that "makes" a date by giving day, month any year as parameters? SO if I have integer parameters p1_day, p2_month, and p3_year (which are, by the way, attributes), is there a function like date_function (p1_day, p2_month, and p3_year) -> for example '2013-12-11' 回答1: In TD13.10+ you can create a simple SQL UDF: -- (year, month, day) to date, "invalid date" error if no valid date REPLACE FUNCTION ymd_to_date(y INTEGER, m INTEGER, d INTEGER) RETURNS DATE

Pyodbc Issue with Teradata

泄露秘密 提交于 2019-12-08 03:40:28
问题 Getting below error while connecting with Teradata from pyodbc in Linux ('632', '[632] 523 630 (0) (SQLDriverConnect)') Details below: Connection String DRIVER={Teradata};DBCNAME=;UID=;PWD=;QUIETMODE=YES; Pyodbc Version:pyodbc-2.1.8 Python Version: 2.7.3 Teradata below: RELEASE 14.10.03.07 VERSION 14.10.03.06 Linux Host Details: 2.6.39-400.17.2.el5uek Please help. 回答1: Need to export ODBCINI path, its done export ODBCINI=/opt/teradata/client/14.10/odbc_64/odbc.ini 来源: https://stackoverflow

SQL UPDATE row Number

岁酱吖の 提交于 2019-12-08 01:41:22
问题 I have a table serviceClusters with a column identity(1590 values). Then I have another table serviceClustersNew with the columns ID, text and comment. In this table, I have some values for text and comment, the ID is always 1. Here an example for the table: [1, dummy1, hello1; 1, dummy2, hello2; 1, dummy3, hello3; etc.] WhaI want now for the values in the column ID is the continuing index of the table serviceClusters plus the current Row number: In our case, this would be 1591, 1592 and 1593