![]() ![]() ti3 file and it also creates an ICC profile for the display. How to manipulate the value returned from a RPG pr.Click to expand.Once you have taken the measurements, Displa圜AL records the measurement data in a.Two new control option to help with awkward numbers.List all of objects that are being journaled by a.List journal inheritance rules with SQL.This article was written for IBM i 7.4 TR3 and 7.3 TR9. You can learn more about the DATA_QUEUE_ENTRIES SQL table function from the IBM website here. If you work in an environment that uses data queues you are going to find this SQL table function very useful for analyzing the data within them. If I want to see the first entry in the data queue I can use the SELECTION_TYPE parameter:Ġ1 SELECT MESSAGE_DATA,MESSAGE_ENQUEUE_TIMESTAMPĠ2 FROM TABLE(QSYS2.DATA_QUEUE_ENTRIES('TESTDTAQ',īy changing the selection type to “ LAST" I can get the most recent addition to the data queue: I ran the program that contains the SEND_DATA_QUEUE SQL procedure again to add another 10 entries on a different day.Ġ1 SELECT DATE(MESSAGE_ENQUEUE_TIMESTAMP) AS "Entered date",Ġ3 FROM TABLE(QSYS2.DATA_QUEUE_ENTRIES('TESTDTAQ'))Ġ4 GROUP BY DATE(MESSAGE_ENQUEUE_TIMESTAMP) I can get a break down of the number of entries by date. I can get a count of how many entries there are in my data queue:įROM TABLE(QSYS2.DATA_QUEUE_ENTRIES('TESTDTAQ')) What else can I do with this table function? With that information I can substring the subfields out of the MESSAGE_DATA column:Ġ3 CAST(SUBSTR(MESSAGE_DATA,1,7) AS NUMERIC(7,0))Ġ5 SUBSTR(MESSAGE_DATA,14,20) AS "FIELD2",Ġ6 SUBSTR(MESSAGE_DATA,34,20) AS "FIELD3"Ġ7 FROM TABLE(QSYS2.DATA_QUEUE_ENTRIES('TESTDTAQ')) The data structure I used to aggregate the data I output to the data queue looks like: The ENTERED_TIME is all the same timestamp value as the SEND_DATA_QUEUE SQL procedure was so fast it added all of these entries to the data queue in the same time. The dots at the end of the MESSAGE_DATA column denote that this column (64,512 characters) is larger than is shown here. MESSAGE_ENQUEUE_TIMESTAMP: Data and time the entry was added to the data queue.This is in a CLOB which is 64,512 characters MESSAGE_DATA: The data for the entry in character format.ORDINAL_POSITIONS: Calculated, relative position in the results.This statement includes everything I am interested in.Ġ3 MESSAGE_ENQUEUE_TIMESTAMP AS "ENTERED TIME"Ġ4 FROM TABLE(QSYS2.DATA_QUEUE_ENTRIES('TESTDTAQ') ![]() Some of columns in the results I am not interested in for my data queue, and I am going to exclude them from my examples. SELECT * FROM TABLE(QSYS2.DATA_QUEUE_ENTRIES('TESTDTAQ')) Īll three of these statements return the same results. SELECT * FROM TABLE(QSYS2.DATA_QUEUE_ENTRIES('TESTDTAQ','*LIBL')) SELECT * FROM TABLE(QSYS2.DATA_QUEUE_ENTRIES( Using the new DATA_QUEUE_ENTRIES table function I can show the contents of the data area with the following statement: I used the SEND_DATA_QUEUE SQL procedure to add 10 entries to my data queue. I have my data queue TESTDTAQ in my library MYLIB. All the data queues I have created and used have been FIFO types ones, and that is what I am going to use in these examples. I confess that I have never knowingly used and have never created a keyed data queue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |