335544569 token unknown on select * query?

Running a query like this works:

select * from employee;

But, if you try:

select *, emp_no from EMPLOYEE;

You'll the the error:

335544569 Invalid token
SQL error code = -104
Token unknown - line 1, char 9 ,

You should never be using asterisk (*) in your queries, except for testing purposes. The order of columns in table can easily change, and columns can be added or deleted. Having explicit field list in your queries ensures your applications would:

a) keep working when fields are reordered or added
b) show an error when some of required columns is deleted

However, if you still wish to use a query like that, here's a solution:

select e.*, e.emp_no from EMPLOYEE e;

Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.

All contents are copyright © 2007-2024 FirebirdFAQ.org unless otherwise stated in the text.

Links   Firebird   News   FlameRobin   Powered by FB: Home Inventory   Euchre  
Add content   About  

 Installation and setup
 Backup and restore
 Connectivity and API
 Errors and error codes