Solved

Problem when using SQL with BDE...

Posted on 1998-01-07
4
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month3 days, 21 hours left to enroll

630 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