Quantcast
Channel: Teradata Forums - All forums
Viewing all 27759 articles
Browse latest View live

Unable to launch Teradata Studio Express - response (31) by newb1

$
0
0

WHERE DO YOU FIND OUT THE HOST NAME? I HAVE TDE 14.00.03.02 for VMware (4GB) AND ​I HAVE THE SAME PROBLEM WITH THE CONNECTION TO THE DATABASE. I THINK THE INSTRUCTIONS SHOULD BE REWRITTEN IN A MORE DETAIL AROUND THIS.


Unable to launch Teradata Studio Express - response (32) by newb1

$
0
0

Ok I've worked out how to do this in Studio Express  for TDE 14.00.03.02 for VMware (4GB) if you running on a PC with Windows. Database Server Name: 127.0.0.1 , User Name (Domain): DBC, Password: DBC
 
This will give you the same as the bteq example here :
​http://developer.teradata.com/database/articles/teradata-express-14-0-for-vmware-user-guide

DET DEFINE OFF in SQL Developer - forum topic by amirk

$
0
0

Hi,
I am using Oracle SQL Developer to connect to Teradata via TeraJDBC 15.10.00.14.
I am trying to run a script that has & in it, and want to turn off variable definition to prevent TD to ask me for variable values. However, I seem not to be able to run the "SET DEFINE OFF" command that was suggested in this TD forum and other similar posts:
https://forums.teradata.com/forum/tools/sqlplus-spool-to-fastload-via-named-pipe-windows-is-barely-faster-than-by-flat-file
 
Here are the errors that I get when I try different versions of the code:
>>> set define off;
Syntax error: expected something between the word 'define' and the 'off' keyword.
>>> SET DEFINE=OFF;
Syntax error: expected something between '=' and the 'OFF' keyword.
>>> SET SCAN OFF;

Syntax error: expected something between the word 'SCAN' and the 'OFF' keyword.

 

 

Please help. Thank you in advance!
 
 

Forums: 

ODBC connect to DB2 in TPT - TPT_INFRA: TPT02192: Error: Cannot load shared library - forum topic by sboxtops

$
0
0

Hi,
 
I'm writing a TPT script to connect to DB2 with ODBC. The ODBC DB2 drivers are 64 bit. I'm running on AIX unix. Below is the error, some teradata libraries, and the tpt script. Please let me know if you need any additional information. Thank you for your help.
 
/home/idxxx >> tbuild -f load_db2_connect.tpt
Teradata Parallel Transporter Version 14.00.00.08
Job log: /opt/teradata/client/14.00/tbuild/logs/idxxx-1.out
Job id is idxxx-1, running on etlpxapp01
Teradata Parallel Transporter SQL DDL Operator Version 14.00.00.08
DDL_OPERATOR: private log not specified
DDL_OPERATOR: connecting sessions
DDL_OPERATOR: sending SQL requests
DDL_OPERATOR: TPT10508: RDBMS error 3807: Object 'cm_raw.sss_kids_001_ET' does not exist.
DDL_OPERATOR: TPT18046: Warning: error is ignored as requested in ErrorList
DDL_OPERATOR: TPT10508: RDBMS error 3807: Object 'cm_raw.sss_kids_001_UV' does not exist.
DDL_OPERATOR: TPT18046: Warning: error is ignored as requested in ErrorList
DDL_OPERATOR: TPT10508: RDBMS error 3807: Object 'cm_raw.sss_kids_001_LG' does not exist.
DDL_OPERATOR: TPT18046: Warning: error is ignored as requested in ErrorList
DDL_OPERATOR: Rows Deleted:  0
DDL_OPERATOR: disconnecting sessions
DDL_OPERATOR: Total processor time used = '0.03316 Second(s)'
DDL_OPERATOR: Start : Sat May 21 08:18:25 2016
DDL_OPERATOR: End   : Sat May 21 08:18:26 2016
Job step Setup_Tables completed successfully
TPT_INFRA: TPT02192: Error: Cannot load shared library
           dlopen error: Could not load module /opt/teradata/client/14.00/tbuild/lib/libodbcop.so.
        Dependent module /etl/IBM/InformationServer/Server/branded_odbc/lib/libodbc.a(odbc.so) could not be loaded.
        The module has an invalid magic number.
Could not load module /opt/teradata/client/14.00/tbuild/lib/libodbcop.so.
        Dependent module /opt/teradata/client/14.00/tbuild/lib/libodbcop.so could not be loaded.
TPT_INFRA: TPT02109: Cannot open shared library libodbcop.so, status = Open Error
TPT_INFRA: TPT02240: Error: Cannot create operator object, status = Operator Error
TPT_INFRA: TPT02103: Executor unable to set up its table object
Job step load_ld_table_from_file terminated (status 12)
Job idxxx terminated (status 12)

/home/idxxx >> cd /opt/teradata/client
/opt/teradata/client >> ls
13.10    14.00    ODBC_32  ODBC_64  lib      odbc

/opt/teradata/client >> cd 14.00
/opt/teradata/client/14.00 >> ls
bin        bin64      include    jmsaxsmod  lib        lib64      odbc_32    odbc_64    sample     tbuild     tdicu

/opt/teradata/client/14.00 >> cd tbuild
/opt/teradata/client/14.00/tbuild >> ls
bin          inc          lib64        mmap         msg64        template     twbcfg.ini   version
checkpoint   lib          logs         msg          sample       tptapi       twboper.ini

/opt/teradata/client/14.00/tbuild >> cd lib
/opt/teradata/client/14.00/tbuild/lib >> ls -l
total 25883
-r--r--r--    1 root     system      1699794 Nov 06 2012  libdataconop.so
-r--r--r--    1 root     system        57885 Nov 06 2012  libddlop.so
-r--r--r--    1 root     system       150155 Nov 06 2012  libexportop.so
-r--r--r--    1 root     system      1323861 Nov 06 2012  libfeomop.so
-r--r--r--    1 root     system      1313447 Nov 06 2012  libflimop.so
-r--r--r--    1 root     system       114051 Nov 06 2012  libinsertop.so
-r--r--r--    1 root     system       133003 Nov 06 2012  libloadop.so
-r--r--r--    1 root     system        66441 Nov 06 2012  liblogview.so
-r--r--r--    1 root     system      1320615 Nov 06 2012  libmlimop.so
-r--r--r--    1 root     system       303270 Nov 06 2012  libodbcop.so
-r--r--r--    1 root     system       589734 Nov 06 2012  libopcommon.so
-r--r--r--    1 root     system        14449 Nov 06 2012  liboscmdop.so
-r--r--r--    1 root     system       175748 Nov 06 2012  libptmin.so
-r--r--r--    1 root     system        38972 Nov 06 2012  libptmos.so
-r--r--r--    1 root     system       208157 Nov 06 2012  libptmpi.so
-r--r--r--    1 root     system        87385 Nov 06 2012  libptmpo.so
-r--r--r--    1 root     system      2893405 Nov 06 2012  libpxcommon.so
-r--r--r--    1 root     system       207750 Nov 06 2012  libpxextrct.so
-r--r--r--    1 root     system        15128 Nov 06 2012  libpxicu.so
-r--r--r--    1 root     system        59485 Nov 06 2012  libschemapop.so
-r--r--r--    1 root     system       133719 Nov 06 2012  libselectop.so
-r--r--r--    1 root     system       367906 Nov 07 2012  libstreamop.so
-r--r--r--    1 root     system       487007 Nov 06 2012  libtableqry.so
-r--r--r--    1 root     system      1314970 Nov 06 2012  libtelapi.so
-r--r--r--    1 root     system       133534 Nov 06 2012  libupdateop.so

/opt/teradata/client/14.00/tbuild/lib >> cd ../lib64
/opt/teradata/client/14.00/tbuild/lib64 >> ls -l
total 6201
-r--r--r--    1 root     system       164098 Nov 06 2012  libexportop.so
-r--r--r--    1 root     system       142112 Nov 06 2012  libloadop.so
-r--r--r--    1 root     system       638313 Nov 06 2012  libopcommon.so
-r--r--r--    1 root     system        16604 Nov 06 2012  libpxicu.so
-r--r--r--    1 root     system       396336 Nov 07 2012  libstreamop.so
-r--r--r--    1 root     system      1666588 Nov 06 2012  libtelapi.so
-r--r--r--    1 root     system       142887 Nov 06 2012  libupdateop.so

tpt script:
/***********************************************************************
-- This script mloads a table reading a flat file using LOAD operator

-- MANUAL UPDATES WERE MADE by xxxx on mm/dd/yyyy.
-- MANUAL UPDATES WERE MADE by xxxx on mm/dd/yyyy.
*************************************************************************/

DEFINE JOB FILE_LOAD

DESCRIPTION ' This TPT script is used to load a flat file to a table. '
(
DEFINE SCHEMA ACTIVE_EMPS_schema
(
   CORP_ENT_CD CHAR(10)                           /* 1   8   1   - 8          */
  ,SRC_REC_STA_CD CHAR(1)                         /* 2   5   9   - 13         */
);

DEFINE OPERATOR  DDL_OPERATOR
DESCRIPTION 'TPT DDL OPERATOR - do initial table prep work items.'
TYPE DDL
ATTRIBUTES
(
 VARCHAR TdpId = 'edwp',
 VARCHAR UserName = 'idxxx',
 VARCHAR UserPassword = 'xxxx',
 VARCHAR ErrorList = '3807'
);

DEFINE OPERATOR  ODBC_OPERATOR
DESCRIPTION 'TPT ODBC OPERATOR - connect to db2.'
TYPE ODBC
SCHEMA ACTIVE_EMPS_schema
ATTRIBUTES
(
 VARCHAR DSNname = 'IDSPRDDA',
 VARCHAR UserName = 'idxxx',
 VARCHAR UserPassword = 'wwww',
 VARCHAR SelectStmt = 'select corp_ent_cd, src_rec_sta_cd from PODDB01.pty_key_mgmt fetch first 1 rows only with ur;'
);

DEFINE OPERATOR LOAD_OPERATOR
TYPE LOAD
SCHEMA *
ATTRIBUTES
(
 VARCHAR TdpId = 'edwp',
 VARCHAR UserName = 'idxxx',
 VARCHAR UserPassword = 'xxxx',
 VARCHAR TargetTable = 'cm_raw.sss_kids_001',
 VARCHAR LogTable = 'cm_raw.sss_kids_001_LG',
 VARCHAR ErrorTable1 = 'cm_raw.sss_kids_001_ET',
 VARCHAR ErrorTable2 = 'cm_raw.sss_kids_001_UV',
 INTEGER MaxSessions = 4,
 INTEGER MinSessions = 1,
 INTEGER ErrorLimit = 99999999
);

STEP Setup_Tables
(
APPLY
 ('DROP TABLE cm_raw.sss_kids_001_ET;'),
 ('DROP TABLE cm_raw.sss_kids_001_UV;'),
 ('DROP TABLE cm_raw.sss_kids_001_LG;'),
 ('DELETE FROM cm_raw.sss_kids_001;')
TO OPERATOR (DDL_OPERATOR);
);

STEP load_ld_table_from_file
(
APPLY
  ('INSERT INTO cm_raw.sss_kids_001(
   :CORP_ENT_CD
  ,:SRC_REC_STA_CD
  );')
TO OPERATOR (LOAD_OPERATOR)
SELECT * FROM OPERATOR(ODBC_OPERATOR);
);

);
);
 

Forums: 

Macro vs Procedure - SQL SECURITY - response (3) by sjuolay

$
0
0

Thank you Dieter and Tom. I am a bit confused though.

As per the DDL document as quoted above :
The user creating a macro must have the privileges for all statements it performs.

And as the DCL document :
For example, CompAnalyst6 can grant herself full access to all tables in the database through a simple macro and then create any database object or perform a query that reports on salary and bonus data for each employee in the enterprise in the three quick steps outlined in the following procedure:
1 CREATE MACRO everything AS
(GRANT ALL PRIVILEGES ON compensation
TO companalyst6;);
2 EXECUTE everything;
3 SELECT *
FROM salary, bonus;

My Question now is :
Why should Step 1 execute successfully if CompAnalyst6 does not have access to GRANT ALL PRIVILEGES?

What am I missing?

Are these documents suggesting Procedures are more secure than Macros?

Does teradata provide any function for Data Redaction? - forum topic by priyankbansal

to divide the data usinng modulus - forum topic by nambir

$
0
0

I am trying to use
sel accnt_no from abc 
where cast(accnt_no as bignit) mod 2 = 0
 
i am getting bad character error in this..what could be the possible issue in here?

Forums: 

to divide the data usinng modulus - forum topic by nambir

$
0
0

I am trying to use
sel accnt_no from abc 
where cast(accnt_no as bignit) mod 2 = 0
 
i am getting bad character error in this..what could be the possible issue in here?

Forums: 

TIPS TO CONVERT DECIMAL TO VARCHAR - response (2) by rubenjdc

$
0
0

Hi Dieter, thanks for your answer.
Your tip works, and i can make a good select, but in the select statement in my tpt i insert the select what i test on Teradata Studio and show me this error:
 
TPT_INFRA: TPT03589: in SELECT part. Check with the syntax below.

APPLY {dml-list} TO OPERATOR
    (operator-name {[n]} {ATTR (attribute-list)})
SELECT {(column-list) | *} FROM OPERATOR
    (operator-name {[m]} {ATTR (attribute-list)});

Comma separated multiple APPLY statements can be specified.
UNION ALL separated multiple SELECT statements can be specified.
I put this select:
SELECT cast(substr(col1,1,9) as varchar(9)), col2, col3, col4, col5, col6, trim(col7 (format '-(10)9.99')), trim(col8 (format '-(10)9.99')), cast(col9 as varchar(64)), trim(col10 (format '-(10)9.99')), trim(col11 (format '-(10)9.99')), trim(col12 (format '-(10)9.99')), cast(col13  as varchar(64)), cast(col14 as varchar(64)), cast(col15 as varchar(64)), col16, trim(col17 (format '-(10)9.99')) FROM table.datalab;
 
Thanks for all
 

DET DEFINE OFF in SQL Developer - response (1) by CarlosAL

$
0
0

Hi.
Teradata DOES NOT ask you for the values. This (variable substitution) is a SQL Developer feature that happens BEFORE sending the request to Teradata.
SET DEFINE OFF works in SQL Developer just the same as it works in sql*plus.
You neglect to show your real code, no chances to help you...
Cheers.
Carlos.

TIPS TO CONVERT DECIMAL TO VARCHAR - response (3) by dnoeth

$
0
0

You need to double each single quote because the APPLY statement is s string:

'SELECT cast(substr(col1,1,9) as varchar(9)), col2, col3, col4, col5, col6,
 trim(col7 (format ''-(10)9.99'')), trim(col8 (format ''-(10)9.99'')), 
cast(col9 as varchar(64)), trim(col10 (format ''-(10)9.99'')), 
trim(col11 (format ''-(10)9.99'')), trim(col12 (format ''-(10)9.99'')), 
cast(col13  as varchar(64)), cast(col14 as varchar(64)),
 cast(col15 as varchar(64)), col16, trim(col17 (format ''-(10)9.99'')) 
FROM table.datalab;'

 

to divide the data usinng modulus - response (1) by dnoeth

$
0
0

Well, the issue is a bad character :-)
 
You simply got some non-digits in acct_no. Switch to TO_NUMBER instead:
WHERE TO_NUMBER(acct_no) MOD 2 = 0
 
You can also use it to find the bad rows
WHERE TO_NUMBER(acct_no) IS NULL

TIPS TO CONVERT DECIMAL TO VARCHAR - response (4) by rubenjdc

$
0
0

Omg i didnt realise about that, i have thousands things in my mind and i dindt think about this.
Thanks so much Dieter, it works.
 

BTEQ set width option - forum topic by sanjaythyagu

$
0
0

Hi,

 

In my BTEQ statement, I'm selecting two columns of a table and I'm exporting the output to local file. When I check that file only one column is present. I even tried giving the maximum value for .set width option (65531). It was not working. Please help me on this.

 

Thanks in advance,

Sanjay.

Forums: 

TIPS TO CONVERT DECIMAL TO VARCHAR - response (5) by rubenjdc

$
0
0

One last thing
I need to replace dot for comma in numbers and i use this select:
SelectStmt = 'SELECT cast(substr(col1,1,9) as varchar(9)) as col1, col2,col3,col4, col5, col6, oreplace(trim(col7 (format ''-(12)9.99'')),''.'','','') , oreplace(trim(col8 (format ''-(12)9.99'')),''.'','','') ,cast(col9 as varchar(64)), oreplace(trim(col10 (format ''-(12)9.99'')),''.'','',''), oreplace(trim(col11 (format ''-(12)9.99'')),''.'','',''), oreplace(trim(col12 (format ''-(12)9.99'')),''.'','','') ,cast(col13  as varchar(64)), cast(col14 as varchar(64)),cast(col15 as varchar(64)), col16, oreplace(trim(col17 (format ''-(12)9.99'')),''.'','','')  FROM DL_CLIENTES.VW_CL_FACT_DIARIA;',
In TD studio theres not problem with the query but in tpt show the following error:
 
TPT_INFRA: TPT02638: Error: Conflicting data length for column(7) - col7. Source column's data length (64) Target column's data length (8000).
 
Its like didnt make fine the transformation

 


TIPS TO CONVERT DECIMAL TO VARCHAR - response (6) by dnoeth

$
0
0

Now it's getting ugly :)
oREPLACE is a UDF and return a VARCHAR(8000), you can either add another CAST:

CAST(oTranslate(trim(col7 (format '-(12)9.99')),'.',',') AS VARCHAR(64)

(I also switched to oTRANSLATE instead of oREPLACE)
or you switch to TO_CHAR, where you can specify the seperators, but now doubling quotes gets really ugly:

to_char(col7, ''99999999999.99'', ''NLS_NUMERIC_CHARACTERS = '''',.'''''')

 

REPLACE PROCEDURE Failed. 5863: Problem encountered during compilation phase of C code. - forum topic by tiiiway

$
0
0

Please Help: Unable to compile Stored Procedure

Hello All,

I have the simple SP and I'm unable to compilefrom sql assistant or bteq. I keep getting an error:'5863:

Problem encountered during compilation phase of C code.

I was just recompiling the existing store procedure.

Thank you in advance.

Forums: 

Teradata JNDI connectivity - response (6) by kalanithi4

$
0
0

Hi Team,
I am new to teradata. I am trying to install the tearadata in my laptop for learning. I dont know what to give in the URL for while connecting to the window. If i try to run a quer i am getting the error "Cannot execute sel without a connection".Kindly help me on this
 
Thanks in advance

Macro vs Procedure - SQL SECURITY - response (4) by tomnolan

$
0
0

Teradata Database Reference / SQL Data Control Language / Chapter 2 "Statement Syntax / section "Grant (SQL Form) / subsection "Security Considerations With the CREATE MACRO Privilege" says the following:

Before you grant CREATE MACRO on a database or user, it is extremely important to realize that the recipient of that privilege can create and perform macros that have all the privileges of that database or user. This is because for CREATE MACRO, the privileges are inherited from the immediate owner of the macro, not from its creator. 

 
The purpose of that documentation is not to say that "stored procedures are more secure than macros". Instead, that documentation is intended to inform you that the CREATE MACRO privilege is a very powerful privilege, and great care must be taken to ensure that privilege is only granted as needed.
 

DET DEFINE OFF in SQL Developer - response (2) by amirk

$
0
0

Thanks for your response, Carlos.
My original query looks like this:
SELECT a,b,c, FROM table_a
WHERE a = 'Abercombie & Fitch';
When I run the query, I get a dialog box asking for the value of "Fitch".
I understand that this happens at SQL Developer end, not in Teradata. But when I run "SET DEFINE OFF" in SQL Developer, I get the following error:
"SQL Error: [Teradata Database] [TeraJDBC 15.10.00.14] [Error 3706] [SQLState 42000] Syntax error: expected something between the word 'define' and the 'off' keyword."
This has made me thinking maybe SQL Developer sends this query to TD prematurely, which results in TD being confused about the query.
Has anybody used SQL Developer with Teradata and had similar experience? How did you turn the variable definition off in SQL Developer?
Thanks again for your help. And thank you for your patience as I learn how to effectively post my questions and to include my query details in my posts. I am a newbie to TD and this forum!
Amir
 
 

 

Viewing all 27759 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>