Issue Details (XML | Word | Printable)

Key: CORE-148
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Arno Brinkman
Reporter: pfogel
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

SELECT '1' UNION SELECT '12'

Created: 03/Sep/04 12:00 AM   Updated: 14/Jun/06 09:32 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0 Beta 1

Time Tracking:
Not Specified

SF_ID: 1021931


 Description  « Hide
SFID: 1021931#
Submitted By: pfogel

Hello,
I was writing a computer program and wanted to UNION
two tables. This is what I did and what worked fine:

SELECT '1' || columna FROM table1
UNION
SELECT '2' || columnb FROM table2

But later I tried to do something similar like:

SELECT '1' || columna FROM table1
UNION
SELECT '12' || columnb FROM table2

The difference is the number of chars inside the ''.
The error I got was (I think it's a bug and should be
working fine):

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid command.
Data type unknown.

I also tried to cast the expressions as chars (which
might have been a stupid idea):

SELECT CAST ('1' || columna AS CHAR) FROM table1
UNION
SELECT CAST ('12' || columnb AS CHAR) FROM table2

the result was:

Arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow, or string
truncation.

I also tried to cast the expressions as varchars (which
might have been a stupid idea as well):

SELECT CAST ('1' || columna AS VARCHAR) FROM table1
UNION
SELECT CAST ('12' || columnb AS VARCHAR) FROM table2

the result was:

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 1, char 64.
).

According to my SQL-Book "GoTo SQL" by Hernandez and
Viescas these SELECTs should be working. That's why I
think it might be a bug in firebird.

The Software/Hardware I'm using:
- IBexpert 2004.06.17 (as a frontend)
- Firebird 1.5.1.4481
- Windows XP Pro SP2
- AMD Athlon XP

Thank you very much for developing Firebird.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.