1

Topic: The associative array - the index job

Kind time of days
I ask not to kick for  a question, but something I do not catch...
There is an array

type TOPERATTRS is TABLE of VARCHAR2 (4000) not null INDEX BY VARCHAR2 (30);
cOperAttrs TOPERATTRS;

At attempt of its filling

cOperAttrs (pkgString. GetWord (1, s, ' = ')) = pkgString. GetWord (2, s, ' = ');

Not function value from a packet, and a line pkgString becomes an index. GetWord (1, s, ' = ')
How to win?

2

Re: The associative array - the index job

wrote:

it is passed...
To esteem the documentation on used language.

The worthy answer - which part of the documentation?

3

Re: The associative array - the index job

AndIv;
It is obvious that that tool which you use for expression instructions in brackets, substitutes there this expression as a line.

4

Re: The associative array - the index job

well wrote:

AndIv;
It is obvious that that tool which you use for expression instructions in brackets, substitutes there this expression as a line.

pkgString. GetWord (1, s, ' = ')

Here this line (function) returns a certain string value. But it is not perceived

5

Re: The associative array - the index job

AndIv wrote:

it is passed...
The worthy answer - which part of the documentation?

Database PL/SQL Language Reference

cOperAttrs (pkgString. GetWord (1, s, ' = '))>>>: <<<= pkgString. GetWord (2, s, ' = ');

p.s. To you prompted, but you did not understand

wrote:

...

6

Re: The associative array - the index job

AndIv;

declare
type TOPERATTRS is TABLE of VARCHAR2 (4000) not null INDEX BY VARCHAR2 (30);
cOperAttrs TOPERATTRS;
s varchar2 (100);
function GetWord (p_pos int, p_s varchar2, p_r varchar2) return varchar2
is
begin
return to_char (to_date (substr (p_s, instr (p_s, p_r, 1, p_pos) +1, instr (p_s, p_r, 1, p_pos+1)-instr (p_s, p_r, 1, p_pos)-1), ' yyyy '), ' year ');
end;
begin
s: = ' = 1=2=3 = ';
cOperAttrs (GetWord (1, s, ' = ')): = s;
dbms_output.put_line (GetWord (2, s, ' = ') || '-> ' || cOperAttrs (GetWord (1, s, ' = ')));
end;
/
SQL> /
two-> =1=2=3 =
PL/SQL procedure successfully completed.

.....
stax

7

Re: The associative array - the index job

Vadim Lejnin wrote:

cOperAttrs (pkgString. GetWord (1, s, ' = '))>>>: <<<= pkgString. GetWord (2, s, ' = ');

Here it is clear, simple corrigendas, differently there would be an error smile
Thanks everything, jamb in display PL/SQL Dev
Actually all is beautiful smile

8

Re: The associative array - the index job

Stax, you, probably, the good husband.