Subject: | Re: New fields to existing table
| Date: | 5 Apr 2018 04:49:33 -0400
| From: | "Thies Grimm" <thies.grimm@t-online.de>
| Newsgroups: | pnews.paradox-programming
|
Hello Roger,
open a TCursor and enumFieldNames to an Array. Then check the Array for Your
fields. (ar.contains(...)
Thies
Roger Phil <roger@agent2000.co.uk> wrote:
>Hello Thies, and Mark, Thank you.
>
>In the 25 years since I developed my P7 "App" I have never even looked
>at SQL, perhaps I've wasted a lot of time.
>Situation now is since Creators broke P7 & I've moved to P10 I've
>changed quite a few features which means clients data needs to be
>changed with added fields but some don't need all as with past updates
>some have been changed.
>
>Question can I use SQL to check the field structure and write needed
>fields if they don't exist
>e.g. if not TcFlds.locate("Field Name", "Recon") then ....
> if not TcFlds.locate("Field Name", "Exempt") then......
> ....etc.
>
>Thies Grimm wrote:
>> hello Roger,
>>
>> just use SQL
>>
>> something like
>>
>> db.open(AliasName)
>>
>> itemSQL =
>> SQL
>> alter Table 'myTable'
>> add myNewFieldName CHAR(20)
>> endSQL
>> if not itemSQL.executeSQL(db) then
>> errorShow()
>> endIf
>>
>> Thies
>>
>>
>> Roger Phil <roger@agent2000.co.uk> wrote:
>>> Would anyone know if it's possible in opal to add extra fields to an
>>> existing table without using enumfieldstruct to create a new table and
>>> then adding records ?
>>>
>>>
>>> --
>>> RogerD
>>>
>>> ---
>>> This email has been checked for viruses by Avast antivirus software.
>>> https://www.avast.com/antivirus
>>>
>>
>
>
>--
>RogerD
|