Jump to content

Sqlb error " database query failed near: VALUES syntax error"


Ryan2233

Recommended Posts

As title says. Query is: 

CREATE TABLE `housingdata`(`name`, `address`, `type`, `interior`, `intlock`, `owner`, `price`, `value`, `income`, `status`, `x`, `y`, `z`, `csX`, `csY`, `csZ`, `csrX`, `csrY`, `csrZ`) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", name ,  address ,  typeint ,  intint ,  "0" ,  "SAHousing" ,  tonumber(price) ,  tonumber(price) ,  tonumber(income) , tonumber(status) , tonumber(x) ,  tonumber(y) ,  tonumber(z) ,  tonumber(csx) ,  tonumber(csy) ,  tonumber(csz) ,  tonumber(csrx) ,  tonumber(csry) ,  tonumber(csrz)

Thanks

Error is  database query failed near: VALUES syntax error

Link to comment
executeSQLQuery("CREATE TABLE IF NOT EXISTS `housingdata` (name VARCHAR(255), address VARCHAR(255), type INT, interior INT, intlock INT, owner INT, price INT, value INT, income INT, status INT, x FLOAT(11), y FLOAT(11), z FLOAT(11), csX FLOAT(11), csY FLOAT(11), csZ FLOAT(11), csrX FLOAT(11), csrY FLOAT(11), csrZ FLOAT(11))")

 

Link to comment
32 minutes ago, NeXuS™ said:

executeSQLQuery("CREATE TABLE IF NOT EXISTS `housingdata` (name VARCHAR(255), address VARCHAR(255), type INT, interior INT, intlock INT, owner INT, price INT, value INT, income INT, status INT, x FLOAT(11), y FLOAT(11), z FLOAT(11), csX FLOAT(11), csY FLOAT(11), csZ FLOAT(11), csrX FLOAT(11), csrY FLOAT(11), csrZ FLOAT(11))")

 

??

Link to comment
22 minutes ago, NeXuS™ said:

You can use this in a script, and it'll create the table.

Alright

22 minutes ago, NeXuS™ said:

You can use this in a script, and it'll create the table.

I then get the error "Database quera failed: no such column: id. Any ideas?

 

Edited by Ryan2233
Link to comment
2 hours ago, NeXuS™ said:

Are you trying to add the "id" column via script? In that case, you don't have to shut down the server, and you don't have to delete registry.db.

I try to add it using the both alter table and via the script. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...