Conversion Ado to DOA

giorgio

Member
Hi, my name is Giorgio Marino and I write from Italy.
I used until now Ado with oracle with delphi5 enterprice
and I want to change with DOA.
I have some question about your program:

1-Execute the Function:
In Ado I use the component TADOSTORPROC and I do this:
with fmagic.stort_ltrich do begin
Parameters.ParamValues['NUM_RICH'] := num_rich
Parameters.ParamValues['ANAG_ID'] := idanag;
Parameters.ParamValues['CODICE'] := codice;
try
// invoke stored proc
ExecProc;
except
on e: exception do
err := e.message;
end;
num_rich := Parameters.ParamValues['RETURN_VALUE'];
end;

How I can do with your software ?

2-Query with parameters:

In ado I use:
with qtabella, sql do begin
Close;
sql.Clear;

Add('SELECT * FROM '+tabella+' WHERE '+nomecampodacercare1+' = (:CODICE) AND

'+nomecampodacercare2);
if length(ordine) 0 then
Add(' ORDER BY '+ordine);
Parameters.ParamValues['CODICE'] := campodacercare;
try
qtabella.open;
except
on e: exception do
begin
errmsg := e.message;
end;
end;
end;

How I can do with your software ?

Thank's for Help
Giorgio Marino
 
1-Execute the Function

See this FAQ .

2-Query with parameters

In Direct Oracle Access you need to use the Variables. At run-time you can use DeclareVariable and SetVariable, for example:
Code:
with MyDataSet do
begin
  DeleteVariables;
  SQL.Text := 'select * from emp where deptno = :v_deptno';
  DeclareVariable('v_deptno', otInteger);
  SetVariable('v_deptno', 20);
  Open;
end;

------------------
Marco Kalter
Allround Automations
 
Back
Top