Board index » delphi » Insert Query and Integer fields (Pdox Table)

Insert Query and Integer fields (Pdox Table)

Hello all,

Has anyone solved this:

When I use an Insert Query on a Paradox Table like

Insert into "DestTable"
Select
stringfield,
integerfield,
anotherfield,
0 as integerfield2,
etc
From "anothertable"

Then it won't work unless:
1. I select as many fields as there are in "DestTable"
2. The DestTable Integer fields are of Type "Number"

the first problem i think i can live with, but the second i'm worried
about.
Also I want to insert a null value into an integer field. (which is a
problem)

Greetings,
Frans
--
Please send very useful reply's via e-mail.
When replying via e-mail, remove the letters 'NOSPAM.' from my adress.
Thank you.

 

Re:Insert Query and Integer fields (Pdox Table)


In article <36889365.98B81...@NOSPAM.som.nl>,
Quote
  ftren...@NOSPAM.som.nl wrote:
> Hello all,

> Has anyone solved this:

> When I use an Insert Query on a Paradox Table like

> Insert into "DestTable"
> Select
> stringfield,
> integerfield,
> anotherfield,
> 0 as integerfield2,
> etc
> From "anothertable"

> Then it won't work unless:
> 1. I select as many fields as there are in "DestTable"
> 2. The DestTable Integer fields are of Type "Number"

> the first problem i think i can live with, but the second i'm worried
> about.
> Also I want to insert a null value into an integer field. (which is a
> problem)

> Greetings,
> Frans

---------------------------------------------

Hi Frans,

Try this

INSERT INTO Dest_table (field1, field2.... list exactly the fields)
SELECT field1,field2.....
FROM AnotherTable
WHERE Search_Condition;

I think the 'NUMBER' type is for float values. Use  'SHORT' or 'LONG NTEGER'
for an  Integer field.

Use NULL to insert a null value.

Best regerds / Grozev

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

Re:Insert Query and Integer fields (Pdox Table)


If you use Paradox, you use local SQL. But in local SQL you can not use
SQL-Subqueries.

Thats all.

Yours, Volker
--
Volker Fraenkle                         CS Controlling
Technical Consultant                    Software Systeme GmbH

E-Mail: VFraen...@cs-controlling.de
Phone:  +49 7144 8144-0                 Riedbachstrasse 5
Fax:    +49 7144 8144-10                D-74385 Pleidelsheim

Other Threads