#1 Re: mORMot 1 » Need help for post a json in a Body » 2024-09-09 00:59:03

 TCar = class(TSynAutoCreateFields)
  private
    FCOD_CAR        : RawUTF8;
    FDESCRICAO      : RawUTF8;
 published
    property COD_PRO          :RawUTF8 read FCOD_PRO       write FCOD_PRO;
    property DESCRICAO        :RawUTF8 read FDESCRICAO     write FDESCRICAO;
 end;
 TACar = array of TCar;
  
Function TServer.Teste(const pEmpresa: string; var aCar: TACar):RawJson;
Begin
  result := pEmpresa;
end;
 

#2 Re: mORMot 2 » New AI assistant to help with mORMot » 2024-09-08 00:13:52

I built a complete server in mormot2 with JWT authentication using ChatGPT-4. We interacted, exchanging information until we found a solution. ChatGPT did 80% of the work.

#3 Re: mORMot 2 » TSqlDBZeosConnectionPropertiesnot found? » 2024-08-31 00:16:53

Yes, but when I undefine NOSYNDBZEOS in the package, it doesn't work.

#4 Re: mORMot 2 » TSqlDBZeosConnectionPropertiesnot found? » 2024-08-29 22:27:00

Any solution? I have the same error, using PerfTestCases. I was only able to use it by adding mormot.db.sql.zeos to my project.

#5 Re: mORMot 2 » mormot implemeting RefreshToken » 2024-08-25 00:58:10

I managed to implement JWT authentication with GetToken and RefreshToken, using Mormot2.

#7 Re: mORMot 1 » Audit Trail » 2016-11-10 21:21:43

Hi AB,


I did not find examples of using the audit trail, nor in the forum.

The example I made was based on item 5.9.2 of the documentation.

Sorry for my ignorance, but how do I check with the regression test?

#8 mORMot 1 » Audit Trail » 2016-11-10 18:53:11

Antonio
Replies: 2

I tried to use the audit trail but it did not work.

Does not return anything, although there are records in the history table

See my code

  aOrcamento := TOrmerc_Orcamento.Create;
  aHist := TSQLRecordHistory.CreateHistory(aClient,TOrMerc_Orcamento,1);
      aHist.HistoryGet(i,aEvent,aTimeStamp,aOrcamento);
  try
    memo1.Lines.Add('Number of items in the record history: '+inttostr(aHist.HistoryCount));
    for i := 0 to aHist.HistoryCount-1 do begin
      memo1.Lines.Add('Event: '+GetEnumName(TypeInfo(TSQLHistoryEvent),ord(aEvent))^);
      memo1.Lines.Add('TimeStamp: '+TTimeLogBits(aTimeStamp).i18nText );
      memo1.Lines.Add('Value: '+aOrcamento.GetJSONValues(true,true,soSelect));
    end;
  finally
    aHist.Free;
    aOrcamento.Free;
  end;

#9 Re: Source Code repository » mORMoti18n Menus.dcu File not found DXE5 » 2014-09-16 16:58:00

I use XE5, but also tested in XE4 and XE2.

If you open the example Project04Server and add mormoti18n in uses, will give the error.

#10 Re: Source Code repository » mORMoti18n Menus.dcu File not found DXE5 » 2014-09-15 22:11:44

Yes, the problem happens when I use mormoti18n a server type, as in Project04Server program.

To resolve I needed to put vcl.menus.

#11 Source Code repository » mORMoti18n Menus.dcu File not found DXE5 » 2014-09-13 00:10:59

Antonio
Replies: 4

Hi,

I'm trying to compile the dxe5 and I can not.

"mORMoti18n Menus.dcu File not found"

I use  DXE5.

Thanks

#12 Re: mORMot 1 » Firebird connectivity using TODBCConnectionProperties » 2014-07-19 15:08:46

Hi,

This routine does not work with delphi xe5 + Android. I had to change.

begin
  if C=nil then
    result := '' else begin
    result := C.ClassName;
    if IdemPropName(copy(result,1,4),'TSQL') then
      if IdemPropName(copy(result,5,6),'Record') then
        delete(result,1,10) else
        delete(result,1,4) else
      if result[1]<>'T' then
        delete(result,1,1);
  end;
end;
---------------------- NEW ------------------
function GetDisplayNameFromClass(C: TClass): string;
begin
  if C=nil then
    result := '' else begin
    result := C.ClassName;
    if IdemPropName(copy(result,1,4),'TSQL') then
      if IdemPropName(copy(result,5,6),'Record') then
        delete(result,1,10) else
        delete(result,1,4) else
      if result[1]='T' then
        delete(result,1,1);
  end;
end;

#13 Re: mORMot 1 » Access Violation Delphi XE 5 - Project 02 » 2014-06-06 17:55:52

I had the same problem in XE4

But the problem was even 3.8.5. Obj files

Thanks

#14 mORMot 1 » Access Violation Delphi XE 5 - Project 02 » 2014-06-06 17:03:58

Antonio
Replies: 2

Hi,

When I execute the project 02 gives error.

The error also happens in another projects in the Routine Create Missing Tables.

I use sqlite.

Thanks

#15 mORMot 1 » ORM with Oracle » 2013-11-20 14:16:25

Antonio
Replies: 1

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;

  

#16 Re: Source Code repository » How to get the source code in its latest version? » 2013-05-22 20:21:27

I found this error and do not know where to report!

procedure TSQLRecordProperties.RegisterCustomRTTIRecordProperty(aTable: TClass;
  aRecordInfo: PTypeInfo; const aName: RawUTF8;  aPropertyPointer: pointer;
  aAttributes: TSQLPropInfoAttributes=[]; aFieldWidth: integer=0;
  aData2Text: TOnSQLPropInfoRecord2Text=nil;
  aText2Data: TOnSQLPropInfoRecord2Data=nil);
begin
  Fields.Add(aTable,TSQLPropInfoRecordRTTI.Create(aRecordInfo,aName,Fields.Count,
    aPropertyPointer,aAttributes,aFieldWidth,aData2Text,aText2Data),); <----- 
end;

#17 Re: mORMot 1 » Code integration / ORM » 2013-03-28 14:25:58

Yes, I know, but I refer to the program perMain, he has the two uses and makes two calls, however, I don't know when his use one or the other, would have to analyze the logic of it.

I'm trying to create a server that connects to oracle and publish classes  by http

#18 Re: mORMot 1 » Code integration / ORM » 2013-03-27 19:30:26

Well, I think I'm not using ODBC, now I'm confused, I have the client installed and when I run the program, i use the parameters of the client.

You're right, but do not know how to configure the program to not use ODBC.

#19 Re: mORMot 1 » Code integration / ORM » 2013-03-27 19:14:22

Oracle 11g XE has changed the way it treats the NLS_LANG, I had several problems with Delphi applications (Note that I only use Delphi applications).

My language is BRAZILIAN PORTUGUESE_BRAZIL.WE8MSWIN1252

Then I tried with BRAZILIAN PORTUGUESE_BRAZIL.AL32UTF8 (This is the language of my oracle server) and repeated the error invalid number

And finally with american_america.AL32UTF8 and the result was

First chance exception at $ 7645C41F. Exception class EODBCException with message
'[IM002] [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified (0)'.
PerfTest.exe Process (5824)

You thought of some other language?

#20 Re: mORMot 1 » Code integration / ORM » 2013-03-27 16:42:06

When I run   "15 - External DB performance" I got the following msg:

"First chance exception at $7645C41F. Exception class ESQLDBOracle with message 'ORA-01722: número inválido'. Process PerfTest.exe (5028)"

When I run "16 - Execute SQL via services", I used a "SELECT * FROM TABLE", and TABLE contained a numeric field with a comma, the grid shifted one column.

thanks

#21 Re: mORMot 1 » Code integration / ORM » 2013-03-27 15:58:30

I read all the "Framework Synopse mORMot SAD 1.18", compiled and tested all examples, however, do not have exactly what I want.

Actually, you're right, after reading all that I read, I am able to build what I want, but I wanted something done, like copy and paste ... hehehe

The examples are not in Oracle, so it's a little different.

I'm out of time ...

I'll use a server Oracle database with http protocol and a thin client written in delphi.

I appreciate your prompt service, I am now beginning to develop with this framework, soon I hope to contribute to the community.

hugs

#22 Re: mORMot 1 » Code integration / ORM » 2013-03-27 14:40:37

I have a system written in Delphi with Oracle and need to add new functionality, web access, access via smartphone, so I decided to re-write a new approach, using ORM and SOA.

There are no examples of CRUD on an entity table with oracle.

I managed to connect to the server, passing objects, but to make a CRUD a table yet.

Does anyone have a simple example to add, change and delete a registry basics, using mORMot?

thank you

#23 Re: mORMot 1 » Code integration / ORM » 2013-03-27 14:23:19

Sorry,

my english is very poor, so I summarize.

Follow the error:

  People := TSQLPeople.Create;
  try
    People.Name := 'Smith';
    People.Address := 'New York City';
    People.BirthDate := Now;
    ID := Client.Add(People);
  finally
    People.Free;

Checking project dependencies...
Compiling PrjCad.dproj (Debug, Win32)
[DCC Error] Ucad.pas(157): E2003 Undeclared identifier: 'Client'
[DCC Error] Ucad.pas(68): E2065 Unsatisfied forward or external declaration: 'TMainForm.Execute'
[DCC Fatal Error] PrjCad.dpr(5): F2063 Could not compile used unit 'Ucad.pas'
Failed
Elapsed time: 00:00:00.2

Yes, i'am using latest 1.18 unstable version of the framework

/// Virtual Tables for external DB access for mORMot
// - this unit is a part of the freeware Synopse mORMot framework,
// licensed under a MPL/GPL/LGPL tri-license; version 1.18

Thanks

#24 Re: mORMot 1 » Code integration / ORM » 2013-03-27 13:03:21

Hi,

Where is this client in line?

  ID: = Client.Add (People);

In delphi XE2 gives error!

thanks

Board footer

Powered by FluxBB