Jump to content

Recommended Posts

Posted

All query gurus In Teradata

I have to drop a table before creating the same table......... ela ante


if table exists drop table xyz.test else null and

later create table xyz.test

query ela rayalo chepandi, important point ente ante table exist avthane drop chesi malli same table ni create cheyali query or a series of querys

Posted

[CODE]
SELECT 1
FROM DBC.TABLES
WHERE Databasename = ''
AND Tablename (= '' or like '%%');
.if activitycount = 0 then .goto no_tab;
.if errorcode <> 0 then .goto unsuccessful_end;
DROP TABLE $dwh.table_name;
.if errorcode <> 0 then .goto unsuccessful_end;
.label no_tab;
-
-
-
-
-
.label unsuccessful_end;
exit 12;
[/CODE]


PS: googled.. I am not a TERADATA developer..


Also check this: http://stackoverflow.com/questions/9299329/create-table-but-drop-it-if-the-table-exists-already

Posted

Try chesta .......thanks bhayya inka emanna answer lu istharo chusta


[quote name='Kaarthikeya' timestamp='1360279453' post='1303244636']
[CODE]
SELECT 1
FROM DBC.TABLES
WHERE Databasename = ''
AND Tablename (= '' or like '%%');
.if activitycount = 0 then .goto no_tab;
.if errorcode <> 0 then .goto unsuccessful_end;
DROP TABLE $dwh.table_name;
.if errorcode <> 0 then .goto unsuccessful_end;
.label no_tab;
-
-
-
-
-
.label unsuccessful_end;
exit 12;
[/CODE]


PS: googled.. I am not a TERADATA developer..


Also check this: [url="http://stackoverflow.com/questions/9299329/create-table-but-drop-it-if-the-table-exists-already"]http://stackoverflow...-exists-already[/url]
[/quote]

Posted

select * from sys.tables where name like
(searches the table name in the database)

drop the searched table and then create the table.

Posted

table exist avuthane drop chesi malli table create cheyali

table exist avakpothe em drop cheyakunda table create cheyali


[quote name='mastikaraja' timestamp='1360280867' post='1303244771']
select * from sys.tables where name like
(searches the table name in the database)

drop the searched table and then create the table.
[/quote]

Posted

IF EXISTS ( SELECT 1 FROM sys.tables WHERE name like 'TableName')
BEGIN
DROP TABLE TableName
END
else
begin
create table()
end

Posted

[quote name='kranthi111' timestamp='1360283746' post='1303244926']
IF EXISTS ( SELECT 1 FROM sys.tables WHERE name like 'TableName')
BEGIN
DROP TABLE TableName
END
else
begin
create table()
end
[/quote]

nee ID chalaa bhaagundhi..... nice name....... :D

Posted

[quote name='nani8055' timestamp='1360283888' post='1303244931']

nee ID chalaa bhaagundhi..... nice name....... :D
[/quote]


@gr33d @3$%

Posted

[quote name='Rabbo' timestamp='1360278788' post='1303244558']
All query gurus In Teradata

I have to drop a table before creating the same table......... ela ante


if table exists drop table xyz.test else null and

later create table xyz.test

query ela rayalo chepandi, important point ente ante table exist avthane drop chesi malli same table ni create cheyali query or a series of querys
[/quote]
No idea
[img]http://www.desigifs.com/sites/default/files/bemi.gif[/img]

Posted

[quote name='nani8055' timestamp='1360283888' post='1303244931']

nee ID chalaa bhaagundhi..... nice name....... :D
[/quote]
needi kuda ade name aa? [img]http://lh3.ggpht.com/--o7mXz3u-j4/T9VVBGzBJAI/AAAAAAAAGo0/kmj8a1-XW2g/s150/PK-1.gif[/img]

Posted

[quote name='Kaarthikeya' timestamp='1360285213' post='1303245032']
needi kuda ade name aa? [img]http://lh3.ggpht.com/--o7mXz3u-j4/T9VVBGzBJAI/AAAAAAAAGo0/kmj8a1-XW2g/s150/PK-1.gif[/img]
[/quote]
[img]http://www.desigifs.com/sites/default/files/brahmam_style19_1.gif[/img]

×
×
  • Create New...