[SOLVED] Error on multiple Selects lazarus / 16-Databases ---------------------------------------------------------------------- gkelby · 2015-01-01 01:07 I was hoping someone could assist me with this problem.  Not sure what I'm doing wrong. I issue a Select statement to read from a table with no problem.  I then issue another Select call to the same table to read a different set of columns from the first set and I get an error message telling me the first column to be read in the second set does not exist.  The exact error message is "Debugger Exception Notification: Project xxx raised exception class 'EDatabaseError' with message no such column: Col1, at address xxx" .  And yes, the column it complains about does exist. I tried closing the transaction and committing the previous read select prior to setting up the new Select statement, but they have had no effect. Using Lazarus 1.1.99 Pre-Release, FPC Version 2.6.2, SVN Revision 42829 on Win 7 64 bit version. Thanks for helping. GK ---------------------------------------------------------------------- Leledumbo · 2015-01-01 05:04 code please... ---------------------------------------------------------------------- Never · 2015-01-01 06:47 The message does not mean that the column does not exist in you table means tha is not exist in your select query ex: table :[col1][col2][col3][col4][col5] select * from (select col1,col2 from table); columns 3/4/5 are not included because you limit your results to 1 and 2 with the first select if you try to access 3/4/5 you will get the error you mention ---------------------------------------------------------------------- gkelby · 2015-01-02 00:41 Hi Never: To use your example, I'll expand on what I'm doing: table :[col1][col2][col3][col4][col5] The first select, for example, is select col1, col2 from table where "qualifier", and it works. The second select is, select col3, col4, col5 from table where "qualifier" and at this point the statement errors out with the error message stating that col3 does not exist. The "qualifier" is the same for both statements. I can change the second select to read select col4, col5 from table where "qualifier" and, again, the statement errors out with the error message stating that col4 does not exist. GK. ---------------------------------------------------------------------- gkelby · 2015-01-02 00:50 Hi Never: Thanks for responding.  I've found the problem.  I should have taken a MUCH closer look at the text of the select.  The problem was a simple space character between col5 and "From".  In other words, the statement was trying to read from "col5from table" rather that "col5 from table". Thanks... Gk. ---------------------------------------------------------------------- Never · 2015-01-02 00:55 if  the col exist in table and if  the col exist in sql then you missspelling the field name or inside the sql --> or a typo--->edit and fix                                 or a ***ghost**-->try to use [col2],[col4] etc or inside the table definition -->edit and fix if you still have problem upload a small demo to reproduce your issue as @Leledumbo mention Edit***: Glad you made it