Groups | Search | Server Info | Login | Register
Groups > comp.databases.ingres > #3848
| Newsgroups | comp.databases.ingres |
|---|---|
| Date | 2022-08-05 00:20 -0700 |
| References | <tcgoc0$s1j$1@gioia.aioe.org> |
| Message-ID | <c152fd37-0855-4ccf-b342-06198ff1e4den@googlegroups.com> (permalink) |
| Subject | Re: Was I wrong to expect this to work? |
| From | G Jones <geraint.jones@ndph.ox.ac.uk> |
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).
Back to comp.databases.ingres | Previous | Next — Previous in thread | Next in thread | Find similar
Was I wrong to expect this to work? Roy Hann <specially@processed.almost.meat> - 2022-08-04 15:24 +0000
Re: Was I wrong to expect this to work? G Jones <geraint.jones@ndph.ox.ac.uk> - 2022-08-05 00:20 -0700
Re: Was I wrong to expect this to work? Roy Hann <specially@processed.almost.meat> - 2022-08-05 08:11 +0000
csiph-web