dbi db2 select

C

Carmine

Is there anyway to execute this select statement with dbi?

select
'grant select on ' concat substr(viewschema,1,7) concat '.' concat
substr(viewname,1,18) concat
' to ' concat dbc_xid_user_id concat ';'
from syscat.views, ls2user.vls_db_connection
where viewschema = 'ls2user'
and valid='Y'
and seqno = 1
union
select
'grant select on ' concat substr(viewschema,1,7) concat '.' concat
substr(viewname,1,18) concat
' to ls2user;'
from syscat.views
where viewschema = 'ls2user'
and valid='Y'
and seqno = 1
order by 1;

I can run it successfully from a db2 command window like this:
db2 -atvf gengrant.sql -z grant.sql

but can't find any docs on how to do this with dbi...
Any help would be appreciated.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top