-1

I've just written following erroneous ABL query:

FOR EACH T1 (WHERE T1.some-date = ' ')  AND 
            (integer(T1.num1) >= 100) AND 
            (integer(T1.num1) <= 200) AND 
            (T1.some-other-date = 01/12/2021) AND 
            (T2.Name = itsme), 
    EACH T2 WHERE T2.num2 = T1.num2 
    BY T1.num1

As you can see, this is wrong because I've put the first bracket in front of "WHERE" instead of behind it. In top of that, my name "itsme", is not put between quotes, so the ABL query will never work.

I've been looking in my development environment ("Tools" menu), but I couldn't find an ABL query tester. I've also checked the directory "C:\Progressx86\OpenEdge\bin", but being a newbie I didn't find anything.

I have downloaded the "DataDigger" application, which contains a so-called "MCF Query Tester", but this only works on single table and only checks criteria, not entire ABL queries.

Does anybody know where I can find an ABL query tester, first for syntax checking (the bracket in front of the "WHERE") and (if possible) for data testing (01/12/2021, is that January 12th or December 1st?)?

Thanks in advance
Dominique

Dominique
  • 16,450
  • 15
  • 56
  • 112
  • And since no one has mentioned it, once your query compiles you will need to read up on how indexes are selected and used. Your query, while probably just an example, will result in full table scans. – Stefan Drissen Jan 05 '21 at 22:20
  • Your title states "Progress Developer Studio for OpenEdge" - this is the Eclipse based development environment (which does contain an AppBuilder perspective), but your answers to the scatchpad answer and your own answer seem to indicate that you are NOT using PDSOE but the old OpenEdge Studio. – Stefan Drissen Jan 07 '21 at 09:49

5 Answers5

1

Create a new OpenEdge project in Progress Developer Studio for Openedge. Create a new ABL procedure under the project with the necessary database connection. Copy the above ABL code into the procedure file and you should be able to see the errors and warnings in your procedure file.

enter image description here

Austin
  • 1,237
  • 1
  • 11
  • 22
1

The ABL Scratch Pad view of Progress Developer Studio allows to execute ad-hoc queries.

https://knowledgebase.progress.com/articles/Knowledge/000055088

Mike Fechner
  • 6,627
  • 15
  • 17
  • And how to I launch this? I've launched "C:\Progressx86\OpenEdge\bin\prowin32.exe", this opened the full version of the procedure editor, but this doesn't contain a "VIEW" menu. – Dominique Jan 06 '21 at 12:13
  • In top of this, the URL mentions that the Scratch Pad is usable for releases 11.2, 11.3 and 11.4, while I'm working with 11.6. (Either this URL was written before 11.6 even existed or release 11.6 does not cover this feature anymore.) – Dominique Jan 06 '21 at 12:19
  • It's certainly.still there in 11.6 and beyond. – Mike Fechner Jan 06 '21 at 23:02
0

You don't mention which editor you're using, but in general terms, the ABL COMPILE statement performs syntax checking. There's no separate/independent executable that compiles/checks syntax. Generally you'll need to write a .P to perform the compilation.

You can use the PCTCompile Ant task if you'd like to use an Ant- or Gradle-based build system.

As to date formats, I thought that was in the doc, but no. Dates always have a MM/DD/YYYY format when hard-coded; decimals always use a . decimal separator (ie 123.45) when hard-coded.

nwahmaet
  • 3,589
  • 3
  • 28
  • 35
0

Another way to test a query you're working on would be to use query-prepare which accepts a string.

DEFINE QUERY q-Test FOR T1, T2. 
QUERY q-test:HANDLE:QUERY-PREPARE("your query string here").
Tim Kuehn
  • 3,201
  • 1
  • 17
  • 23
-1

One of my colleagues showed me an incredible easy solution:

Copy the query in a separate procedure window and add the results you want to see, something like this:

FOR EACH T1 (WHERE T1.some-date = ' ')  AND 
            (integer(T1.num1) >= 100) AND 
            (integer(T1.num1) <= 200) AND 
            (T1.some-other-date = 01/12/2021) AND 
            (T2.Name = itsme), 
    EACH T2 WHERE T2.num2 = T1.num2 
    BY T1.num1

/* To be added for viewing results */
DISPLAY T1.Field1 T1.Field2 T2.Field5
END.

And launch this inside the programming environment (F2).
In case of syntax mistakes, the compiler shows the errors. In case the syntax is correct, a pop-up window is started, showing the results.

Dominique
  • 16,450
  • 15
  • 56
  • 112