[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Odd problem with Union



A colleague of mine encountered a problem with SQR today and I'm checking to
see if we have correctly identified the problem.  We are running SQR version
4.3.4 against an Oracle 8 database in conjunction with PeopleSoft 7.5

When we are using a union, SQR seems to evaluate the field length of data in
the first half of the union to determine how much space to allocate in
memory.  For example, if we code:

begin-select
A.EMPLID
A.NAME
' '     &A.RELATIONSHIP         ! Space is one character long
FROM PS_PERSONAL_DATA A
WHERE A.EMPLID = '00001'
UNION
SELECT B.EMPLID,
B.NAME,
B.RELATIONSHIP
FROM PS_DEPENDENT_BENEF B
WHERE B.EMPLID = '00001'
end-select

Your results will be
Emplid  Name                    Relationship
00001   Clinton, Bill                           <----This was blank
00001   Clinton, Hillary                S               <----Should be SP
00001   Clinton, Chelsey                D

This "feature" does not seem to exist in older versions of SQR.  Of course
it is always possible I have missed something obvious (I've made some really
stupid postings in the past).  That's why I'm asking the experts.  The
current fix seems to be to expand the number of spaces in your place holder
in the first half of the union to be the same length as the field(s) in the
subsequent portions of the union.

Thanks for any help

Paul