#1 2013-11-20 14:16:25

Antonio
Member
From: Porto Alegre - Brasil
Registered: 2013-03-26
Posts: 24
Website

ORM with Oracle

HI

I'm trying to create a model using ORM oracle, but all the examples I have seen are in SQLITE.

Procedure TServiceRemoteSQL.Cadastro (const aOp: integer; var fTableJSON: RawUTF8);

var
  Rec: TItens;
  Rows: ISQLDBRows;
  jItensFIS : TSQLTableJSON;
  vselect: string;
  Database: TSQLRestServer;
  l:integer;

Begin

 Database := TSQLRestServer.Create(aModel, true);

    Rec := TItens.Create;
    jItensFis:= TSQLTableJSON.Create([],s2U(vselect),fTableJSON);
    while jItensFis.Step do
    begin
      l:=1;
        Rec.empresa:= strtoInt(u2s(jItensFis.Get(l,0)));
        Rec.filial:= strtoInt(u2s(jItensFis.Get(l,1)));
       if Database.Add(Rec,true)<>0 then
          writeln(#10'Erro Inserindo.'#10);
      end;
end;

  

Offline

#2 2013-11-20 15:09:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,713
Website

Re: ORM with Oracle

You need to register the tables as external.

Offline

Board footer

Powered by FluxBB