Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How I can simulate one cursor inside other cursor in qlikview

I'd like to run one sql and with the result use like parameters to execute another sql inside qlikview.

I could to do it by pl/sql but i'd like to do inside qlikview.

Eg.

cursor iniciar is select name from table A;

cursor acionar(nameB  varchar2) is select salary tableB where name =nameB;

begin

  for i in iniciar loop

     for j in acionar(i.nameB ) loop     

      insert into c (salary) values (j.sal)

     end loop;

  end loop;

end;

1 Solution

Accepted Solutions
maxgro
MVP
MVP

this is just an idea as now I haven't an Oracle db to check it; adapt to your question

tableA:

//

// replace inline load with select from Oracle

//

LOAD * INLINE [

    nameB

    1

    2

    5

];

//

// loop on rows of qlikview table (same as loop on Oracle outer table, first cursor)

//

for i = 1 to noofrows('tableA')

let vVar = fieldvalue('nameB',$(i));

  trace $(vVar);

  //

  // read from Oracle inner table (cursor 2) filtering with row/colum of tableA

  //

  tableB:

  load *;

  SQL

  select salary from tableBOracle where name = '$(vVar)';

next i

to insert in Oracle I think you have to set open database in read/write (script editor, tab settings), ask your oracle dba to grant, make a package or function or proc, ......, etc, etc........

Re: How to use PL/SQL package call in qlikivew script

but I personally would not do it

View solution in original post

2 Replies
maxgro
MVP
MVP

this is just an idea as now I haven't an Oracle db to check it; adapt to your question

tableA:

//

// replace inline load with select from Oracle

//

LOAD * INLINE [

    nameB

    1

    2

    5

];

//

// loop on rows of qlikview table (same as loop on Oracle outer table, first cursor)

//

for i = 1 to noofrows('tableA')

let vVar = fieldvalue('nameB',$(i));

  trace $(vVar);

  //

  // read from Oracle inner table (cursor 2) filtering with row/colum of tableA

  //

  tableB:

  load *;

  SQL

  select salary from tableBOracle where name = '$(vVar)';

next i

to insert in Oracle I think you have to set open database in read/write (script editor, tab settings), ask your oracle dba to grant, make a package or function or proc, ......, etc, etc........

Re: How to use PL/SQL package call in qlikivew script

but I personally would not do it

Not applicable
Author

Thank U so much.