Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Query selection

81 views
Skip to first unread message

Brian Speirs

unread,
Jan 26, 2023, 8:21:08 PM1/26/23
to OpenQM
Hi,

I have an intriguing situation - not really a problem because I know how to fix it - just a situation where I don't know why one solution works but another doesn't.

I have a dictionary item calling a subroutine. That subroutine returns 0 or 1 (@TRUE or @FALSE). Running a query against the file may or may not return the right data, depending on whether I quote the test values:

  LIST SURV.FX WITH ISCURRENT EQ "1" ISCURRENT
vs
  LIST SURV.FX WITH ISCURRENT EQ 1 ISCURRENT

The first query returns the correct data. The second says "0 record(s) listed". Listing the file without any selection shows the ISCURRENT dictionary returning 0 or 1 on all items.

Why does the test value need to be quoted here, when other queries don't require quoting?

The dictionary item is fairly minimal:

  DICT SURV.FX ISCURRENT
  01: I
  02: SUBR("SFX.ISCURRENT")
  03:
  04: Current
  05: 5L
  06: S

Changing the justification to right makes no difference. Likewise adding a conversion.

In contrast, I can run this query without quotes with no problems:

  LIST SURV.FX WITH AREA.TOTAL BETWEEN 100 200 AREA.TOTAL

In this case, the dictionary looks like this:

DICT SURV.FX AREA.TOTAL
  1: D
  2: 19
  3: MR0Z,
  4: Area Total
  5: 9R
  6: S

Does the fact that one is an I-type while the other is a D-type make any difference? I wouldn't expect so, but things don't always work the way that I expect ...

Does anyone have any ideas?

Cheers,

Brian

MAV

unread,
Jan 27, 2023, 3:13:50 AM1/27/23
to OpenQM
Hi,

Surprising and interesting. The truth is that I always use quotation marks.

Marcos Alonso Vega
INGESCO Sistemas Informáticos

Martin Phillips

unread,
Jan 27, 2023, 4:33:30 AM1/27/23
to ope...@googlegroups.com

My guess is that there is a dictionary item named "1" which takes priority over the unquoted literal when parsing the query. It is therefore comparing the wrong things in the EQ test.

 

Martin

 

From: ope...@googlegroups.com <ope...@googlegroups.com> On Behalf Of MAV
Sent: 27 January 2023 08:14
To: OpenQM <ope...@googlegroups.com>
Subject: Re: Query selection

 

EXTERNAL EMAIL




--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openqm+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openqm/fdf6b7ed-9784-4bba-ad0c-5f50257b5c9an%40googlegroups.com.

================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support: https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================

This communication and any attachments may contain confidential information of Rocket Software, Inc. All unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please notify Rocket Software immediately and destroy all copies of this communication. Thank you.

Brian Speirs

unread,
Jan 27, 2023, 7:54:07 PM1/27/23
to OpenQM
Good call! That is exactly the case!

This is one of those ancient files we have that has been migrated through numerous versions of PICK through UniVerse to OpenQM, and numeric dictionary names were common. Even though those names have been replaced by proper names, the numeric ids have been retained to keep historic queries running. Perhaps it is time to purge them for good.

Thanks,

Brian
Reply all
Reply to author
Forward
0 new messages