views and arrays

guial

New Member
Hi !

Progress 9.1D CHUI

I would like to know if it's possible to create a view where one of the fields is an
array. When I try to create that view, the Progress error message 1766 (Array
fields cannot be referenced in SQL views) appears.

I've tried to use PRO_ELEMENT command(champ2,1,1), but without success
(Progress error 247 - Unable to understand after "create view vue1").

Example of what I would like:

create view vue1 as select champ1, champ2, champ3 from table1

where champ2 is a char array with extent 10

Thanks
 

StefGay

Member
Hi,

juste one thing, this kind of question have to be posted in the sql_92 forum.

I it can help if give you my solution for this kind of feature:

create view vue1 ("champ1","champ2__1","champ2__2",...,"champ2__10","champ3")
as
select champ1,PRO_ELEMENT("champ2",1,1),PRO_ELEMENT("champ2",2,2),...,PRO_ELEMENT("champ2",10,10),champs3
form table1;
commit;

After that, you can access your differents elements with :

select champ2__3 form vue1;

But my 0.3 Euros point of view about this is that this solution is a workaround you have to change you table definition and create a "daugther" table of the "mother" table1 instead of using arrays.

Regards.

Stéphane.
 

guial

New Member
Hi Stéphane

First of all, thank you for your support.

I've tried your solution but it didn't worked.

I still have the same message (error message 247 Unable to understand after "create view vue1").

I'm wondering if the pro_element command is supported with Progress 9.1D or
if it's just for ODBC. :confused:

I will continued to search.

Bye
 

StefGay

Member
Hi,

you can't use sql statements in 4GL you must use "SQL Explorer interactive tool" to create views or to grant privileges to some accounts...

Take a look at the Progress SQL 92 Guide And Reference Edoc you will find a lot of informations.

Stéphane.
 

guial

New Member
Hi

When I try to create a view without the pro_element command, it's working:

create view vue1 as select champ1, champ2, ..., champn from table1

grant all on vue1 to public

etc.

So, I'm still confused...
:rolling:
 
Top