Jump to content

skyzoframe[hun]

Members
  • Content Count

    86
  • Joined

  • Last visited

Posts posted by skyzoframe[hun]


  1. The first step is solved, by using the update flag, creating a negative and positive  ID with one trigger when inserting anything into the database. // interbase database // before insert

    AS
    declare variable COUNT_ID INTEGER;declare variable I INTEGER;/**/
    
    begin
     COUNT_ID=0;
     i=0;
     new.TIME_CREATE=Current_TimeStamp;
     
     
    /*
    UPDATE_KEY -> default False!
    */ 
    if (new.UPDATE_KEY=False) then
    begin 
     /*when create*/
     if (not exists( select * from MGR_SZABASZAT where ID>-1)) then
     begin
      new.ID=0;
     end
     else
     begin
      select count(*) from MGR_SZABASZAT where ID>-1 into :COUNT_ID;
      i=:COUNT_ID;
      WHILE (i>0) DO
      begin
       if (not exists (select ID from MGR_SZABASZAT where ID=:i))
       then 
       begin
        new.ID=:i;
        i=0;
       end else i=i-1;
      end /* WHILE (i>0) DO*/
     end /*if (not exists( select * from MGR_SZABASZAT)) then*/
    end
    else
    begin
     /*update*/
      if (not exists( select * from MGR_SZABASZAT where ID<0)) then
     begin
      new.ID=-1;
     end
     else
     begin
      select count(*) from MGR_SZABASZAT where ID<0 into :COUNT_ID;
      i=:COUNT_ID+1;
      i=i*-1;
      WHILE (i<0) DO
      begin
       if (not exists (select ID from MGR_SZABASZAT where ID=:i))
       then 
       begin
        new.ID=:i;
        i=0;
       end else i=i+1;
      end /* WHILE (i<0) DO*/
     end /*if (not exists( select * from MGR_SZABASZAT)) then*/
    end
    end

     


  2. 3 minutes ago, Squamis said:

    Yes, I can use stored procedures, macroses, .... This topic just a question for understanding - it is a bug or we can do something! 

    Just why a simple query can't be executed with standart functionality.

     

    I have no clue.


  3. After a while, I read these kinds of books. From  2016.

    - Expert Delphi By Paweł Głowacki
    - Delphi High Performance By Primož Gabrijelčič

    - Mastering Delphi Programming: A Complete Reference Guide By Primož Gabrijelčič
    - Delphi Cookbook - Third Edition By Daniele Spinetti, Daniele Teti
    - Delphi Programming Projects By William Duarte
    - Delphi GUI Programming with FireMonkey By Andrea Magni
    -- by Dalija Prasnikar
    Delphi Memory Management for Classic and ARC Compilers

    Delphi Event-based and Asynchronous Programming

    Now reading.: Delphi Thread Safety Patterns

     

    Because I am far from intelligence. I have to read. ˇˇ Are there any good books to read? What did I miss?


  4. 19 minutes ago, limelect said:

    Right now from my point of view as a programmer, I catch the screen of a

    program as a picture copy to clipboard saves to ADVrichedit so simple. 

    https://download.tmssoftware.com/Download/Manuals/TMS TAdvRichEditor.pdf

     

    image.thumb.png.b18ed2e1ef14ab772898706690a86016.png

     

    Or you can store pictures on a local drive, and only the picture name has to be in the database. Or use a custom table for blob fields and call only when you have to show the picture.


  5. I don't understand: why do you need so many big files, or blobs, in your database?

     

    by the way.:

     

    image.png.a805b9d344ed8986dd3bb85be658ba87.png

     

    They are the same drawings in different file formats. If I need to save something in database, I'll use a *.emf file.

     

    I only have one question: Can you reduce the file size somehow?


  6.  

    21 hours ago, Lars Fosdal said:

    Basically, it is an automatically incremented integer value which uniquely identifies the row, without having any other relation to the data in the row.

    You use these identity fields as primary keys for efficiently joining tables, and as unique id's for doing updates and deletions.

    There are any other ways to handle unique identities?

×