Return SQL query with more than one record in variables

ZeProgress

New Member
Hello, my name is José Augusto and I'm from Brazil.
I began studies with SQL in the progress, and wonders how I can save the result of a SQL query in a variable or temp-table. For example, now can save a single field in one variable, but returns when more than one record, or when I try to put more than one field returns me errors.

Works well for a record:
Code:
def var wltxt   as cha no-undo.
select campo1 into wltxt from tabela where tabela.campo1 = "123".
disp wltxt format "x(30)".

Thank you,

José Augusto Freire
 

Casper

ProgressTalk.com Moderator
Staff member
You should not use SQL in the editor. This is an old deprecated feature. (In fact this is sql89).
If you want to use SQL then configure a secondary broker and use a sql92 client through ODBC/JDBC.
There are many examples in this forum and in the KB how to do this.

Casper.
 
Top