#DateForumTypeThreadPost
1121 May 2013 @ 08:20 PDTDatabaseTopicOdd timestamp applied in update when timestamp variable in stored procedure is null 0000-00-00 00:04:00In a stored procedure a timestamp variable has been set (via a cursor select) to null. When using that variable to update a timestamp column of another table, the updated value resolves as 0000-0...
1016 May 2013 @ 08:48 PDTDatabaseReplyLarge-scale update questionNo responses, but I found a solution.  It appears that using joined-updates or joined-deletes is not viable performance-wise unless both table have the same primary index AND that primary inde...
913 May 2013 @ 10:41 PDTDatabaseTopicLarge-scale update questionI have a table with 700m rows, evenly distributed 1-column integer NUPI plus 3-column integer USI (1st col us the also PI).  Queries run fine, but when we push updates or deletes to this table...
818 Mar 2013 @ 10:03 PDTDatabaseTopicComplex Transactions in Stored ProceduresWe perform ETL on a table of transactions.  After loading the transaction table, we want to use Stored Procedures (SPs) to perform the very complex business validations, and then to apply the ...
709 Sep 2011 @ 09:00 PDTUDAReplyColstats privileges??? I am having privilege/grant problems collecting stats from a procedure.  I use SysExecSQL to collect the stats, but get *** Failure 3523 Acft_SCIR_Derived_Proc:An owner referenced by user d...
616 Apr 2009 @ 11:53 PDTDatabaseReplyHelp on SET/MULTISET.. plzzTo find duplicates in a table where Col1, Col2, and Col3 are *meant* to be unique, use this:select Col1, Col2, Col3, count(*)from Table1group by Col1, Col2, Col3having count(*) > 1This will show...
515 Apr 2009 @ 09:56 PDTDatabaseReplycorresponding teradata query for a oracle queryThe Help Table works, but provides a less-readable version one table at a time. I use the following to generate similar results for several tables at once (or a whole database) in more readable fo...
415 Apr 2009 @ 09:10 PDTDatabaseTopicPrinting/displaying to screen in ProcedureIs there any way to write to the screen in a Procedure, for troubleshooting purposes? I'm looking for the equivalent of DBMS_OUTPUT.PUT_LINE from Oracle. We'd remove it from production code, but ...
309 Apr 2009 @ 11:13 PDTDatabaseReplyIdentify unique indexes/keys using DBC viewsSince Unique Primary Indexes were used, I found them where IndexType='P' and UniqueFlag='Y'. I hadn't quite understood how TD indexes/constraints things compare to Oracle (my background). Thanks ...
208 Apr 2009 @ 01:03 PDTDatabaseTopicIdentify unique indexes/keys using DBC viewsI am building a query on DBC.Columns to provide a more readable report on our table structures. As part of this, I am trying to include an indicator to identify table columns which are part of a un...
123 Mar 2009 @ 01:52 PDTDatabaseReplyDECLARE variable like ROWTYPE in TeradataHello,%ROWTYPE in Oracle creates a structured variable with the same structure as the table definition it references. It can hold the equivalent of 1 row at a time when used as a fetch target for ...