Problem when using SQL with BDE...


I've had a question posted in the "MS-SQL" topic area concerning how I could use SQL to copy records within a Paradox-table, only changing one or two of the keyed fields to avoid a key violation. I got a very good response, but the problem is that the BDE local SQL language seems to be quite lame concerning this issue.
   Among other things, I got a "Capability not supported" errormessage when trying one of the suggestions I've received in Delphi Database Desktop v7. Does anyone know what this errormessage is all about, can I work my way around it somehow or do you have another solution for the above problem?

I'm using Delphi2 with W95.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The BDE Local SQL is VERY limited.  What was the response you got to your other question?
DippenAuthor Commented:
One of the examples were this:


which would copy all records in MYTABLE by increasing the Col1 value by 100. Someone suggested:


to complete the same task. I yet haven't found any way to complete the task with SQL. :-(

A bit round about but should work.  As the capability in question is appending fields to existing table records.

First copy MyTable call it say MyTable1 (useing what ever method suits to copy table, perhaps batch command?)
Empty the first table
with a TQuery object add the following SQL (again I will leave it to you as to how this is done.

  Insert into MyTable
  Select (Col1 + 100) as Col1,Col2
  from MyTable1

Throw away MyTable1.

This works in theory (i.e. in the Database desktop) so I assume it will work in code.

I will try and code it later if you require more exact info.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DippenAuthor Commented:
By using a temporary table the task is easily performed, but... is there no way to copy the records using BDE SQL, without using a temporary table?
   The problem is that the application includes 20 tables all in all, and there must be support for up to 15 simultaneous users at least. Handling the temporary tables in that environment seems somewhat scary.
   If there is no solution without the participation of temporary tables, I will have to yield to the weak forces of the BDE SQL and solve it some other way. I leave the question open for a few more days, and if nothing better has come in I'll accept your answer, Zonnald!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.