#DateForumTypeThreadPost
5909 Feb 2010 @ 06:51 PSTDatabaseReplyStored Procedures in Teradata!!Hi Rakhi,Lot of procedures are available in the net.Below is the one for your reference:CREATE PROCEDURE spSample1()BEGINL1: BEGINDECLARE vName CHARACTER(30);DECLARE vAmt INTEGER;DECLARE EmpCursor ...
5824 Dec 2009 @ 03:02 PSTDatabaseReplyHow to monitor the Volatile tableAll the queries those are executed in the database are stored in DBC.DBQLogTbl.You can query the above table to get the details.
5717 Dec 2009 @ 08:12 PSTDatabaseReplyFinding the index of last occurrenceHey,You can find out the position of 1234 then -1, gives you the poistion of "_" before 1234.
5617 Dec 2009 @ 07:50 PSTDatabaseReplyhow to findout top four rows or last four rows in teradata?You can use:Select top 4 * from tablename;But, I doubt, it will fetch you the top 4 rows from the database.In Teradata, "top" works differently when compared to rownum in oracle.
5517 Dec 2009 @ 07:40 PSTDatabaseReplyDay Name fuction in TeradataHi,Teradata provides the format function.select current_timestamp(0) (FORMAT 'E4,bM4bDD,YYYYbHH:MI:SSbT');Try this....
5417 Dec 2009 @ 07:19 PSTDatabaseReplywhat is difference between read lock and accesslock?Further more, We have row level lock in TERADATA.'LOCKING ROW FOR ACCESS' : This is related to row hash lock. A row hash lock applies to a set of rows that shares the same hash code. It does not ne...
5329 Jul 2009 @ 05:30 PDTDatabaseReplyTab in columnHi Pawan and All,Thanks all for your responses. I tired the same way pawan, but its throughing error. BTEQ -- Enter your DBC/SQL request or BTEQ command: SELECT '-'||CHR(9)||'-';SELECT '-'||CHR(9)|...
5228 Jul 2009 @ 11:41 PDTDatabaseReplyTab in columnHi Pawan and All,Thanks all for your responses. I tired the same way pawan, but its throughing error. BTEQ -- Enter your DBC/SQL request or BTEQ command: SELECT '-'||CHR(9)||'-';SELECT '-'||CHR(9)|...
5127 Jul 2009 @ 02:50 PDTDatabaseReplyTab in columnHi Pawan,Thanks for your reply.I tried but, i think chr function is not available in TERADATA.sel count(1) from db1.emp where emp_det ='%' || CHR(9) || '%' ...
5027 Jul 2009 @ 01:12 PDTDatabaseTopicTab in columnHi All,Could anyone know how to find the tab, linefeed and carriage return present in a column.Suppose I have a column emp_det, I want to find the number of rows which are having tabs, linefeed and...
4911 Jun 2009 @ 04:02 PDTDatabaseReplyHow to fix [3932] Only an ET or null statement is legal after a DDL Statement?If you have started a BT session, after executing DDL statement, you cannot run update/delete or other statements with in that transaction session.Instead you skip all statements after DDL and put ...
4811 Jun 2009 @ 03:56 PDTDatabaseReplyGetting result in order from Select query.....Could you please clarify your requirement, that why you don't want to use order by clause in your select query ?So that we might look for some possible solution.
4711 Jun 2009 @ 01:04 PDTDatabaseReplyAdd days to a date columnI tried as below and I got the result.CREATE SET TABLE db1.emp2 ,NO FALLBACK , NO BEFORE JOURNAL, NO AFTER JOURNAL, CHECKSUM = DEFAULT (emp_id INTEGER NOT NULL, release_date DA...
4609 Jun 2009 @ 12:10 PDTDatabaseReplyRounding Down in TeradataHi Venkatesh,As per your requirement, you can use CASE statement to achieve the same.Extract last 2 digits by SUBSTR function and if it is >=50 then subtract the same from the number else cast t...
4508 Jun 2009 @ 01:00 PDTDatabaseReplyRounding Down in TeradataU can also use WIDTH_BUCKET function to achieve the same.
4411 May 2009 @ 03:20 PDTDatabaseReplyRows updated insertedHi Dieter,One clarification needed.In 'notify exit' we will write a C program. how can we use sql to update one table ?Is it possible to use insert statement in the C program (as we use Pro *C for ...
4304 May 2009 @ 07:43 PDTDatabaseReplyRows updated insertedHI Adeel,Tried with activity_count too. Same error.I think, in BTEQ activitycount works. activity_count is used in SP.See the error below :insert into db1.employee(4,'ddd',40000,current_timestamp(0...
4204 May 2009 @ 04:04 PDTDatabaseReplyRows updated insertedHi Dieter,I tried as below:insert into db1.employee(4,'ddd',40000,current_timestamp(0)); *** Insert completed. One row added. *** Total elapsed time was 1 second.+---------+---------+---------+---...
4102 May 2009 @ 02:39 PDTDatabaseReplyRows updated insertedHi Dieter,Thank you very much for your reply. Notify exit suits in my condition.But, still not clear on how to insert the activity count into a table..set NOTIFY Could you please assist me some mo...
4001 May 2009 @ 06:44 PDTDatabaseTopicRows updated insertedHi,I have written one BTEQ script to insert, update and delete the table.When ever a table gets updated, inserted or deleted, I want the number of rows gets affected.I know, Activity_count variable...
3920 Mar 2009 @ 12:47 PDTDatabaseReplySaving 'WITH RECURSIVE' ResultsHi,We can insert the output in a table/volatile table.Please use the sql below to insert in emp1 table.INSERT INTO db.emp1( emp_id, emp_cd, level)WITH RECURSIVE obj_rec(Level,e...
3819 Feb 2009 @ 02:13 PSTDatabaseTopicCharecter set issueHi,I am using following code in bteq script to generate the sql output to a file.bteq<<END.set session charset "UTF8".export file abc.xlsSelect emp_no, emp_name from emp;.export resetENDWhen ...
3710 Feb 2009 @ 08:51 PSTDatabaseReplyassigning of variable.Kapil, could you plz explain clearly. I am not getting what u r trying to say.
3610 Feb 2009 @ 08:43 PSTDatabaseReplyrevierving data from exported reslut set in bteqHi Kapil,You can use the following command to get the output from the exported file.out_var=`sed -n '3,3 p' file_name`Thanks
3529 Jul 2008 @ 04:59 PDTDatabaseReplyconverting timestamp to date in where clauseits timestamp(0);

Pages