Q14680 is a WIMS utility that transfers WIMS data to another database (data warehouse). It is typically used to transfer multiple facility data values to a single database for rollup reporting etc...
A JDATA table must exist in the destination database:
[FACILID] [nchar](10) NULL,
[VARNUM] [numeric](18, 0) NULL,
[LOCATION] [nvarchar](500) NULL,
[NAME] [nchar](50) NULL,
[VARTYPE] [nvarchar](1) NULL,
[GLOBALUD1] [nchar](50) NULL,
[DATESTAMP] [datetime] NULL,
[CURVALUE] [float] NULL,
[TEXTVALUE] [nvarchar](255) NULL,
[UNITS] [nchar](20) NULL
) ON [PRIMARY]
The tool loops thru the WIMS Facility list as defined by Source Facility Query and runs the following query against the daily data table.
SELECT 'OPSWWTUTOR' AS FACILID,VARNUM,PATH,NAME,VARTYPE, UNITS,GLOBALUD1,DATESTAMP,CURVALUE,TEXTVALUE
FROM DATATBL,VARDESC LEFT OUTER JOIN LOCATION ON VARDESC.LOCID=LOCATION.LOCID
WHERE DATATBL.VARID=VARDESC.VARID AND DATESTAMP >= '2021-09-01' AND DATESTAMP <= '2021-09-07'
ORDER BY VARNUM, DATESTAMP