Thread: Delphi & Oracle

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Delphi & Oracle


    Using Delphi 5 or 7 and Oracle 7-8-9.

    If you run a script SQL INSERT INTO or UPDATE by SQL Worksheet, it returns also the number of row processed.
    Is it possible have this result also run query INSERT INTO and UPDATE by TQuery component (BDE) ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    BDE is very old technology, I would certainly suggest changing to either Delphi's direct support components for Oracle if you have an appropriate version or one of the third party component sets.

    I have uses DOA from Allround Automations for over a decade and have found it to be wonderful.
    If you are already developing against Oracle, I can not see the very reasonable cost being a barrier.

    NOTE: I have no financial interest in Allround Automations.

    Clive
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Yes, but...


    I know DOA. But I have to modify an application who is based on BDE and runs for 17 years. So, I am searching a solution on BDE.
    However, I am honest If I say I would not know how DOA return the number of processed rows in query INSERT, DELETE.







    Originally Posted by clivew
    BDE is very old technology, I would certainly suggest changing to either Delphi's direct support components for Oracle if you have an appropriate version or one of the third party component sets.

    I have uses DOA from Allround Automations for over a decade and have found it to be wonderful.
    If you are already developing against Oracle, I can not see the very reasonable cost being a barrier.

    NOTE: I have no financial interest in Allround Automations.

    Clive
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    If you are dealing with modifying a 17 year old program, I am not sure just what flexibility is available to you.

    I am also not sure (how helpful am I?) whether you can get the row count directly in BDE
    or in DOA through a simple property.
    I would have to check; but I assume you have done that.

    I do know that you can achieve it via an Oracle stored procedure by capturing
    SQL%ROWCOUNT
    immediately after the SQL statement.
    e.g. (untested!)
    Code:
    function doDeletes(pass in whatever you need) return integer is
    v_deletedCount  integer;
    begin
       v_deletedCount := -1; -- If you want some failure return value
       DELETE FROM...;
       v_deletedCount := SQL%ROWCOUNT;
       return(v_deletedCount);
    end doDeletes;
    HTH - Clive

IMN logo majestic logo threadwatch logo seochat tools logo