Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 2 of 2 total |
Union two queries where one query has a Nullif column |
Wed, Apr 15 2015 10:59 AM | Permanent Link |
Boss | My two queries have two columns each [Schedule_Guid, PaymentFrequency_Id]
Query one is basic select Schedule_Guid, PaymentFrequency_Id INTO memory\m1 from Schedule1 Query two has a null column select Schedule_Guid, NULLIF(Schedule_Guid, Schedule_Guid) as PaymentFrequency_Id into memory\m2 from schedule 2 select * from memory\m1 as X union select * from memory\m2 as Y produces this error DBISAM Engine Error # 11949 SQL parsing error - Expected NULL, Boolean, SmallInt, Word, AutoInc, Integer, LargeInt, Currency, Float, or BCD expression but instead found PaymentFrequency_Id in SELECT SQL statement May I ask how would I union the null column? |
Wed, Apr 15 2015 1:09 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Try this for query 2
select Schedule_Guid, '' as PaymentFrequency_Id into memory\m2 from schedule 2 '' and NULL are equivalent in DBISAM and using '' tells it that the field is a string. You might need to cast it as the same length as the field you're tring to union it with eg select Schedule_Guid, CAST('' AS STRING(10)) as PaymentFrequency_Id into memory\m2 from schedule 2 Roy Lambert |
This web page was last updated on Monday, May 6, 2024 at 01:09 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |