Home » U++ Library support » U++ SQL » Two tables sharing same field name?
Re: Two tables sharing same field name? [message #26881 is a reply to message #26837] |
Sat, 05 June 2010 17:46 |
jeremy_c
Messages: 175 Registered: August 2007 Location: Ohio, USA
|
Experienced Member |
|
|
All of the "modes" are added in one place from a well defined list. I checked and checked and checked, there are no duplicates there. If I change the second use of "NAME" to be a length of 40, then my routine runs fine, always. If, however, I change the second use of "NAME" back to 8, then it will always err. And the second use of "NAME" is not at all where the error is occurring.
The bug log says:
ERROR SQL logic error or missing database(0): insert into MODES(NAME) values ('PSK31')
However, when looking at the created database file (SQLite) there 48 modes added out of 73 modes that I said to add.
My project is *very* small right now, I have made it available at http://jeremy.cowgar.com/files/SmartLog.zip ... maybe that would help solve the problem?
Basically at this point it's 1 window that contains a grid that does nothing. In my GUI_APP_MAIN, I create/open the database and add base data (where the problem is) if the database did not exist on this run.
I am running on Windows with the MSC9 Debug profile selected. You can run the project as is and it fails always for me. However, if you edit SmartLog.sch, line 7 and change the 8 to a 40, then the project will run (besure to remove the previously created database file and .sql files, otherwise the new data log will not happen).
Non-working SmartLog.sch:
TABLE_(MODES)
INT_ (ID) PRIMARY_KEY AUTO_INCREMENT
STRING_ (NAME, 40) UNIQUE
END_TABLE
TABLE_(BANDS)
STRING (NAME, 8) UNIQUE
DOUBLE_ (FREQ_BEGIN)
DOUBLE_ (FREQ_END)
END_TABLE
Working SmartLog.sch:
TABLE_(MODES)
INT_ (ID) PRIMARY_KEY AUTO_INCREMENT
STRING_ (NAME, 40) UNIQUE
END_TABLE
TABLE_(BANDS)
STRING (NAME, 40) UNIQUE
DOUBLE_ (FREQ_BEGIN)
DOUBLE_ (FREQ_END)
END_TABLE
Thanks for any help with this problem. For now I am just using the "working" schema file, however, I fear I will run into more issues like this later on.
Jeremy
|
|
|
Goto Forum:
Current Time: Fri May 10 07:31:54 CEST 2024
Total time taken to generate the page: 0.02576 seconds
|