UNSUBSCRIBE

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UNSUBSCRIBE

Christine Ross
UNSUBSCRIBE
 
Sent: Friday, November 10, 2017 at 11:49 AM
From: gpatrick <[hidden email]>
To: [hidden email]
Subject: [Ibm-netrexx] String is being printed explicitly
# java jdbc show cpu
Loading Postgres driver classes....
CPUREC
------
01-timestamp 05-system 09-softirq
02-cpuid 06-idle 10-iowait
03-user 07-total 11-steal
04-nice 08-irq
Enter the records to view:
04 05 07
RECORDS TO PROCESS ARE: nice, system, total
QUERY STRING IS: rs.getString('nice') rs.getString('system')
rs.getString('total')
Connecting to: jdbc:postgresql:sdr
Creating query...
Executing query:
SELECT nice, system, total FROM cpurec
Results:
rs.getString('nice') rs.getString('system') rs.getString('total')
rs.getString('nice') rs.getString('system') rs.getString('total')
rs.getString('nice') rs.getString('system') rs.getString('total')

Here is the code:
method show(url=String,record=String,name=String) static
do
select
when record = "cpu" then do
sdr_table = "cpurec"
say "CPUREC"
say "------"
say "01-timestamp 05-system 09-softirq"
say "02-cpuid 06-idle 10-iowait"
say "03-user 07-total 11-steal"
say "04-nice 08-irq"
c=''
qry_string=''
cpu_values='timestamp cpuid user nice system idle total irq softirq
iowait steal'
cpu_keys='01 02 03 04 05 06 07 08 09 10 11'
kcopy=cpu_keys
k=''
v=''
value='unknown'
loop i=1 by 1 while kcopy>''
parse kcopy ki kcopy; k[i]=ki
parse cpu_values vi cpu_values; v[i]=vi
end
loop j=1 to i-1
value[k[j]]=v[j]
end
say "Enter the records to view:"
parse ask z
loop while z <> ''
parse z y z
if c='' then c=value[y]
else c=c', 'value[y]
qry_string=qry_string||"rs.getString('"value[y]"') "
qry_string.strip('B','"')
end
say "RECORDS TO PROCESS ARE:" c
say "QUERY STRING IS:" qry_string
end

Farther down in my SQL statement I use:
loop row=0 while rs.next()
--say rs.getString('timestamp') rs.getString('cpuid')
say qry_string
end


Above the qry_string shows "rs.getString('nice') rs.getString('system')
rs.getString('total')" which is what I want, but as it shows it is actually
printing that string. If I hard code (from the --comment line in the loop)
that it will print what I expect from the database.

Why is qry_string printing the actual string?







--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=jWdymkoTVz-znCx1zR_PBZMqO1TzCG3AJwuC8TgPp48&s=sQCs3FlLLhpJ_CJYX2iDbh67LCMjoMW9dwTBSOIlE7Q&e=

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
 

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: UNSUBSCRIBE

ThSITC
Hi Patrick vulgo Cristine Ross.

I think it is too EARLY to UNSUBSCRIBE :-( :-( :-(

I am still trying to find out where Your problem *might be* ;-) ;-)

I do have, however, currently NO POSTGRES installed, but did find
Your NetRexx Script quite ambitious ....

Contact me directly please when You do have still open issues.

Kindly, Thomas Schneider, Vienna, Austria.
======================================================================================
Am 21.11.2017 um 13:16 schrieb Christine Ross:
UNSUBSCRIBE
 
Sent: Friday, November 10, 2017 at 11:49 AM
From: gpatrick [hidden email]
To: [hidden email]
Subject: [Ibm-netrexx] String is being printed explicitly
# java jdbc show cpu
Loading Postgres driver classes....
CPUREC
------
01-timestamp 05-system 09-softirq
02-cpuid 06-idle 10-iowait
03-user 07-total 11-steal
04-nice 08-irq
Enter the records to view:
04 05 07
RECORDS TO PROCESS ARE: nice, system, total
QUERY STRING IS: rs.getString('nice') rs.getString('system')
rs.getString('total')
Connecting to: jdbc:postgresql:sdr
Creating query...
Executing query:
SELECT nice, system, total FROM cpurec
Results:
rs.getString('nice') rs.getString('system') rs.getString('total')
rs.getString('nice') rs.getString('system') rs.getString('total')
rs.getString('nice') rs.getString('system') rs.getString('total')

Here is the code:
method show(url=String,record=String,name=String) static
do
select
when record = "cpu" then do
sdr_table = "cpurec"
say "CPUREC"
say "------"
say "01-timestamp 05-system 09-softirq"
say "02-cpuid 06-idle 10-iowait"
say "03-user 07-total 11-steal"
say "04-nice 08-irq"
c=''
qry_string=''
cpu_values='timestamp cpuid user nice system idle total irq softirq
iowait steal'
cpu_keys='01 02 03 04 05 06 07 08 09 10 11'
kcopy=cpu_keys
k=''
v=''
value='unknown'
loop i=1 by 1 while kcopy>''
parse kcopy ki kcopy; k[i]=ki
parse cpu_values vi cpu_values; v[i]=vi
end
loop j=1 to i-1
value[k[j]]=v[j]
end
say "Enter the records to view:"
parse ask z
loop while z <> ''
parse z y z
if c='' then c=value[y]
else c=c', 'value[y]
qry_string=qry_string||"rs.getString('"value[y]"') "
qry_string.strip('B','"')
end
say "RECORDS TO PROCESS ARE:" c
say "QUERY STRING IS:" qry_string
end

Farther down in my SQL statement I use:
loop row=0 while rs.next()
--say rs.getString('timestamp') rs.getString('cpuid')
say qry_string
end


Above the qry_string shows "rs.getString('nice') rs.getString('system')
rs.getString('total')" which is what I want, but as it shows it is actually
printing that string. If I hard code (from the --comment line in the loop)
that it will print what I expect from the database.

Why is qry_string printing the actual string?







--
Sent from: https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=jWdymkoTVz-znCx1zR_PBZMqO1TzCG3AJwuC8TgPp48&s=sQCs3FlLLhpJ_CJYX2iDbh67LCMjoMW9dwTBSOIlE7Q&e=

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
 


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com