Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
If you can't
login and post questions or you are having trouble viewing forum posts:
Click Here
|
Callback
Support |
If you live in USA, UK, Canada, Australia or New
Zealand, you can leave us details on your question and request us to call you back and discuss
them with you personally (charges apply). |
Click Here
|
Buy Support
Incidents |
If you can't find your answer
in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us
private or confidential information: |
Click Here
|
|
UNABLE TO INSERT INTO TABLE |
Author |
Message |
|
Posted : 2006-12-05 22:33:29 |
1. We are evaluating the FlexOdbc Driver Version 4.00.24, with a view to EXPORTING DATA from an SQL Server straight into one or more DataFlex tables. We intend doing this from a Delphi program connected to both databases, pulling data from one, inserting into the other;
2. We have been able to successfully SELECT FROM and UPDATE all tables we tried to;
3. However, when we try to INSERT data into the below existing DataFlex table (a), by executing DML statement (b) from an SQL tool connected via you FlexODBC Driver, we get the following error:
"Error: Expected lexical element not found: ) (State:37000, Native Code: 2B07)"
(a) TABLE CONTA (
RECORD_NUMBER INTEGER NOT NULL PRIMARY KEY, CODIGO DECIMAL(4,0), DESCRICAO VARCHAR(40) )
(b) INSERT INTO CONTA (CODIGO, DESCRICAO) VALUES (123, 1, 'test')
Curious thing is where could a closing parenthesis ('element not found') be missing ?
4. Have also tried:
INSERT INTO "CONTA" ("CODIGO", "DESCRICAO") VALUES (123, 1, 'test')
with the same result.
Thanking you for a reply,
faustot
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2006-12-06 08:56:05 |
Record Number is auto-generated by the DataFlex DBMS. Try:
INSERT INTO "CONTA" ("CODIGO", "DESCRICAO") VALUES (1.0, 'test') |
|
|
|
|
Posted : 2006-12-07 21:16:14 |
Tom,
1. In fact I had already tried with and without the auto-generated column, so much so that when I posted the question to you I ended up with a breed of both... Murphy strikes again !
In any event, the line you recommended: INSERT INTO "CONTA" ("CODIGO", "DESCRICAO") VALUES (1.0, 'test') results in the exact same error line, including the Native Code 2B07.
Why is the ODBC driver reporting lexical element ")" not found ?
2. Before asking you whether it could or not be some ODBC driver configuration in the Windows Control Panel, seeing that you sugested 1.0 instead of 1 for the decimal column, I had a look there and changed "Force Number Separator" from the default "DataFlex" to "10.000,00".
Now ALL INSERTS WORK, with or without double-quotes around table names and column names and using decimal or integer notation (1.0 or 1) as values for DECIMAL(p,s) columns.
Therefore, perhaps just a final comment as to why "Force Number Separator" set to "DataFlex" produced the before mentioned lexical error might be appropriate.
Many thanks once again.
faustot |
|
|
|
|