Quantcast
Channel: Teradata Forums - Database
Viewing all 14773 articles
Browse latest View live

Teradata SQL Assistant Import - forum topic by john9

$
0
0

Hi All -
 
Can you please help me findin a solution for below issue.
 
I am trying to import txt file data into teradta table using import option and iam getting below error
 Error importing record 0:  [100056] Total size of parameters is greater than the max Data parcel size.
Only 0 rows were loaded. 
Can some please help me to overcome this error to lod the data into tabel.
I am using ODBC connection
Thank you

Forums: 

Teradata SQL Assistant Import - response (1) by manib0907

$
0
0

Usually, this error comes up when the size of SQL issued to Teradata is greater than the allowed length (1 MB).
Can you check if the generated SQL is large enough to cause this error? If yes, you can breakup sql and create its view to avoid this error.
 
Cheers,
BM

qualify rank() over (partition.....question - response (19) by Shashank0586

$
0
0

Hi Dieter,
I need your help to prepare a query for the below scenario.
My input is :-
Three columns Subscr_Id, Start_Dt, End_Dt, for a Subscr_Id = 151 we have different start_dt and End_dt as below:-

high date= 31-12-9999
 
I want my output to look like below for the same Subscr_Id:-

How can I check if user is locked using query? - forum topic by aklopis

$
0
0

Hi.
 
How can I check if user is locked using query?
I tried that query:

SELECT * 
FROM DBC.USERS
WHERE lockedCount>1;

 
Is this ok? I do not have access to other users so I cannot check if the query is okay. 
 
Thanks:-)

Forums: 

Reading XML from CLOB Datatype in Teradata 14.0 - forum topic by SudhanshuV

$
0
0

Hi All,
As per my requirement I have a parse a XML file loaded into a CLOB in Teradata 14.0.
Below is one sample XML loaded into a table named customer:
Table Definition:

CREATE SET TABLE SRC_PCS_ETL_TARGET.customer ,NO FALLBACK ,

     NO BEFORE JOURNAL,

     NO AFTER JOURNAL,

     CHECKSUM = DEFAULT,

     DEFAULT MERGEBLOCKRATIO

     (

      customerID INTEGER,

      customerName VARCHAR(256) CHARACTER SET LATIN NOT CASESPECIFIC,

      customerXML CLOB(2097088000) CHARACTER SET LATIN)

PRIMARY INDEX ( customerID );

 

Insert Query:

INSERT INTO customer (1, 'John Hancock', CREATEXML('<?xml version="1.0" encoding="UTF-8"?>

<Customer ID="C00-10101">

<Name>John Hancock</Name>

<Address>100 1st Street, San Francisco, CA 94118</Address>

<Phone1>(858)555-1234</Phone1>

<Phone2>(858)555-9876</Phone2>

<Fax>(858)555-9999</Fax>

<Email>John@somecompany.com</Email>

<Order Number="NW-01-16366" Date="2012-02-28">

<Contact>Mary Jane</Contact>

<Phone>(987)654-3210</Phone>

<ShipTo>Some company, 2467 Pioneer Road, San Francisco, CA - 94117</ShipTo>

<SubTotal>434.99</SubTotal>

<Tax>32.55</Tax>

<Total>467.54</Total>

<Item ID="001">

<Quantity>10</Quantity>

<PartNumber>F54709</PartNumber>

<Description>Motorola S10-HD Bluetooth Stereo Headphones</Description>

<UnitPrice>29.50</UnitPrice>

<Price>295.00</Price>

</Item>

<Item ID="101">

<Quantity>1</Quantity>

<PartNumber>Z19743</PartNumber>

<Description>Motorola Milestone XT800 Cell Phone</Description>

<UnitPrice>139.99</UnitPrice>

<Price>139.99</Price>

</Item>

</Order>

</Customer>'));

 

Can anyone please help me with the query to read parse this XML??

 

I tried using below query but it's throwing error like Failed 9134: a general failure occured in the function:

 

SELECT X.*

FROM (SELECT * FROM customer WHERE customerID = 1) AS C,
XMLTable (
'/Customer/Order/Item'
PASSING C.customerXML
COLUMNS
"Seqno"FORORDINALITY,
"CustomerName" VARCHAR(64) PATH '../../Name',
"OrderNumber" VARCHAR(32) PATH '../@Number',
"OrderDate" DATE PATH '../@Date',
"ItemID" VARCHAR(12) PATH '@ID',
"Quantity" INTEGER PATH 'Quantity',
"UnitPrice" DECIMAL(9,2),
"TotalPrice" DECIMAL(9,2) PATH 'Price'
) AS X ("Sequence #", "Customer Name", "Order #", "Order Date", "Item ID", "Qty", "Unit
Price", "Total Price");

 

Thanks in advance..!!

 

Forums: 

[Teradata Database] [3932] Only an ET or null statement is legal after a DDL Statement - response (3) by yuvaevergreen

Grouping set of values into multiple groups - response (3) by yuvaevergreen

$
0
0

AFAIK, case would be the best solution for the scenario, if i understand correctly.

CPU Secs for a stored Procedure - forum topic by Teradata_SA


[Teradata Database] [3932] Only an ET or null statement is legal after a DDL Statement - response (4) by neetu6

$
0
0

Hi Dieter,
#1: My understanding is that there is no equivalent teradata to perform this.
#2:
I am doing some conversions from sql to teradata. And I am executing this query in SSRS.
I tried COMMIT after create,it gives me an error "[Teradata Database][3706] syntax error: COMMIT WORK not allowed for a DBC/SQL session. "
And ET gives me same error - only an ET or null statement is legal after a DDL statement.
 
Thanks!
Neetu
 
 
 

Teradata SQL Assistant Import - response (2) by john9

$
0
0

Thank you for looking into this however i tried to run the same using bteq import and it worked .

Using Teradata in OLTP application - response (5) by insac

$
0
0

Ok, the question is really old, so I dont' think I'll be of any help, but let me share a couple of points.
1 - from your following explanations, it would seem the REQ_ID is indeed a "unique" idenitfier. In this case you should define an UNIQUE PRIMARY INDEX to let Teradata know
2 - the REQ_ID is a CHAR(10): I had some problems in the past with skewed tables (even if the key was unique) when the key was a CHAR/VARCHAR. Can you check if your tables is skewed, and, in case, do you have the possibility to use a numeric field for REQ_ID?
BR,
Fabio 

How can I check if user is locked using query? - response (1) by Fred

$
0
0

No. Treat lockedCount as number of consecutive unsuccessful attempts.
To determine if user is currently locked you start by checking Locked Date & Locked Time. If those have values, then you have to look at Locked User Expire (in profile or SysSecDefaults) to see if lock will not happen after all (0), remains until manually unlocked (-1), or is automatically unlocked after some number of minutes (without resetting Locked Date & Locked Time).

Adhoc SQL request - forum topic by KVB

$
0
0

Hi All,
Below request has a solution.But need optimal solution.Appreciate your help.
Scenario:
1)I have a table with 160 columns and daily partitioned.Each partition contains 46 million rows.
2)In general it has to store whenever there is a change in any of the 160 columns.
3)During migration, this has been coded wrongly and every record with/without change has been recorded on each day.It had been realized after 3 months.
 
Task:Now our task is to pull the actual changes into another table with same structure.
Solutions:
1)Compare data in consecutive partitions and pull the record if any change
2)Analytical Functions on whole data(not suggestable  due to volume)
 
If anyone can throw me some light on this solution then that will help me a lot.
 
Thanks
KVB

Forums: 

Facing issues while creating User Defined Function - forum topic by SudhanshuV

$
0
0

Hi All,
 
I am getting below error while creating below UDF in Teradata 15.0

CREATE FUNCTION xml_extract( xml_text LOCATOR CLOB)

     RETURNS TABLE (cust_id INTEGER,

                    store   INTEGER,

                    item    INTEGER)

     LANGUAGE C

     NO SQL

     EXTERNAL;

 

Error: CREATE FUNCTION Failed Error:3706 Syntax Error:Data type xml_text doesn't match a Defined Type Name.

 

Can anyone please tell me what am I doing wrong here??

 

Thanks

Sud

Forums: 

Any effects of timezone on data - forum topic by chill3che

$
0
0

Greetings Experts,
I need a clarification on how the different timezone or relative settings effect the users on server and clients.
Say, a user from Australia inserted into a table with 2 cols (col_name, col_timestamp) through client like sql assistant
insert into abc values ('sachin','2015-08-15 06:54:12:123456')
and the server is located in US.  I guess that the timestamp is changed according to the timezone of the US (server time which may result in the time_stamp value as 2015-08-14 17:54:12:123456' assuming 13 hours deviation).
If a user queries (once with Australia timezone and then with another timezone say London)
select * from abc where col_timestamp='2015-08-15 20:54:12:123456'
Will there be any differences in the result (specifically when the server and the client timezones have different dates at the same time)  Does the user get the above row in each case irrespective of the any settings that affects.
How is a TD system configured to be globally used all over the world with many users querying in different geographies.
 

Forums: 

Facing issues while creating User Defined Function - response (1) by Fred

Transpose of data - response (1) by teradatauser2

$
0
0

Hi, 
Could someone look into this ? No replies to this post yet :(
--Samir

qualify rank() over (partition.....question - response (20) by Shashank0586

$
0
0

Hi Dieter,
I need your help to prepare a query for the below scenario.
My input is :-

Subscription ID

Assigned bundle category with classification "BUNDL"

Start Date

End Date

GSM1723456789

1

01.01.2000

14.05.2014

GSM1723456789

110

15.05.2014

01.06.2014

GSM1723456789

11

02.06.2014

high date

Three columns Subscr_Id, Start_Dt, End_Dt, for a Subscr_Id = 151 we have different start_dt and End_dt as below:-
high date= 31-12-9999
 
I want my output to look like below for the same Subscr_Id:-

Subscription Id

Monthly bundle category with classification "BUNDL_MON"

Start Date

End Date

GSM1723456789

1

01.01.2000

14.05.2014

GSM1723456789

111

15.05.2014

31.05.2014

GSM1723456789

110

01.06.2014

01.06.2014

GSM1723456789

111

02.06.2014

30.06.2014

GSM1723456789

11

01.07.2014

high date

 

Any effects of timezone on data - response (1) by Fred

$
0
0

Teradata has no way to actually know the client's time zone, so one of the attributes of every session is a time zone offset. It can be modified within the session (using SET SESSION TIME ZONE), defaulted at the user level, or defaulted at the system level. Input timestamp values without an explicit time zone offset are interpreted based on the session time zone, and by default output timestamp values are displayed relative to session time zone; SQL can also request external value of an expression be "AT" some other time zone.
It's important that the data loads identify the correct time zone of the data being loaded. This can be done either by controlling the session time zone or by including the time zone offset within the data field itself (TIMESTAMP WITH TIME ZONE). Data is then converted to a "normalized" internal time zone for storage (generally UTC). Comparisons are based on internal UTC values.

Any effects of timezone on data - response (2) by Fred

$
0
0

If there is a need to see data not only relative to the client's time zone but also "AT SOURCE", then consider storing the input time zone information as well, e.g. TIMESTAMP WITH TIME ZONE.

Viewing all 14773 articles
Browse latest View live


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