Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Deleting database entry (Read 3795 times)
YaBB Newbies

Posts: 1
Deleting database entry
28.12.05 at 10:25:07
Can data entree be deleted in database by SQL*XL  (opposite to insert command) ?  How it should be done?
Back to top
Email   IP Logged
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
Re: Deleting database entry
Reply #1 - 28.12.05 at 19:14:43
You are right, there is no delete feature similar to the multiple rows insert feature at the moment. It can be achieved easially by yourself. Consider the following:
Suppose you have some data in a sheet - you may have used SQL*XL to retrieve this data from a table:

Now suppose I want to delete the rows with empno 312 and 123. Note that empno is the primary key in my table and that my table is called emp.
You can use Excel cell formulae to make a formula that creates a delete statement to remove the row. For example I can make the following formula in D4:
=concatenate("delete from emp where empno = ", A1 , ";")
If you copy this cell to D1 also you have created two delete statements and your sheet looks as follows:
2123Jones10delete from emp where empno = 123;
4312Timms12delete from emp where empno = 312;

Now if you select the cells in column D (e.g. D1Cheesy4) and open SQL*XL's SQL dialog you can specify in the dialog you want to take the SQL from the worksheet. SQL*XL will now retrieve the SQL from the worksheet and run the delete commands.
Back to top
« Last Edit: 28.12.05 at 19:31:59 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1