#1 Re: mORMot 1 » How to use ManyDelete and BatchDelete together » 2012-08-19 10:15:58

Hello,

I am also curious to the answer on the question above.

in code below, a cascaded delete as defined in the database does not work...

      bRC:=Database.Delete(TSQLPatients, iID);

While when deleting the record in a database tool, the cascaded delete works fine... how come?

Regards,
Maurijn

#2 Re: mORMot 1 » Insert with using Database.ExecuteList([], sSQL); » 2012-08-19 09:57:40

It now suddenly works... :-)
Possibly because I downloaded the newest version of the framework...

#3 Re: mORMot 1 » Insert with using Database.ExecuteList([], sSQL); » 2012-08-17 16:19:18

Hi again,

I was trying to think ORM and did what you write above: Database.Add(aPatientAppointements)...

But then an error occured: unrecognized token: "{"

any idea what this error causes?

#4 mORMot 1 » Insert with using Database.ExecuteList([], sSQL); » 2012-08-16 23:01:57

mvddoes
Replies: 4

Hello,

I am trying to insert 2 values in a table with 2 columns (+ ID). The columns where the values are to be stored do both have a foreign key relation; both to some other table.

Why does the code below not work?

        in declaration: data: TSQLTable;

        sSQL := 'insert into PatientAppointments (patient_id, appointment_id) values (' +
        IntToStr(aPatient_id) + ', ' + IntToStr(aAppointment_id) + ')';
        data:=Database.ExecuteList([], sSQL);
        Database.Commit();

Please don't tell me to use the function 'ManyAdd' as I do not have columns named Dest and Source....

Regards,
Maurijn

#5 Re: mORMot 1 » Sorting when CreateAndFillPrepare » 2012-08-15 16:16:22

It surely helped! Thanks a lot!
Regards,
Maurijn

#6 mORMot 1 » Sorting when CreateAndFillPrepare » 2012-08-11 21:58:35

mvddoes
Replies: 2

Hello,

I am new to mORMot and have built some code to learn it. But I cannot figure out how to retrieve data sorted when using CreateAndFillPrepare (from a table by using an TSQLRecord).

How can I change the code below to retrieve my data sorted?

In the code below TSQLPatientsis just an TSQLRecord with some properties.

  patients := TSQLPatients.CreateAndFillPrepare(DatabaseClient, '');
  cbListPatients.Clear();
  try
    while patients.FillOne do
    begin
      Inc(iTemp);
      cbListPatients.AddItem(patients.name, Pointer(patients.id));
      cbListPatients.Checked[iTemp]:= (patients.active='y');
    end
  finally
    FreeAndNil(patients);
  end;

I am curious to read the answer...!

Regards,
Maurijn

Board footer

Powered by FluxBB