does anyone get me a demo by uniquery.sqldelete?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bugmenot1
Posts: 6
Joined: Wed 04 Nov 2009 03:23

does anyone get me a demo by uniquery.sqldelete?

Post by bugmenot1 » Tue 11 May 2010 07:52

I read the documents but didn't understand how to use it.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Tue 11 May 2010 14:58

Hello

For example you have the following table:

Code: Select all

CREATE TABLE MY_TEST_TABLE (
  ID NUMBER,
  NAME VARCHAR2(50),
  VALUE NUMBER(15,10)
)
To select data from this table you should write the following query:

Code: Select all

  UniQuery1.SQL.Text := 'select * from MY_TEST_TABLE';
Now if you try to delete a record from UniQuery1 then UniDAC will generate a DELETE query automatically. But if you want to write the DELETE query manually then you should write the following code:

Code: Select all

  UniQuery1.SQLDelete.Text := 'delete from MY_TEST_TABLE where ID = :Old_ID';
In this case ODAC gets the ID value from the selected record and puts it to the "Old_ID" parameter automatically. And the current record will be deleted. If you want to delete a record by the NAME field then you should write the following DELETE query:

Code: Select all

  UniQuery1.SQLDelete.Text := 'delete from MY_TEST_TABLE where NAME = :Old_NAME';
You can find more detailed information about this in the UniDAC help.

If you need a sample application then please contact me by E-mail and I will send a sample to you.

Post Reply