Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SELECT '1' UNION SELECT '12' [CORE148] #477

Closed
firebird-automations opened this issue Sep 3, 2004 · 3 comments
Closed

SELECT '1' UNION SELECT '12' [CORE148] #477

firebird-automations opened this issue Sep 3, 2004 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: pfogel (pfogel)

Assigned to: @ArnoBrinkman

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10172 ] => Firebird [ 14387 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant