SQL in Progress me = noob

jimburnett

New Member
Hello, Jim from virginia here.

Long time programmer, noob to progress. My background is mainly in .NET/Linux/MYSQL/Web apps, but I am forced to use this wonderfull language( progress ).

Quick question for you all.

Can I run an SQL statement in a progress ( .p ) program and loop through the records? I searched for some docs and can't seem to find any examples.

Basically I want to:

select table.field, table.field2 from table;

for each row:
disaply table.field table.fiel2.
end

something to that effect...

FYI, not ODBC! I am talking about doing this in the old school unix editor...I think progress version 9 is on the box I am using..


Thanks ya'll!
 
The 4gl does have some support for SQL-89.

It is almost completely unused.

It is also deprecated.

Don't use it. You'll only end up unhappy. Use the 4gl:

Code:
for each table no-lock:
  display table.field1 table.field2 table.field3.
end.

Or, if you want to get fancy:

Code:
for each table no-lock where table.field1 = someValue:
  display table.field1 table.field2 table.field3.
end.
 
The big difference that you will notice between SQL and ABL is that SQL is set oriented and much of ABL is record oriented. You can do set oriented like things in ABL (check out OPEN QUERY), but even then it is very natural to walk through records one by one. Read about FOR EACH and REPEAT and OPEN QUERY to start.
 
Back
Top