Lazarus

Programming => Databases => Topic started by: badmintonfan on January 19, 2023, 04:26:47 am

Title: [SOLVED] SQL issue
Post by: badmintonfan on January 19, 2023, 04:26:47 am
I try to insert a record to SQLite,and found if the string includes 'd860',an error message will release
OS win10
Lazarus 2.2.4
DB component Zeos Access
Title: Re: SQL issue
Post by: PierceNg on January 19, 2023, 06:35:24 am
Provide a simple project with source code, database schema and sample data that shows the problem.
Title: Re: SQL issue
Post by: Thaddy on January 19, 2023, 10:38:34 am
I agree, provide example.
And good advice: first try without zeos. just sqlQuery. Zeos is a head-ache.
Title: Re: SQL issue
Post by: Nicole on January 19, 2023, 11:27:27 am
There is a tool, which is very new. May be it can help you.
I have not tested it by myself. Is recommended from heise, which has a high reputation in Germany.

https://www.heise.de/download/product/sqlite-administrator-59579
Title: Re: SQL issue
Post by: dseligo on January 19, 2023, 11:30:46 am
And good advice: first try without zeos. just sqlQuery. Zeos is a head-ache.

Why is Zeos a 'head-ache'?
Title: Re: SQL issue
Post by: Zvoni on January 19, 2023, 11:39:47 am
And good advice: first try without zeos. just sqlQuery. Zeos is a head-ache.

Why is Zeos a 'head-ache'?
Because it's an "external" component (and not the native one).
Never had any problems with the native Components Thaddy advises to use
Title: Re: SQL issue
Post by: dseligo on January 19, 2023, 11:51:12 am
And good advice: first try without zeos. just sqlQuery. Zeos is a head-ache.

Why is Zeos a 'head-ache'?
Because it's an "external" component (and not the native one).

Ah, OK. Not much of a headache for me, it's very easy to install using Online Package Manager (usually first thing I do after installing new version of Lazarus). And OP already obviously got it installed.
Title: Re: SQL issue
Post by: af0815 on January 19, 2023, 03:05:12 pm
And OP already obviously got it installed.
Its nice for the OP. But if i have to install external Components if i want to test some code (For me a nogo). There is also a ZEOS Forum https://zeoslib.sourceforge.io/ .

BTW: It is sometime a headache with external components if you are not using the actual stable/fixes of fpc/lazarus. This is normal, because the main can walk foreward and the native components are in sync.
Title: Re: SQL issue
Post by: andreaboc on January 19, 2023, 05:55:13 pm
Hi,
You can try to add the option:
Code: Pascal  [Select][+][-]
  1. ExtendedErrorMessage=1
in the ZConnection Properties Strings.
In this way, Zeoslib enable the extended error messages for SQLite and you have more detail for the error.
After the generic "SQL logic error" a Message detail will be added.
Title: Re: SQL issue
Post by: Thaddy on January 19, 2023, 06:40:45 pm
Indeed, I have nothing against Zeos persé but I do have someting against having to install/uninstall a non-standard package just to be able to answer a question. the standard db components are more than good enough and indeed tend to be a lot more stable.
Title: Re: SQL issue
Post by: dseligo on January 19, 2023, 08:53:36 pm
And OP already obviously got it installed.
Its nice for the OP. But if i have to install external Components if i want to test some code (For me a nogo). There is also a ZEOS Forum https://zeoslib.sourceforge.io/ .

BTW: It is sometime a headache with external components if you are not using the actual stable/fixes of fpc/lazarus. This is normal, because the main can walk foreward and the native components are in sync.

Same is true for BGRA, LazReport and many other components. So people should not ask in this forum if it is not part of FPC/Lazarus? I don't understand this negative attitude against Zeos.
If you don't have it installed simply don't answer this question.
I have it installed and I'll try to help if I can.
Title: Re: SQL issue
Post by: Thaddy on January 19, 2023, 09:29:56 pm
It is not negative, but in the case of Zeos pointless: it does not add anything that is not already there.
I know there are fans of Zeos, but why??? I really do not understand it. It is good code - but notoriously unstable- , yes, but what does it do better than the standard? Plz explain, and know I have tried Zeos over the years....

Pitch me an in-depth recommendation other than the wind wispers... You can't.
Title: Re: SQL issue
Post by: MarkMLl on January 19, 2023, 09:42:53 pm
It is not negative, but in the case of Zeos pointless: it does not add anything that is not already there.

I'm not disagreeing with that, but in any event there are two things that OP could usefully do:

/First/, check that his query works with a command-line app to the backend (I think there's one for SQLite).

/Second/, submit a minimal program that demonstrates the problem: and the fewer external dependencies the better.

From the absolute minimal information we've been given so far it's impossible to be certain what d860 is: a Unicode character point?

MarkMLl
Title: Re: SQL issue
Post by: dseligo on January 20, 2023, 03:14:22 am
It is not negative, but in the case of Zeos pointless: it does not add anything that is not already there.
I know there are fans of Zeos, but why??? I really do not understand it. It is good code - but notoriously unstable- , yes,

What is it so unstable in Zeos, can you explain?

Quote
but what does it do better than the standard? Plz explain, and know I have tried Zeos over the years....

SQLdb feels clumsy (I don't know better word), Zeos is just more convenient to use for me. And I don't mind that minute I need to install it.

For me the most annoying thing with SQLdb is that I have to explicitly close query, before starting new one. Not that it's more typing, it could lead to bugs.
This is what I mean by this:
Code: Pascal  [Select][+][-]
  1. SQLQuery1.SQL.Text := 'select something from sometable where firstcolumn > secondcolum';
  2. SQLQuery1.Open;
  3.  
  4. ... do something with results ...
  5.  
  6. SQLQuery1.SQL.Text := 'select something from sometable where secondcolum < thirdcolumn'; // this is ignored
  7. SQLQuery1.Open; // this is ignored
  8.  
  9. ... here are same result as in the first run!
  10.  

One more thing that I don't like is that for each database type have to use different component.
On this laptop I have MariaDB, and since there isn't component for MariaBDB I used MySQL80Connection. I got error that I have to use MySQL57Connection, but then I have to change variable name, and properties of transaction and SQLQuery. In Zeos you just change database type and everything works.

There was also something with MSSQL, I had to use more MSSQLConnection's to the same server (for each SQLQuery component or group of them), it didn't work with one connection. I don't remember exactly what was problem, but it was PITA. After I switched components to Zeos it just worked with one connection.

Quote
Pitch me an in-depth recommendation other than the wind wispers... You can't.

I don't understand this. You mean pitch as in pitchfork or pitch in music? Wind?
Title: Re: SQL issue
Post by: af0815 on January 20, 2023, 07:19:57 am
Actual is a discussion about something, but the OP is not seen anymore in this thread.

This thread should not be a offtopic discussion about external components.

my 2 cents.
Title: Re: SQL issue
Post by: badmintonfan on January 22, 2023, 08:33:09 am
Hello All
Thank all of you very much,now this issue has been solved by Zeos 8,but actually,this is a beta version,I'm not sure what else other issues
TinyPortal © 2005-2018