How to find LIMIT in SQL standard

Поиск
Список
Период
Сортировка
От Rory Campbell-Lange
Тема How to find LIMIT in SQL standard
Дата
Msg-id 20030922124218.GA7730@campbell-lange.net
обсуждение исходный текст
Ответы Re: How to find LIMIT in SQL standard  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: How to find LIMIT in SQL standard  (Gaetano Mendola <mendola@bigfoot.com>)
Re: How to find LIMIT in SQL standard  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-general
I have to file a bug about the implementation of some delivery report
database calls in the Kannel (open source WAP/SMS) server code.

Essentially the call (as defined below) asks for an update and adds a
LIMIT parameter on the end of the UPDATE. (eg update where x=1 limit 1).
Postgres doesn't like this and I assume it isn't SQL standards
compliant and need to refer to this in my bug report.

I've downloaded the sql document archives from
postgresql.org/postgresql/doc/sql but it isn't clear to me how to
discern what is legal in an UPDATE statement.

Help much appreciated!
Rory

static const char* sdb_get_limit_str()
{
    switch (sdb_conn_type) {
        case SDB_ORACLE:
            return "AND ROWNUM < 2";
        case SDB_OTHER:
        default:
            return "LIMIT 1";
    }

    ...

sql = octstr_format("UPDATE %s SET %s=%d WHERE %s='%s' AND %s='%s' %s",
                    octstr_get_cstr(fields->table),
                    octstr_get_cstr(fields->field_status), status,
                    octstr_get_cstr(fields->field_smsc), octstr_get_cstr(smsc),
                    octstr_get_cstr(fields->field_ts), octstr_get_cstr(ts), sdb_get_limit_str());


--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>

В списке pgsql-general по дате отправления:

Предыдущее
От: Paul Thomas
Дата:
Сообщение: Re: Question about connection java and Postgresql in Linux
Следующее
От: viktor@lacina.org
Дата:
Сообщение: encoding and LIKE/ILIKE matching