Advertisement

07.17.2008 at 08:31AM PDT, ID: 23573582
[x]
Attachment Details

Pervasive SQL Union throwing Error

Asked by jamessa in Databases Miscellaneous

Tags: Pervasive PSQL v10, IE6, n/a

Here's a union statement I wrote:

SELECT  convert(' Type or Select from Dropdown List', sql_varchar) AS DisplayLocNo,
                convert(' Type or Select from Dropdown List', sql_varchar) AS DisplayName,
                convert(' Type or Select from Dropdown List', sql_varchar) AS DisplayDbaName,
                CONVERT(- 1, sql_integer) AS Loc_No, CONVERT(20, sql_integer) AS Dba
FROM CL_MAST
UNION
SELECT  ltrim(rtrim(CONVERT(Loc_No, sql_varchar) + ' - ' + LTRIM(RTRIM(Name)))) AS DisplayLocNo,
                ltrim(rtrim(LTRIM(RTRIM(Name)) + ' - ' + CONVERT(Loc_No, sql_varchar))) AS DisplayName,
                ltrim(rtrim(LTRIM(RTRIM(Dba_Name)) + ' - ' + CONVERT(Loc_No, sql_varchar))) AS DisplayDbaName,
                CONVERT(Loc_No, sql_integer) as Loc_No, LENGTH(Dba_Name) AS Dba
FROM CL_MAST CL_MAST_1
WHERE (Delete_Date IS NULL)
order by 4

It runs fine under version 8 after I added convert around the literal strings in the top part of the union.  In version 10, I get "[LNA}[Pervasive][ODBC Engine Interface] More than one unlimited size column in Distinct, Order By, Group By, or Union."
I've tried changing to cast and setting the size, but that didn't work.  I'm open to suggestions.
Thank you in advance for any help you can provide.

I'm new to Pervasive, but I'm an old pro when it comes to Oracle or SQL Server.
Sincerely,
Bruce Edgar
email: bedgar@aeshr.com
Start Free Trial
[+][-]07.17.2008 at 12:09PM PDT, ID: 22028959

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Databases Miscellaneous
Tags: Pervasive PSQL v10, IE6, n/a
Sign Up Now!
Solution Provided By: BillBach
Participating Experts: 1
Solution Grade: B
 
 
[+][-]07.17.2008 at 12:30PM PDT, ID: 22029259

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 12:55PM PDT, ID: 22029539

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.17.2008 at 01:08PM PDT, ID: 22029680

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628