M
M
marselabdullin2020-10-29 19:18:22
Oracle
marselabdullin, 2020-10-29 19:18:22

How to run dynamic query in oracle select?

I need something like this:

begin
    for group_level in (select * from group_level)
        loop
            execute immediate 'select :gosb from erp_trips' using group_level.gosb_id;
         end loop;
end;

Group_level is a table in which gosb_id is the name of the field to get from erp_trips (in this case 'GOSB')

The code is executed but the table is not displayed, what's the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question