Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

Native SQL with a 'WITH

$
0
0

I am trying to get a system related info from the Database server and I know that this query works when executed by itself. Now, I am trying to execute this in my program. But i am unable to capture the output in a variable lv_pagesteal which I have declared as a char10. I am not sure if I am putting the 'into :lv_pagesteal' at the right place in the code.. I am getting a DBIF_DSQL2_SQL_ERROR . I copied the same code into ST04, native sql command line without the 'into :lv_pagesteal'. This works fine and I get the % Steals..

 

 

I am trying to capture % Page Steals information from the Database server.

 

data : lv_pagesteal(10).
exec sql.
with dbsnap as
(
select
float(pool_drty_pg_steal_clns) as pg_steal,
pool_drty_pg_steal_clns +  pool_drty_pg_thrsh_clns + pool_lsn_gap_clns  as total_clns
from
table(snap_get_db_v97(CAST (NULL AS VARCHAR(128)),-2))
)
select dec((pg_steal / nullif(total_clns,0))*100,5,2) as "% Steals"
into :lv_pagesteal
from dbsnap
endexec.

Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>