SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 31/05/2014, 11:45 PM   #1
DrakeX
Banned
 
Join Date: Dec 2011
Posts: 73
Reputation: 49
Default Expressions Do Not Work In SA-MP SQLite

After testing numerous queries, I've come to the conclusion that expressions do not work in SA-MP's SQLite. I've tried various and as mentioned numerous queries, only to find the syntax's which work outside of SA-MP's SQLite do not have an effect.
DrakeX is offline   Reply With Quote
Old 01/06/2014, 01:19 PM   #2
KingHual
Banned
 
Join Date: Jun 2010
Location: Bulgaria
Posts: 2,294
Reputation: 1389
Default Re: Expressions Do Not Work In SA-MP SQLite

Examples?
KingHual is offline   Reply With Quote
Old 04/06/2014, 06:39 PM   #3
DrakeX
Banned
 
Join Date: Dec 2011
Posts: 73
Reputation: 49
Default Re: Expressions Do Not Work In SA-MP SQLite

Quote:
Originally Posted by KingHual View Post
Examples?
pawn Code:
db_query(database, "SELECT `STAT` FROM `TABLE` WHERE `STAT` > 1 ORDER BY (`STAT` * 1) DESC");

This proportion has no effect on the query:

pawn Code:
WHERE `STAT` > 1

(I've tried querying various syntax's with the same result(s)). I thought the issue was my syntax usage, but after checking various articles on SQLite, that doesn't seem to be the case.

Quote:
Originally Posted by Calgon View Post
IS UNKNOWN CMMAND BRO
YEAH MEN.
DrakeX is offline   Reply With Quote
Old 04/06/2014, 07:33 PM   #4
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,893
Reputation: 1321
Default Re: Expressions Do Not Work In SA-MP SQLite

Quote:
Originally Posted by DrakeX View Post
pawn Code:
db_query(database, "SELECT `STAT` FROM `TABLE` WHERE `STAT` > 1 ORDER BY (`STAT` * 1) DESC");

This proportion has no effect on the query:

pawn Code:
WHERE `STAT` > 1

(I've tried querying various syntax's with the same result(s)). I thought the issue was my syntax usage, but after checking various articles on SQLite, that doesn't seem to be the case.



YEAH MEN.
Is `STAT` type numeric ?
Pottus is offline   Reply With Quote
Old 04/06/2014, 07:36 PM   #5
DrakeX
Banned
 
Join Date: Dec 2011
Posts: 73
Reputation: 49
Default Re: Expressions Do Not Work In SA-MP SQLite

Numeric when the table is initially created? If so, no, I haven't specified field types, however the value is numerical when saved and read. I've also tried using:

pawn Code:
WHERE (`STAT` * 1) > 1

With no luck.
DrakeX is offline   Reply With Quote
Old 09/06/2014, 01:01 PM   #6
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,893
Reputation: 1321
Default Re: Expressions Do Not Work In SA-MP SQLite

Make sure the table type is numeric I've experienced this problem before you could probably also do this but not recommended.

pawn Code:
db_query(database, "SELECT `STAT` FROM `TABLE` WHERE `STAT` > '1' ORDER BY (`STAT` * '1') DESC");

At any rate if your using SQLite then using SQLitei is for you here is my recommended read overs for using SQLite with SAMP. SQLitei has query error reporting which is very useful for debugging queries (only works on Windows) technically you don't need to use any native features of SQLitei either to take advantage of some of the features. I will recommend you open your db's with this native.

pawn Code:
DB:db_open_persistent(name[])

http://forum.sa-mp.com/showthread.php?t=449536 - Konstantinos tutorial
http://forum.sa-mp.com/showthread.php?t=303682 - SQLitei
Pottus is offline   Reply With Quote
Old 09/06/2014, 11:11 PM   #7
DrakeX
Banned
 
Join Date: Dec 2011
Posts: 73
Reputation: 49
Default Re: Expressions Do Not Work In SA-MP SQLite

Quote:
Originally Posted by [uL]Pottus View Post
Make sure the table type is numeric I've experienced this problem before you could probably also do this but not recommended.

pawn Code:
db_query(database, "SELECT `STAT` FROM `TABLE` WHERE `STAT` > '1' ORDER BY (`STAT` * '1') DESC");

At any rate if your using SQLite then using SQLitei is for you here is my recommended read overs for using SQLite with SAMP. SQLitei has query error reporting which is very useful for debugging queries (only works on Windows) technically you don't need to use any native features of SQLitei either to take advantage of some of the features. I will recommend you open your db's with this native.

pawn Code:
DB:db_open_persistent(name[])

http://forum.sa-mp.com/showthread.php?t=449536 - Konstantinos tutorial
http://forum.sa-mp.com/showthread.php?t=303682 - SQLitei
Thanks, changing it to numeric from my SQLite data browser fixed the issue. I'm currently using another include which prints errors (from what I recall -- Emmet's), but it isn't specific. I'll take a look at and probably start using SQLitei now however.
DrakeX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Banip command wont work - SQLite dominik523 Scripting Help 2 02/12/2013 08:52 PM
expressions string to expressions? iJumbo Scripting Help 7 04/05/2013 03:33 PM
Can someone explain to me these expressions? CJoao Help Archive 4 08/08/2011 01:40 AM
Invalid expressions cre8ticity Help Archive 5 28/10/2010 01:15 PM
Expressions not found and Expected tocken dillo1000 Help Archive 0 14/10/2010 05:51 PM


All times are GMT. The time now is 07:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.