Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
58 stars 47 forks source link

SQL Error: 21 #1203

Closed GladieUO closed 10 months ago

GladieUO commented 11 months ago

I just wanted to start doing some LDB stuff, and probably find out that it might be broken? I have tried the dynamictemplates from X scriptpack to confirm the issue, and the result is spam of same errors I got from my script.

Function used: f_DTL_ldb_rebuild Problematic line:

ldb.queryINSERT OR REPLACE INTO '<def.DTL_DB_Table>' ('defname','class','race','sex','expansion','flags') VALUES("","","",,,)

image

cbnolok commented 11 months ago

That's indeed weird, it worked at the time, might have been broken by a sqlite update? I'll look into it

GladieUO commented 10 months ago

That's indeed weird, it worked at the time, might have been broken by a sqlite update? I'll look into it

Is there any recent commit for sqlite with older artifact that I could test to confirm?

GladieUO commented 10 months ago

It kind of works If u use the function from console, but this way, im not able to run it from players or from ingame to change their progres or so. Dont know if its intended or not, or im doing something wrong.

canerksk commented 10 months ago

image

https://www.sqlite.org/rescode.html

ldb.execute "INSERT OR REPLACE INTO '<def.DTL_DB_Table>' ('defname','class','race','sex','expansion','flags') VALUES("<local.defname>","<local.c>","<local.r>","<dlocal.sid>","<dlocal.e>","<dlocal.f>")";

insert, replace, update, delete these are executes. not query.

Also, what is the table structure and data types of columns?

GladieUO commented 10 months ago

This is for the dynamictemplates, the thing is, it was working using the function as GM char from game, now it works only through console. But If I want to use other DB or tables for players, I just cant write from ingame. image

This one is im trying to use, once player activates function doesnt matter how, it writes into DB. image

I honestly tried many different ways, execute or query, both have same result. The ldb.query line is from X scriptpack.

GladieUO commented 10 months ago

Is it possible that somehow using it from game, not from server console, there are some permissions missing?

GladieUO commented 10 months ago

Well magicaly I found the correct syntax, so i guess syntax was a problem. Im pretty sure I 100% tried it like this and it didnt work. Closing the issue.

ldb.execute INSERT INTO 'Progres' ('name','fame') VALUES ("",)