×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 14-Jul-2016 17:25 -0500, Troy Hyde wrote:
One of our web programmers is creating a page that contains among
other things, a description of printers including the IP address. She
has been able to obtain all of the information she needs via SQL
except the IP address.
What SQL is currently being used to provide the information about
printer devices; i.e. what invocation provides the DEVD information
without including the IP address?
I can write an SQL function for her using the Retrieve Device
Description (QDCRDEVD) API. However, IBM has been giving us more and
more of this information with their own tables/views/functions etc.
Seems prudent to just write what might be needed, with possible value
for reuse; should be quite trivial as a scalar User Defined Function
(UDF). Seems silly to just /wait for IBM/ to give more.
But if waiting is preferable, consider composing an RFE asking for
that device-specific DB2 for i /system service/ tooling to be updated to
include that additional information; I am unaware such tooling even
exists, and I see nothing alluding to such a feature [no User Defined
Table Function (UDTF)] described in any Technology Updates in the DB2
for i section for their provided /services/, on DeveloperWorks.
Does anyone know if this information is available with pure SQL
skipping the api? I don't want to reinvent the wheel. Eg. "select
ip_address from qsys2/qdprtnfo where specific_device = myprinter"
I ask, though I doubt; Is that the table-reference already being used
for the current request?
I presume more likely, is that the currently composed SQL is taking
advantage of the OBJECT_STATISTICS UDTF and is merely generic presenting
the available object information, i.e. there is no type-specific
information being produced by the service being used, at least none that
is specific for the Device Description object-types.
I expect most likely, that any /answers/ about avoiding reinvention
will come from other than IBM, in the form of an example of using APIs
to [optionally] list and extract printer devices and their
device-specific information, possibly to include a SQL UDTF wrapper to
obtain the information from via the SQL. Lacking actual responses,
searches might best be agnostic with regard to device type; i.e. not
limited to printer devices, as examples obtaining a similar effect of
list\extract for other Device Description types might exist, and
changing to get the IP for printers would be trivial.
FWiW, several years ago I wrote a Quick&Dirty [likely using constants
as offsets, something not to be used as a model, merely exhibiting an
/as-possible/] purely SQL interface to the QDCRDEVD for obtaining Remote
Location data which apparently was IP address. An External HLL routine
implementing the scalar function would be most appropriate.
[
https://groups.google.com/d/msg/comp.sys.ibm.as400.misc/iMRqK9PKUT0/ey9SSVf20VQJ]
As an Amazon Associate we earn from qualifying purchases.