How to run more than one query in Delphi Seatle in Firedac’s Fdquery using oracle?

Asked

Viewed 214 times

1

Using Sqlserver it is possible to run the following two queries within the same firedac Fdquery

       FDQuery.FetchOptions.AutoClose := False;

       FDQuery.sql.add('select * from tabela1');

       FDQuery.sql.add('select * from tabela2');

       FDQuery.open;

       MemTable1.Data := FDQuery.Data;

       FDQuery.NextRecordSet();

       MemTable2.Data := FDQuery.Data;

All right on Sqlserver but, someone knows how to run on Oracle?

Executing in this way:

begin
  select * from usuario;
  select * from mercadoria;
end;

this error occurs:

---------------------------
[FireDAC][Phys][Ora] ORA-06550: linha 2, coluna 3:
PLS-00428: an INTO clause is expected in this SELECT statement
ORA-06550: linha 3, coluna 3:
PLS-00428: an INTO clause is expected in this SELECT statement.
---------------------------

in this way:

select * from usuario;
select * from mercadoria;

this Error occurs:


[Firedac][Phys][Ora] ORA-00911: invalid character.

  • Running the way it is, some trouble?

  • Yes. In the documentation there is a quote for execution on Oracle stating that it needs to be executed with anonymous block but the simple block with Begin "commands"; end; is not recognized.

  • Put a ; behind each select and run to see. Fdquery.sql.add('select * from Tabela1;'); Fdquery.sql.add('select * from table2;');

  • I already tried! Invalid character error.

  • Question: what is the problem when it comes to consulting

  • I edited with errors!

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.