Solved

Problem when using SQL with BDE...

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Newbie Thread Programming 1 161
Internet Explorer View Settings Question 15 116
Delphi: how to implement a User Shortcut mapper? 1 117
Dev express lookupcombo 3 34
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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

789 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