Recent

Author Topic: [Sqlite Laz error] Yet another simple query. Can't set limit?  (Read 5333 times)

Sandrix

  • New Member
  • *
  • Posts: 32
    • My Portfolio
I have a simple query:

Code: [Select]
Query.SQL.Text  := 'select id from  eng  where eng like "'call%" limit 10';

Quote
select * from  eng  where  eng like "call%" limit 10

Getting an error in runtime:

Quote
near "order": syntax error

What's wrong?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
Re: [Sqlite Laz error] Yet another simple query. Can't set limit?
« Reply #1 on: July 23, 2010, 12:54:41 am »
don't use "limit 10"
I think Query adds a sort by appending "order by" to your sering.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Lacak2

  • Guest
Re: [Sqlite Laz error] Yet another simple query. Can't set limit?
« Reply #2 on: July 23, 2010, 07:31:28 am »
Which Data-access components do you use ? (sqlDB, Zeos)?

Sandrix

  • New Member
  • *
  • Posts: 32
    • My Portfolio
Re: [Sqlite Laz error] Yet another simple query. Can't set limit?
« Reply #3 on: July 23, 2010, 12:58:55 pm »
lol But I want/need to use it : )

if it adds "order by" automatically it means that I can't use "order by" either?

I'm using SQLdb, zeos is too buggy(especially on Mac)
« Last Edit: July 23, 2010, 01:02:15 pm by Sandrix »

Mujie

  • Jr. Member
  • **
  • Posts: 64
Re: [Sqlite Laz error] Yet another simple query. Can't set limit?
« Reply #4 on: July 25, 2010, 05:31:42 pm »
Watch your fingers from typo  :D

How about this ?

Code: [Select]
Query.SQL.Text  := 'SELECT id FROM eng WHERE eng LIKE "call%" ORDER BY id ASC LIMIT 10';

Sandrix

  • New Member
  • *
  • Posts: 32
    • My Portfolio
Re: [Sqlite Laz error] Yet another simple query. Can't set limit?
« Reply #5 on: July 26, 2010, 01:49:22 pm »
 :o lol it works.. thank a lot I'd never figure it out  by myself

 

TinyPortal © 2005-2018