Error 3800 Data Type Mismatch
Contents |
boardKnowledge baseUsers turn on suggestions Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type. Showing results for Search instead for Did you mean: Teradata : Product Forums : General : 3800: Datatype Mismatch 3800 datatype mismatch in then/else expression in THEN/ELSE expression. Options Subscribe to RSS Feed Mark Topic as New Mark sqlite datatype mismatch Topic as Read Float this Topic to the Top Bookmark Subscribe Printer Friendly Page Archer Fan Options Mark as New
Teradata Coalesce
Bookmark Subscribe Subscribe to RSS Feed Get Direct Link Print Email to a Friend Report Inappropriate Content 03-17-2010 04:18 PM 03-17-2010 04:18 PM 3800: Datatype Mismatch in THEN/ELSE expression. Hi, I'm trying to write a query to force value '~' in a date field when date value is null. But I'm getting 3800: Datatype Mismatch in THEN/ELSE expression error in TD. Below is my querySelect Employee_ID,CASE WHEN(Joining_DT IS NULL) THEN ( '~' )ELSE Joining_DT END (CHAR(8))from Employee;Any ideas please? Thank you 0 Kudos Reply All Forum Topics Previous Topic Next Topic 4 REPLIES Suma_manu1 Enthusiast Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Get Direct Link Print Email to a Friend Report Inappropriate Content 03-17-2010 07:26 PM 03-17-2010 07:26 PM Re: 3800: Datatype Mismatch in THEN/ELSE expression. Try this...Select Employee_ID,CASEWHEN Joining_DT IS NULLTHEN cast( '~' as char(8))ELSE cast (Joining_DT as Char(8)) END from Employee; 0 Kudos Reply Archer Fan Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Get Direct Link Print Email to a Friend Report Inappropriate Content 03-17-2010 08:38 PM 03-17-2010 08:38 PM Re: 3800: Datatype Mismatch in THEN/ELSE expression. Thank you Suma, It worked. Appreciate it 0 Kudos Reply sudhirkothapall N/A Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Get Direct Link Print Email to a Friend Report Inappropriate Content 09-15-2011 01:36 PM 09-15-2011 01:36 PM Re: 3800: Datatype Mismatch in THEN/ELSE expression. when I am matching theA.COL1= B.COL1 thenpopulate corresponding B.COL2. COL1 is char fields, COL2 is date field. I tried as below but didn't worked. SELECT CASE WHEN A.COL1= B.COL1 THEN B.COL2 ELSE CAST('~' AS CHAR(8)) END ORD_DTE FROM A LEFT OUTER JOIN B ON A.COL1= B.COL1 SELECT Failed. 3800: Datatype Mismatch in THEN/ELSE expression. plz advice, thanks in advance. 0 Kudos Reply mrank Enthusiast Options Mark as New Bookmark
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Datatype mismatch in then/else in teradata up vote 0 down vote favorite I am checking the contents of y.cap_ts and if there is a value (non null) then replace it with current_date or else leave it as null. http://community.teradata.com/t5/General/3800-Datatype-Mismatch-in-THEN-ELSE-expression/td-p/20369 but I get data type mismatch in then/else error. Here cap_ts is date data type. Can any one suggest any better work around? SET cap_ts = CASE WHEN y.cap_ts IS NULL AND y.rwrd > 50 THEN current_date ELSE NULL END I am currently working in teradata. sql case teradata share|improve this question edited Feb 9 '12 at 14:47 Rob Paller 6,2891422 asked Feb 8 '12 at 17:17 user1172117 44225 Have you tried setting it to a static date? DATE '1980-01-01' Can http://stackoverflow.com/questions/9198228/datatype-mismatch-in-then-else-in-teradata you share the table definition? –Rob Paller Feb 9 '12 at 14:43 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted Try replacing CURRENT_DATE with CURRENT_TIMESTAMP(0). I know you said that CAP_TS is a DATE data type but your naming convention seems to indicate otherwise. Unlike Oracle, the DATE data type in Teradata does not include a time component. If it is actually defined as a TIMESTAMP then you need to use CURRENT_TIMESTAMP(n), where n is the precision of the time. share|improve this answer answered Feb 9 '12 at 14:47 Rob Paller 6,2891422 Ya I was playing with it and replaced date with timestamp and it worked. –user1172117 Feb 14 '12 at 20:27 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged sql case teradata or ask your own question. asked 4 years ago viewed 1196 times active 4 years ago Related 1How to convert connect by level in teradata0How to re-design my current SQL Case Logic implementation in Teradata 13.02Selected non-aggregate values must be part of the associated group2SQL case statement in Teradata1Cannot nest aggregate operations - Teradata Case
in THEN/ELSE expression. Teradata code 3800 Datatype Mismatch in THEN/ELSE expression. Error description error explanation... Explanation: The dataset of THEN/ELSE expressions contain a datatype that is incompatible with other datatypes in the set. type mismatch Example: SEL CASE WHEN 1=1 THEN ByteCol ELSE IntCol END; Generated By: OPTWEXP For Whom: The end user. Remedy: Correct and re-submit SQL query.
More information Teradata error TDP2391 TRDTXCPS: ERROR OBTAINING I/O error 3800 data BUFFER Teradata error TDP2338 cpname REQUEST WAS CORRUPTED, SESSION nnnn, REQUEST nnnn Teradata error 6760 Invalid timestamp. Teradata error 7989 Invalid operand for the %VSTR operator. The operand must have a Period data type that is Teradata error 5880 Concurrent change conflict on stored procedure -- try again. Teradata error SIGNAL/RESIGNAL statement. Teradata error 8113 No more data rows available. Teradata error 2 Bad parameter passed to Access Module API Teradata error TPT3590 Error: in PERIOD datatype. Length specified must be a value between 0-6. Teradata error 13901 Invalid KTCB pointer. Error category errors 38* Teradata Database Errors