Expressions Do Not Work In SA-MP SQLite
#1

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.
Reply
#2

Examples?
Reply
#3

Quote:
Originally Posted by KingHual
Посмотреть сообщение
Examples?
pawn Код:
db_query(database, "SELECT `STAT` FROM `TABLE` WHERE `STAT` > 1 ORDER BY (`STAT` * 1) DESC");
This proportion has no effect on the query:

pawn Код:
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
Посмотреть сообщение
IS UNKNOWN CMMAND BRO
YEAH MEN.
Reply
#4

Quote:
Originally Posted by DrakeX
Посмотреть сообщение
pawn Код:
db_query(database, "SELECT `STAT` FROM `TABLE` WHERE `STAT` > 1 ORDER BY (`STAT` * 1) DESC");
This proportion has no effect on the query:

pawn Код:
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 ?
Reply
#5

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 Код:
WHERE (`STAT` * 1) > 1
With no luck.
Reply
#6

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

pawn Код:
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 Код:
DB:db_open_persistent(name[])
https://sampforum.blast.hk/showthread.php?tid=449536 - Konstantinos tutorial
https://sampforum.blast.hk/showthread.php?tid=303682 - SQLitei
Reply
#7

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Make sure the table type is numeric I've experienced this problem before you could probably also do this but not recommended.

pawn Код:
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 Код:
DB:db_open_persistent(name[])
https://sampforum.blast.hk/showthread.php?tid=449536 - Konstantinos tutorial
https://sampforum.blast.hk/showthread.php?tid=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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)