(imported comment written by brolly3391)
Hello Jason O,
If your registry values were all under the same key it becomes a lot easier to pull them all at once. Because your ultimate results are coming from 2 different places it complicates things but I think we can still get there.
I assume that there will be more than one machine1, instancename and dbname/databasename keys on the same machine so we cannot assume that all the values will be under the same subkey. This will take a very creative use of parenthesis grouping and it without whose inside of a massive tuple. I will show you each layer of the onion (thanks Shrek) as we go.
Copy these statements into the Relevance Debugger (QNA) and evaluate:
q: names of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
q: (name of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
q: (name of it, names of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
We used a tuple to marry a list with a single, now we can make that list a bunch of singles by adding another it without whose. Notice also that we are drilling down through the registry and retaining the names of each key as we go in our big tuple.
q: (name of it,(name of it) of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
and repeat the technique with the next level down.
q: (name of it,(name of it,names of keys of it) of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
q: (name of it,(name of it,(name of it) of keys of it) of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
A: machine1, ( instancename, databasename )
A: machine1, ( instancename, dbname )
That gets us down to the databasename/dbname level of key. We are almost there and we have retained the name of each level of keyname in our tuple. Now we need to add the values in the keys to our tuple.
q: (name of it,(name of it,(name of it,(values of it)) of keys of it) of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
But we need the value and the data and we need to use a it without whose again or we get bleedover in our tuple. Consider the results of these 2 statements:
q: (name of it,(name of it,(name of it,
(names of values of it,values of it)
) of keys of it) of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
A: machine1, ( instancename, ( databasename, ( db_buffers_hit_ratio, 83.12 ) ) )
A: machine1, ( instancename, ( databasename, ( db_buffers_hit_ratio, 99.11 ) ) )
A: machine1, ( instancename, ( databasename, ( data_dict_hit_ratio, 83.12 ) ) )
A: machine1, ( instancename, ( databasename, ( data_dict_hit_ratio, 99.11 ) ) )
A: machine1, ( instancename, ( dbname, ( sessions_highwater, 152 ) ) )
q: (name of it,(name of it,(name of it,
((name of it & " = " & it as string)of values of it)
) of keys of it) of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry
A: machine1, ( instancename, ( databasename, db_buffers_hit_ratio = 83.12 ) )
A: machine1, ( instancename, ( databasename, data_dict_hit_ratio = 99.11 ) )
A: machine1, ( instancename, ( dbname, sessions_highwater = 152 ) )
You see if we leave that list as a plural we get bleedover in our tuple and our results are not correct. So we used another level of it without whose to correct it. Now we just have to throw a grouping around that whole statement and massage our list with string processors to get the formatting you wanted with lots of following text of and preceding text of statements and concatenations.
q: ("Machine: " & preceding text of first ", ( " of it & " | Instance: " & (preceding text of first ", ( " of following text of first ", ( " of it) & " | Database: " & preceding text of first ", " of(following text of first ", ( " of following text of first “, ( " of it) & " | Properties: " & preceding text of first " ) )” of following text of first “,” of following text of first “,” of following text of first “,” of it) of (((name of it,(name of it,(name of it,((name of it & " = " & it as string)of values of it))of keys of it) of keys of it) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\EnterpriseClient\Settings\Client\DBInfo” of registry) as string)
A: Machine: machine1 | Instance: instancename | Database: databasename | Properties: db_buffers_hit_ratio = 83.12
A: Machine: machine1 | Instance: instancename | Database: databasename | Properties: data_dict_hit_ratio = 99.11
A: Machine: machine1 | Instance: instancename | Database: dbname | Properties: sessions_highwater = 152
This is pretty advanced use of relevance - Welcome to the next level!
Cheers,
Brolly