Skip site navigation (1) Skip section navigation (2)

ECPG: Missing in SQL standard? getting _one_ row out of a multirow descriptor

From: Christof Petig <christof(at)petig-baender(dot)de>
To: Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>
Subject: ECPG: Missing in SQL standard? getting _one_ row out of a multirow descriptor
Date: 2001-10-23 08:08:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Hi all,

You might know that 7.2 supports multirow descriptors (select ... into
descriptor ...). You can get the number of rows in a descriptor with a
call to  get descriptor ... :VAR=cardinality  .

But as I read the standard there is no way of reading exactly one row
(or to get the data row by row). Does anybody have an opinion on how to
name it? (I didn't invent this strange 'value' syntax)

get descriptor  name  :VAR = count;    is the number of columns
get descriptor  name  value :N  :VAR = cardinality;    gets the number
of rows of column N
get descriptor  name  value :N  :VAR = data;    gets all rows of column
N (starting by 1)

what about

get descriptor  name  value :N  :VAR = data[:M];     to get element

Any other ideas on how to name it?

Or does anybody know the standard better than I? redesigning
ECPGget_descriptor is just another issue but solveable.

Remember this is about extending the standard. But this standard is at
most worth the paper it is written on. Oracle never mentions this method
of dynamic SQL, they use SQLDA (which I strongly dislike compared to
this clean way of accessing dynamic data).


pgsql-interfaces by date

Next:From: Tom LaneDate: 2001-10-23 14:52:31
Subject: Re: ECPG error message
Previous:From: Michael MeskesDate: 2001-10-23 06:58:19
Subject: Re: ECPG error message

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group