#DateForumTypeThreadPost
5530 Aug 2015 @ 08:23 PDTDatabaseReplycast varchar value YYYY-MMM-DD HH:MI:SS to dateHi Sakthikrr,   The follow query will do the required: SEL COUNT(*) FROM CALL_HISTORY_DETAILS WHERE CAST(CALL_START_DATE_TIME AS TIMESTAMP(6) FORMAT 'YYYY-MMM-DDBHH:MI:SS') = DATE &...
5403 Jun 2015 @ 12:18 PDTDatabaseReplyStored Procedure Graceful AbortHi Vikas,   Can you please share the structure of code, not the exact code. Something like.   Replace xxx(in a,in b,out c) begin create  insert end;   Will then able t...
5301 Jun 2015 @ 05:18 PDTDatabaseReplyStored Procedure Graceful AbortHi Vikas,   It seems like you have added a CONTINUE or EXIT handler in the procedure. Just remove it and you will get your error.   Thanks, Rohan Sawant
5207 Apr 2015 @ 12:59 PDTDatabaseReplyRollup up specific columns in a groupHi sm1,   The below sequel will do the required only if the maximum no. rows per id is 24. If its greater than 24 then you need to add "||MAX(CASE WHEN SEQUENCE_NBR = 24 THEN (',...
5120 Mar 2015 @ 02:08 PDTDatabaseReplyStored Procedure doesn't recognize volatile tableHi bcdjr1,   Set the DATABASE to default database of proc. i.e. in your case it must be DATABASE DLPMC_PMCOE_DEV_LAB. Compile and run the proc. If the above solution doesnt work use th...
5017 Mar 2015 @ 11:36 PDTDatabaseReplyUsing Dynamic databasename and tablename in stored procedureHi Dieter,   Can you let me know whether the code given by me works or not? Because I get the desired result.   Thanks, Rohan Sawant
4917 Mar 2015 @ 10:10 PDTDatabaseReplyUsing Dynamic databasename and tablename in stored procedureHi teradatauser2,   I have used the above procedure and it does the required i.e it goes in handler and throws the message. I am using TD 14.10 version. Looking at the code I am quite sure i...
4817 Mar 2015 @ 06:39 PDTDatabaseReplyUsing Dynamic databasename and tablename in stored procedureHi teradatauser2,   For your comment: In Fact, i passed a wrong table name, the SP failed with 3807 error, but it didn't go to the error handling section and populate the Out message. ...
4717 Mar 2015 @ 12:12 PDTDatabaseReplyHelp with CONTINUE HANDLER!! Hi teradatauser2,   The below code will do the required. You can now set a MESSAGE according to the SQLCODE you get using IF.. ELSE.   REPLACE PROCEDURE MYSP ( IN ...
4617 Mar 2015 @ 12:10 PDTDatabaseReplyUsing Dynamic databasename and tablename in stored procedure Hi teradatauser2,   The below code will do the required. You can now set a MESSAGE according to the SQLCODE you get using IF.. ELSE.   REPLACE PROCEDURE MYSP ( IN ...
4527 Feb 2015 @ 01:53 PSTDatabaseReplyQuerying data for time periodHi Odivini,   Please correctly specify your requirement. I have derived your output predicting the requirement. I have not used the date columns at all. And please from next time onward prov...
4427 Feb 2015 @ 12:25 PSTDatabaseReplyupdate syntaxHi Kevin,   Whenever a update happens it takes the present value of the table. In your update the present value of c2 is '2' and hence '2' would be used in both the SET OF UP...
4325 Feb 2015 @ 08:01 PSTDatabaseReplyMultiple values in where clause Hi dvya,   I am not clear with the requirement since I feel there are many more CASES for which requirement has not been mentioned. Like is the PRODUCT_ID would be same for same...
4225 Feb 2015 @ 08:00 PSTDatabaseReplyRemove the first 4 characters in a stringHi dvya,   I am not clear with the requirement since I feel there are many more CASES for which requirement has not been mentioned. Like is the PRODUCT_ID would be same for same PRODUCT_NM?...
4109 Feb 2015 @ 06:21 PSTDatabaseReplyWhere clause using case statementHi,   I didnt go into the logic much. Just tried to run your query. SELECT * FROM TABLEA WHERE REVENUE_MONTH BETWEEN CASE WHEN (SELECT EXTRACT(DAY FROM DATE)) >...
4009 Feb 2015 @ 03:36 PSTDatabaseReplyWhere clause using case statementHi,   Can you please share the data stored in REVN_CAL_MO.MO  and Revenue_Month and even datatype.   Thanks, Rohan Sawant
3930 Jan 2015 @ 02:32 PSTDatabaseReplyHierarchy Query using Recursive functionHi srikanthpusa,   The following queries must get you the required output:   /* Creating test data */ CREATE MULTISET VOLATILE TABLE VT_INPUT_DATA, NO FALLBACK , NO LOG, CHECKSUM ...
3829 Jan 2015 @ 06:06 PSTDatabaseReplyHow to Round Timestamp(6) to nearest hourHi Madhuvrk,   The below query must do the required:   /* Creating test data */ CREATE MULTISET VOLATILE TABLE VT_INPUT_DATA, NO FALLBACK , NO LOG, CHECKSUM = DEFAULT, DEFAULT ME...
3715 Jan 2015 @ 08:28 PSTDatabaseReplyCREATE set table xxxxx.x2 AS MULTISET TABLE xxxx.x1 WITH DATA AND STAT - NO stats copied. Hi,   I didnt say that your table has duplicates. I said that MULTISET to SET is removal of duplicates. Teradata knows that and hence it sets up a standard to not pass the stats sin...
3614 Jan 2015 @ 11:19 PSTDatabaseReplyHow to flag products based on start ts and end tsHi Markus,   The records set you provided doesnt have the scenario of  ---> Start_ts ia not after previous record end_ts then flag "N" according to my understandi...
3514 Jan 2015 @ 10:41 PSTDatabaseReplyCREATE set table xxxxx.x2 AS MULTISET TABLE xxxx.x1 WITH DATA AND STAT - NO stats copied. Hi Achikan01,   That because you defined the first table as "MULTISET" and the second as "SET". Whenever you convert "MULTISET" to "SET" dupl...
3414 Jan 2015 @ 10:26 PSTDatabaseReplyRecursive updatesHi,   The below query must do the required:   /*Creating test data*/ CREATE MULTISET VOLATILE TABLE VT_TEST_DATA ,NO FALLBACK , CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKRATIO, NO L...
3314 Jan 2015 @ 04:16 PSTDatabaseReplyLowest Child in recusive queryHi Edberg,   Please find the below query. /*Creating test data*/ CREATE SET VOLATILE TABLE VT_TEST_DATA ,NO FALLBACK , CHECKSUM = DEFAULT, DEFAULT MERGEBLOCKRATIO, NO LOG ( CHILD_...
3213 Jan 2015 @ 01:29 PSTDatabaseReplyHow can I get the actual value of %VSTR or more error info?Hi, A sample procedure capturing the error message :   REPLACE PROCEDURE TEST_P.TEST_PROCEDURE(OUT V_MESSAGE VARCHAR(100)) SQL SECURITY OWNER BEGIN DECLARE V_GETOUT INTEGER; D...
3112 Jan 2015 @ 02:53 PSTDatabaseReply 'CALL Failed. HY000:'Hi,   Please share a proper code with the proper concerns you have. Not able to understand whats your requirement and where's the problem.   Thanks , Rohan Sawant

Pages