0 - 28 of 28 tags for update

I have 2 tables.
 
One has the test locations, columns are:
Test_Date
Latitude
Longitude
 
The second table has the info about the locations, columns are:
Latitude
Longitude
Area

Hi,
I am having trouble with writing an update statement. Below is the SQL code to understand basic update I need:

I have a table with the following layout

cust_acct_id (PK)| effect_dt | expiry_dt | curr_rec_ind | field_a | field_b | field_c | field_d

I have to populate any NULL values in field_a, field_b, field_c, or field_d with the most recent value received for that field for the same cust_acct_id.

Sample Input:

Hi,
 
I'm trying to do something like below, but its giving me syntax error,
can anyone please tell me what is the issue and how to fix this.
 
with cte0(ID,int_col1) as(
    select row_number() over (order by (select 1)) AS ID,int_col1 from shuffletest
)
update cte0 set int_col1=ID;
 

I have an update statement directly referencing one table and a second one through a SELECT statement.
That second table (CONTACT_TEMP) is created to hold no duplicates  based on the EMAIL field as a primary index. So I'm confused as to why TD is giving me error 7547: Target row is being updated by multiple source rows in an UPDATE statement

Dears,
Kindly, I need a solution to disable updates on spesefic column. If there is any solution other than using trigger it will be great.
Thanks
Mohammad Alaa

UPDATE db.source

 

SET

 

region= CASE WHEN b.title_rw LIKE '%East%'  THEN 'East'

WHEN b.title_rw LIKE '%Central%'  THEN 'Central'

WHEN b.title_rw LIKE '%West%'  THEN 'West'

else 'Region N/A' END 

 

from db.source a

Hi All,
I am updating my tables based on primary index, however from the DBQL I see all the amps are active. Could someone explain, if this is expected ?
 
Cannot post the table structre for confidentialy reasons.
But it's like:
MyTable
(Column1 CHAR(10)
,Column2 CHAR(5)
,Column3 INTEGER
....

Hi,
Thanks for your viewing and appreciate your help !
I have a question regarding the Data update cost for table with lots of columns or only a few columns.
for example, i want to udpate a single column for Table A which has 100 columns.

Being not an expert at upgrades, I have an old client GSS/ODBC install version 3.06 & would like to upgrade to the latest V14 drivers. The old drivers are located in an NCR folder, & from initial checks the V14 installs under Teradata folder.
How do I sucessfully update?

I was reading an older post (http://forums.teradata.com/forum/database/reset-identity-column-counter) and concluded that somehow Update is possible for DBC tables (DBC.IdCol). 

Hi everyone,
 
It's my first topic here, my english is not that great, I'm gonna try to be as clear as I can.

hi , Currently by using BTEQ and Teradata SQL assitant I am able to insert records into a table.
But I want to update records in a table. I have more than 2000 records in a table and i have 200 records in a file
both contain a same Primary key column and if there is no match found i want to insert a new row in a table.

I have a requirement to update the duplicate records in teradata. For E.G. if col, col, col, col have same values in the table, those records are regarded as duplicates and duplicate flag needs to be updated as '1' for all those records.

Any suggestions on how implement this logic?

Hi,
I'm creating a Notify Exit routine for an Update Operator in TPT.  Part of my routine is printing on screen the table Name and Table number I'm loading/updating:
printf("++++\t\tTable Name  : %1.*s\n",
            P->Vals.PhaseIBegin.TableNameLen,
            P->Vals.PhaseIBegin.TableName);

Hi, i have these 2 columns defined:

WAIT_INTVL INTERVAL HOUR(3) TO SECOND(2)
HOLD_INTVL INTERVAL HOUR(3) TO SECOND(2)

and both are null values

a) select COALESCE(WAIT_INTVL, INTERVAL '0' SECOND) from TableT1
returns     0:00:00.00

b) i can substract (a) with itself

select COALESCE(WAIT_INTVL, INTERVAL '0' SECOND) - COALESCE(WAIT_INTVL, INTERVAL '0' SECOND)
from TableT1
returns     0:00:00.00

Hi,

i have data:

select JOB,NAME,CODE,START_TM from table TableT

JOB,NAME,CODE,START_TM

-------------------

JOBA,M,S,2010-06-04

JOBB,M,K,2010-06-05

JOBC,N,A,2010-06-02

JOBD,N,A,2010-06-03

JOBE,O,A,2010-06-04

 

Hi everyone! I am currently studying Teradata and currently working on this problem of mine. You see, i have this set of data on a flat file that needs to be loaded in a table based on a condition.

This is what my flat file looks like:

##Flatfile
SOR|03/17/2012|2 -- This is a header

I want to Update and Insert when a condition in the case was true. However, it seems that Teradata doesn't accept it. My question is, is there a way for that to happen?

Like

 

CASE WHEN SEL Table1.Column return TRUE

THEN UPDATE Table2 AND INSERT Table3

ELSE

INSERT Table2 AND INSERT Table3

END

Hi All,

I have read in SQL Reference - Data Manipulation Statements that

UPDATE Processing Time for an UPDATE operation is longer under the following conditions:
"When the FALLBACK option is specified for the table, because the rows in the secondary copy of the table must also be updated"

In my process I am loading data into intermediate staging table and then performing various update on that... and at last I m renaming table to final table to use updated data in another process.

Hello,

As part of my job, I have to understand the patching model of all databases our clients are using, in order to assure maximum security level. I have a couple of questions regarding the database, and I couldn't find the answers I was looking for online. Hope you can help me here,

1. Is there somewhere online we can see a list of all patches released for the DB? We are mostly interested in Security updates.

2. Is there some fixed date for patches? Like, for example, a new patch is releases every 2 month?

Hi All,

I am following below topic

http://www.teradatamagazine.com/v10n01/Tech2Tech/Another-option-on-the-table/

I have some questions ,

1. How I can use MERGE for update query when match is on NON - PI value.

My query is like

Below is a SAS script that passes variables thru the same code many times. I would like to do the same type of thing in Teradata with my initial code looking like this for an UPDATE.

1. First, this is an UPDATE statement
2. I need to observe the current month's and prior month's MISS_PMT_COUNT over years to determine the MOST RECENT TIME when a mortgage account went from delinquent to cured and vise versa.
3. If there is some way to determine &N observations on the MIN(STATEMENT_DATE) for the pass through values, that would be great.

Thank you in advance,

Below is a SAS script that passes variables thru the same code many times. I would like to do the same type of thing in Teradata with my initial code looking like this for an UPDATE.

1. First, this is an UPDATE statement
2. I need to observe the current month's and prior month's MISS_PMT_COUNT over years to determine the MOST RECENT TIME when a mortgage account went from delinquent to cured and vise versa.
3. If there is some way to determine &N observations on the MIN(STATEMENT_DATE) for the pass through values, that would be great.

Thank you in advance,

This book provides information about Teradata MultiLoad, a product that provides an efficient way to deal with batch maintenance of large databases. Teradata MultiLoad is a command-driven utility for fast, high-volume maintenance on multiple tables and views in a Teradata Database.

Hi, I've just arrived to the Teradata world from SQL Server and learning the new syntax. How do you update a table using a join?

The first approach I used was what I have been doing: create aliases, then refer to them, but I get 3993: Illegal use of alias name.


bt;
update login.table_aggregate as AGG
from login.table_temp as TMP
set AGG.period = TMP.period
,AGG.events = TMP.events
where AGGcustomer_id = TMP.customer_id
and AGG.period < TMP.period;
et;