Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6986167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:46:27+00:00 2026-05-27T18:46:27+00:00

We have an application written in Delphi 2010 which connects to SQL Server Database.

  • 0

We have an application written in Delphi 2010 which connects to SQL Server Database. Now we’re in the process of migrating to Oracle. With SQL Server it was very easy to perform insert, update, delete right from a dbgrid connected to a Stored Procedure.

It’s because stored procedures in SQL Server can easily act as a table so that you can do any operation on it, providing it returns the necessary columns within the resultset. Now with Oracle I don’t know how do do it. I connect a DBGrid to a DataSource, dataset of which is a Stored Procedure object,but I can’t edit the grid. Just Select is possible.

What do I have to do to to achieve this?I use UniDac component suite to connect to Oracle database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:46:27+00:00Added an answer on May 27, 2026 at 6:46 pm

    OK,here I’m answering the question though I can see very few are dealing with Delphi recently. Let’s say we have a stored proc in Oracle database:

    CREATE OR REPLACE PROCEDURE GET_EMPLOYEES
     (V_CUR IN OUT SYS_REFCURSOR)
    AS
    BEGIN
      OPEN V_CUR FOR SELECT * FROM EMPLOYEES;
    END GET_EMPLOYEES;
    

    Now, in Delphi you pick a stored procedure component (probably from ODAC or UniDac component suite).Set its StoredProcName GET_EMPLOYEES. Then you can add all the fields that the procedure returns in a cursor.If you run the application and activate the stored procedure you’ll be able to see all the records. But if you try to insert, modify or delete anything you’ll fail to do so. Now, there’s a very tricky thing. If you check, you’ll see that ReadOnly property of all fields are set to True. Even after you set them to False nothing will change in the real database, although you can edit the DBGrid.

    So, we’ve come to the main part. How did the old Delphi-SQL Server partnership work so that you could do any operation right from a DBGrid? Well, we must understand that there’s no magic. If it’s SQL, then SQL has only one way of INSERTING,UPDATING and DELETING records-it’s with the appropriate SQL statements.With Delphi-SQL Server there seems to be an implicit SQL statement that we never paid attention. But with Oracle, we have to provide our own statements for each operation.
    If you use UniDac or ODAC then there’s SQLInsert,SQLUpdate,SQLDelete properties in a StoredProc object.If you want to insert a record through DBGrid, then you should edit its SQLInsert property to

    INSERT INTO EMPLOYEES VALUES(:EMPLOYEEID,:EMPLOYEENAME)
    

    where variables following : are corresponding to te fields of the stored procedure.They’re simply bind variales.When updating and deleting though you’ll need some unique value to represent a specific record. Primary key is one option(maybe the only option as I haven’t been able to figure out how to use ROWID for the same purpose).So the sql statements for UPDATE and DELETE would be

    DELETE FROM EMPLOYEES WHERE EMPLOYEEID=:EMPLOYEEID
    

    and

    UPDATE EMPLOYEES SET EMPLOYEENAME=:EMPLOYEENAME WHERE EMPLOYEEID=:EMPLOYEEID
    

    P.S. I just found a way to use ROWID for update and delete statements. In your stored procedure if you choose ROWID too and give it an alias then you can construct your UPDATE and DELETE Statements like such:

    UPDATE EMPLOYEES SET EMPLOYEENAME=:EMPLOYEENAME,..... WHERE ROWID=:RECORD_ROWID
    DELETE FROM EMPLOYEES WHERE ROWID=:RECORD_ROWID
    

    In the preceding statements RECORD_ROWID is the fieldname returned from stored procedure as a result of aliasing ROWID. If you use :ROWID instead you’ll get “ORA-01745: invalid host/bind variable name” error. This is because in a binding variable a colon cannot be followed by a reserved word. And ROWID is a reserved word.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application written in Delphi 7 which does not require an admin
I have a Client/Server application written Delphi. Essentially all the application is doing is
I have a very simple problem. I have an application which is written in
I'm in the process of converting a Paradox database application written in Delphi to
I have a media application (written in Delphi 2010 but I am not sure
Background: I have an application written in Delphi that uses the Borland Database Engine
My application is written using : Embarcadero Delphi 2010 I have a form named
I have an application written in delphi-xe2, now i'm adding VCL styles support, So
I have a very old application written in delphi 5 running in some customers
Lets say I have an intraweb application (written in Delphi 2010) with an iwEdit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.