Solved

Problem when using SQL with BDE...

Posted on 1998-01-07
4
184 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

16 Experts available now in Live!

Get 1:1 Help Now