Hi,
I’ve faced with a strange issue. I’m trying to compose a table based on SQL query. I added some variables and everything works great. But I need to add All value. I customized it as % and it also works, but for some reason all other options in the same variable stop working. I mean, if I chose All the table is populated, but if I chose anything else it returns nothing.
I tested query itself by putting values directly without any variables and it works.
My variable is
Query is
SELECT hsts.hostid as ‘ID’,
hsts.name as ‘HOSTNAME’,
intf.ip as ‘IP’,
grps.groupid as ‘GROUPID’,
grps.name as ‘GROUP’,
inv.type as ‘TYPE’,
inv.vendor as ‘VENDOR’,
inv.type_full as ‘LOC_TYPE’,
inv.serialno_a as ‘SN’,
inv.location as ‘LOCATION’,
inv.notes as ‘NOTES’,
inv.model as ‘MODEL’,
inv.contract_number as ‘CONTACT’,
inv.site_address_a as ‘ADDRESS’,
inv.site_city as ‘CITY’,
inv.site_state as ‘STATE’,
inv.site_country as ‘COUNTRY’,
inv.site_zip as ‘ZIP’
FROM hosts as hsts
INNER JOIN host_inventory as inv
ON hsts.hostid = inv.hostid
INNER JOIN hosts_groups as hst2grp
ON hsts.hostid = hst2grp.hostid
INNER JOIN hstgrp as grps
ON hst2grp.groupid = grps.groupid
INNER JOIN interface as intf
ON hsts.hostid = intf.hostid
WHERE 1=1
AND inv.vendor LIKE “$vendor”
;