#DateForumTypeThreadPost
4811 Jun 2008 @ 11:12 PDTDatabaseReplyGeneration of IDENTITY values for a columnHello,Can you provide the INSERT SELECT statement?Regards,Adeel
4710 Jun 2008 @ 05:37 PDTToolsReplyfastload between table to tableHello,FastLoad is the utility to load data from flat-files/data-files to empty tables. You can move data between two tables using BTEQ script.Regards,Adeel
4609 Jun 2008 @ 07:11 PDTDatabaseReplyTruncate a decimal field without roundingWelcome! :)Regards,Adeel
4509 Jun 2008 @ 04:57 PDTDatabaseReplyModify a column defination with NOT NULL of a TableThe way i understand it now is, you need to add NOT NULL column in a table after its creation using ALTER TABLE command. For that you can use following:ALTER TABLE ABC ADD Column2 INTEGER NOT NULL;...
4409 Jun 2008 @ 04:25 PDTDatabaseReplyModify a column defination with NOT NULL of a TableHello,You can use it as follows:ALTER TABLE ABC ADD ID NOT NULL;You can only do that in non-indexed columns. The DDL you provided will not allow you to add this constraint. Following is the example...
4309 Jun 2008 @ 03:25 PDTDatabaseReplyTruncate a decimal field without roundingHello,You can use double casting...and INDEX function as below:SELECT SUBSTR(CAST('123.4567' AS VARCHAR(10)), 1, INDEX('123.4567', '.')+2)HTH.Regards,Adeel
4209 Jun 2008 @ 02:03 PDTDatabaseReplySelecting three words from a stringYou can try with the CASE statement in second field...checking if the string contains two spaces then get middle-name otherwise just select NULL.HTH.Regards,Adeel
4108 Jun 2008 @ 11:51 PDTDatabaseReplySelecting three words from a stringString manipulation is not a plus point of SQL. Try out with a recursive SQL that may be of some help...Regards,Adeel
4008 Jun 2008 @ 11:26 PDTDatabaseReplySearching string in LogonSource ?Hello,Doing that in SQL may be difficult. Doing that in UDF will be simple and easy, if you have experience in UDFs.You can have a similar sort of UDF as suggested at: http://www.teradata.com/terad...
3908 Jun 2008 @ 11:24 PDTDatabaseReplySelecting three words from a stringHello,In case if they are currently in the database and you need to move them to some other table/database, you can write a UDF with two parameters, one the input string and the other the index. e....
3808 Jun 2008 @ 11:21 PDTUDAReplyto check is a string is numeric or notHello,Till Teradata V2R6, no there is no built-in function for that, but offcourse you can write a UDF which can do that.Regards,Adeel
3704 Jun 2008 @ 10:07 PDTDatabaseReplyStored ProcedureHello,Following is the most simple example of a Stored-Procedure:CREATE PROCEDURE spName(IN P1 INTEGER, OUT P2 INTEGER)BEGIN SELECT P1 + 10 INTO P2;END;Perhaps the task you wish to achieve can be ...
3602 Jun 2008 @ 01:19 PDTDatabaseReplySimple QueryFor that you need to specify the table DDLs and sample data, and what exactly you need to achieve, or you can try more. :)Regards,Adeel
3502 Jun 2008 @ 12:51 PDTDatabaseReplySimple QueryOk, can you remove the SELECTs used in WHERE clause and re-write the query using JOINS?I guess that is the only way to to something similar.Regards,Adeel
3401 Jun 2008 @ 11:52 PDTDatabaseReplyWhat is the meaning of the implicit join?You found pretty right.SELECT * FROM t1 INNER JOIN t2 ON t1.a1=t2.a2 ,t3 WHERE t1.b1=t3.b3It uses three tables whish are t1, t2 and t3. t1 is INNER JOINED with t2, this joined table is then ...
3301 Jun 2008 @ 11:32 PDTDatabaseReplySimple QueryIs it giving some sort of error?Regards,Adeel
3230 May 2008 @ 05:20 PDTDatabaseReplySimple QueryHello,Exactly what are you trying to achieve is pretty ambigious. The query you are trying to write can be easily written as:SELECT * FROM emp a WHERE a.emp_no = a.emp_no;If you want to have a self...
3130 May 2008 @ 01:10 PDTDatabaseReplyFew basic queriesAs mentioned in last reply, i have no idea of DUAL table in Teradata. Secondly, till V2R6 DENSE_RANK is the future reserved word, no idea about V2R12.Regards,Adeel
3030 May 2008 @ 12:01 PDTConnectivityReplyExample of Table UDFI'll give it a try once again, but I wasn't able to compile it (V2R6 example of table function) in first try...thats why asked for a simplest possible example which returns data from a table not fr...
2929 May 2008 @ 11:30 PDTConnectivityTopicExample of Table UDFHello,Can anyone provide with a sample of a simple table UDF?Example: A table UDF which returns 2 columns (say col1, col2) of a table (say table1)?Regards,Adeel
2829 May 2008 @ 11:24 PDTDatabaseReplyWhat is the meaning of the implicit join?Additionally, if you want to have implicit inner join you can write the query as follows:SELECT a.col1, b.col1FROM table1 a, table2 bWHERE a.col1 = b.col1;HTH.Regards,Adeel
2729 May 2008 @ 11:22 PDTDatabaseReplyWhat is the meaning of the implicit join?Hello,Implicit join is the join without explicitly writting the word JOIN of any kind (inner, outer, left...). Following is the example of implicit join, it is always a cross-join:SELECT a.col1, b....
2629 May 2008 @ 09:18 PDTDatabaseReplyFew basic queriesHello,Following are the answers:1. It will not work like that, for declaring variables, you need to have a Stored-Procedure.2. No idea about dual table in Teradata.3. All yes. (given there is no is...
2528 May 2008 @ 04:56 PDTDatabaseReplyCreating Stored Procedures in BatchIt should work, this way in SQL Assistant as well, e.g I just tried following on V12:create procedure sp1()begin...end;create procedure sp2()begin...end;create procedure sp3()begin...end;In case of...
2428 May 2008 @ 04:37 PDTDatabaseReplyCreating Stored Procedures in BatchFor my information, how can you write a batch in SQL Assistant?And can't you write a BTEQ script for a batch task?Regards,Adeel

Pages