Solved

Problem when using SQL with BDE...

Posted on 1998-01-07
4
179 Views
Last Modified: 2013-11-23
Hi!

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.

Thanks!
0
Comment
Question by:Dippen
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1355507
The BDE Local SQL is VERY limited.  What was the response you got to your other question?
0
 

Author Comment

by:Dippen
ID: 1355508
One of the examples were this:

INSERT INTO MYTABLE
  SELECT COL1+100 as NEW_COL1,COL2
  FROM MYTABLE

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

INSERT INTO MYTABLE
  SELECT COL1+100 NEW_COL1,COL2
  FROM MYTABLE

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

Accepted Solution

by:
Zonnald earned 100 total points
ID: 1355509
Dippen,

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
then
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.

Zonnald
0
 

Author Comment

by:Dippen
ID: 1355510
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!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now