Find an Answer
PQL includes 4 functions that determine case:
downcase(), lower() — Convert all characters in a string to lower case.
Both downcase() and lower() functions return a string or a tree, and take one parameter which is a string or a tree:
downcase():
string downcase(string input)
OR
tree downcase(tree input)
lower():
string lower(string input)
OR
tree lower(tree input)
Both downcase() and lower() functions return an output that is the same type as the input.
Both downcase() and lower() convert all characters in a string to lower case. Both functions take one parameter, and return the same type.
Query: Which devices have free disk space that is less than 1 GB?
SELECT downcase(systemname) FROM %free disk space% WHERE freespace < 1000000000 AND description = 'Local Fixed Disk'
Since the downcase() and lower() functions are interchangeable, they work in the same query:
SELECT lower(systemname) FROM %free disk space% WHERE freespace < 1000000000 AND description = 'Local Fixed Disk'
Both queries list all machines on the network that meet the criteria. The downcase() or lower() function is used to list the results in lower case.
Results: Depending on the database, this query returns results similar to this:
row
upper(systemname)
systemname laser
row
upper(systemname)
systemname sodium
row
upper(systemname)
systemname josh-vm-xp
. . .
upcase(), upper() — Convert all characters in a string to upper case.
The syntax for both upcase() and upper() functions is identical.
upcase():
string upcase(string input)
OR
tree upcase(tree input)
upper():
string upper(string input)
OR
tree upper(tree input)
Both upcase() and upper() functions return an output that is the same type as the input.
Both upcase() and upper() convertall characters in a string to upper case. Both functions take one parameter, and return the same type.
Example: Results in upper case
Query: Which devices have free disk space that is less than 1 GB?
SELECT upcase(systemname) FROM %free disk space% WHERE freespace < 1000000000 AND description = 'Local Fixed Disk'
Since the upcase() and upper() functions are interchangeable, they work in the same query:
SELECT upper(systemname) FROM %free disk space% WHERE freespace < 1000000000 AND description = 'Local Fixed Disk'
Both queries list all machines on the network that meet the criteria. The upcase() or upper() function is used to list the results in upper case.
Results: Depending on the database, this query returns results similar to this:
row
upper(systemname)
systemname LASER
row
upper(systemname)
systemname SODIUM
row
upper(systemname)
systemname JOSH-VM-XP
. . .
To see other PQL functions, see Functions.
Related topics