Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Linux is obsolete -- Andrew Tanenbaum


devel / comp.databases.ingres / Was I wrong to expect this to work?

SubjectAuthor
* Was I wrong to expect this to work?Roy Hann
`* Re: Was I wrong to expect this to work?G Jones
 `- Re: Was I wrong to expect this to work?Roy Hann

1
Was I wrong to expect this to work?

<tcgoc0$s1j$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=255&group=comp.databases.ingres#255

  copy link   Newsgroups: comp.databases.ingres
Path: i2pn2.org!i2pn.org!aioe.org!ow2HZ3WUoSa7bUAoHqrJ8A.user.46.165.242.75.POSTED!not-for-mail
From: specia...@processed.almost.meat (Roy Hann)
Newsgroups: comp.databases.ingres
Subject: Was I wrong to expect this to work?
Date: Thu, 4 Aug 2022 15:24:48 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tcgoc0$s1j$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="28723"; posting-host="ow2HZ3WUoSa7bUAoHqrJ8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: XPN/1.2.6 (Street Spirit ; Windows)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Roy Hann - Thu, 4 Aug 2022 15:24 UTC

* create sequence genno as integer;
* create procedure next_vno result row (integer)
* as declare vno integer not null;
* begin
* select genno.nextval * 10 + generate_digit('LUHN_A',genno.currval) into :vno;
* return row (:vno);
* end
* \g
Executing . . .

continue
* select * from next_vno() \g
Executing . . .

E_LQ003A Cannot start up 'select' query.
Unexpected initial protocol response.

Roy

Re: Was I wrong to expect this to work?

<c152fd37-0855-4ccf-b342-06198ff1e4den@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=256&group=comp.databases.ingres#256

  copy link   Newsgroups: comp.databases.ingres
X-Received: by 2002:a05:620a:4726:b0:6b6:2239:f5f7 with SMTP id bs38-20020a05620a472600b006b62239f5f7mr4163049qkb.96.1659684032651;
Fri, 05 Aug 2022 00:20:32 -0700 (PDT)
X-Received: by 2002:a05:6214:19cd:b0:477:ea03:57e9 with SMTP id
j13-20020a05621419cd00b00477ea0357e9mr4666860qvc.50.1659684032491; Fri, 05
Aug 2022 00:20:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.databases.ingres
Date: Fri, 5 Aug 2022 00:20:32 -0700 (PDT)
In-Reply-To: <tcgoc0$s1j$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=163.1.206.129; posting-account=WeWzrgoAAADuZDdxDgTJ3OtwovooLFLl
NNTP-Posting-Host: 163.1.206.129
References: <tcgoc0$s1j$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c152fd37-0855-4ccf-b342-06198ff1e4den@googlegroups.com>
Subject: Re: Was I wrong to expect this to work?
From: geraint....@ndph.ox.ac.uk (G Jones)
Injection-Date: Fri, 05 Aug 2022 07:20:32 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2025
 by: G Jones - Fri, 5 Aug 2022 07:20 UTC

On Thursday, August 4, 2022 at 4:24:50 PM UTC+1, Roy Hann wrote:
> * create sequence genno as integer;
> * create procedure next_vno result row (integer)
> * as declare vno integer not null;
> * begin
> * select genno.nextval * 10 + generate_digit('LUHN_A',genno.currval) into :vno;
> * return row (:vno);
> * end
> * \g
> Executing . . .
>
> continue
> * select * from next_vno() \g
> Executing . . .
>
> E_LQ003A Cannot start up 'select' query.
> Unexpected initial protocol response.
>
> Roy

I get E_SC0206, but splitting the query up slightly persuades it to produce a result:

create procedure next_vno result row (integer) as
declare v1 integer not null;
v2 integer not null;
v3 integer not null;
begin
select genno.nextval, genno.currval into :v1,:v2;
select :v1 * 10 + generate_digit('LUHN_A',:v2) into :v3;
return row(:v3);
end;

(Using 11.1 +p15773).

Re: Was I wrong to expect this to work?

<tcijb0$1l5l$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=257&group=comp.databases.ingres#257

  copy link   Newsgroups: comp.databases.ingres
Path: i2pn2.org!i2pn.org!aioe.org!ow2HZ3WUoSa7bUAoHqrJ8A.user.46.165.242.75.POSTED!not-for-mail
From: specia...@processed.almost.meat (Roy Hann)
Newsgroups: comp.databases.ingres
Subject: Re: Was I wrong to expect this to work?
Date: Fri, 5 Aug 2022 08:11:12 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <tcijb0$1l5l$1@gioia.aioe.org>
References: <tcgoc0$s1j$1@gioia.aioe.org> <c152fd37-0855-4ccf-b342-06198ff1e4den@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="54453"; posting-host="ow2HZ3WUoSa7bUAoHqrJ8A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: XPN/1.2.6 (Street Spirit ; Windows)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Roy Hann - Fri, 5 Aug 2022 08:11 UTC

G Jones wrote:

> On Thursday, August 4, 2022 at 4:24:50 PM UTC+1, Roy Hann wrote:
>> * create sequence genno as integer;
>> * create procedure next_vno result row (integer)
>> * as declare vno integer not null;
>> * begin
>> * select genno.nextval * 10 + generate_digit('LUHN_A',genno.currval) into :vno;
>> * return row (:vno);
>> * end
>> * \g
>> Executing . . .
>>
>> continue
>> * select * from next_vno() \g
>> Executing . . .
>>
>> E_LQ003A Cannot start up 'select' query.
>> Unexpected initial protocol response.
>>
>> Roy
>
>
> I get E_SC0206, but splitting the query up slightly persuades it to produce a result:
>
> create procedure next_vno result row (integer) as
> declare v1 integer not null;
> v2 integer not null;
> v3 integer not null;
> begin
> select genno.nextval, genno.currval into :v1,:v2;
> select :v1 * 10 + generate_digit('LUHN_A',:v2) into :v3;
> return row(:v3);
> end;
>
> (Using 11.1 +p15773).

Thanks Geraint.

I did roughly the same thing so currval wasn't needed at all. But your
way confirms currval is not the source of the problem.

Incidentally I had previously tried using a view, on the basis that
any query can be a view. It turns out querying a sequence in a view is
explicitly disallowed.

I cannot think what the justification would be. It's an annoying
exceptional case. But hey-ho; it's SQL. :-P

Roy

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor