#1 2014-03-25 08:32:09

Tohang
Member
Registered: 2010-06-24
Posts: 10

Error 16 - Execute SQL via services Fied Default

CREATE TABLE [Order Details] ([OrderID] INTEGER, [ProductID] INTEGER NOT NULL, [UnitPrice] REAL NOT NULL Default 0, [Quantity] INTEGER NOT NULL Default 1, [Discount] REAL NOT NULL Default 0, PRIMARY KEY ( [OrderID], [ProductID]))

20140325 14031617 srvr      POST root/RemoteSQL.Execute/8 ERROR=500 (Exception ESQLite3Exception: near "Order": syntax error)

Why erorr when Field added "Default 1"

Offline

#2 2014-03-25 09:53:47

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Error 16 - Execute SQL via services Fied Default

BTW, why are you execute such SQL from the client?
IMHO you should better:
- Either use the mORMot ORM, and let it create the table;
- Either use the SQL on the server side, with an explicit high-level service, i.e. switch to a SOA n-Tier architecture.

According to the error, you are trying to execute a MS SQL syntax with the SQLite3 driver.
Please select the appropriate connection type from the client.
I suspect you did not set the connection type, and stick to the default SQlite3 connection properties.

You can also try the command with SynDBExplorer and explicitly the MS SQL connection.

Offline

#3 2014-03-25 12:41:59

Tohang
Member
Registered: 2010-06-24
Posts: 10

Re: Error 16 - Execute SQL via services Fied Default

I run the example "16 - Execute SQL via services".
I copy the sample database "NorthWind.db" and the program "Server" then "Client" is executed.
When the "Client" runs, the form filled in as follows:
Egine: Sqlite 3                  Server    :  NorthWind.db:              User      :                 Open
                                     Database : NorthWind.db              Password :

Select * from Order Details

                                           Select * from: Order Details                                    Execute

After Execute error occurs because there is a default, to another Table no problem as to: Orders, Customers, Employees.

Offline

#4 2014-03-25 12:45:39

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Error 16 - Execute SQL via services Fied Default

As I suspected, you selected SQLite3 as engine.
Please use MS SQL instead!

smile

Or perhaps NorthWind.db is a SQLIte3 database.
In this case, Sqlite3 as engine is correct, but your CREATE statement syntax is not correct: this is MSSQL dialect, and not SQlite3 dialect!
https://www.sqlite.org/lang_createtable.html

Offline

#5 2014-03-25 13:22:43

Tohang
Member
Registered: 2010-06-24
Posts: 10

Re: Error 16 - Execute SQL via services Fied Default

Sample database "NorthWind.db" is a SQLite database, how to open the "MS SQL" Engine?. With the "S qlite 3" Engine all table data can be displayed unless the "Order Details", because there is a default Field.
Database accessed by "Sqlite Manager" Add-ons Mozilla Firefox there is no problem.

Offline

#6 2014-03-25 14:42:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Error 16 - Execute SQL via services Fied Default

Sqlite3 will never execute

CREATE TABLE [Order Details] ([OrderID] INTEGER, [ProductID] INTEGER NOT NULL, [UnitPrice] REAL NOT NULL Default 0, [Quantity] INTEGER NOT NULL Default 1, [Discount] REAL NOT NULL Default 0, PRIMARY KEY ( [OrderID], [ProductID])) 

This is not its syntax.

Offline

Board footer

Powered by FluxBB