[DUG] Adding Field to Table in SQL

Brian Wrigley bswrigley at xtra.co.nz
Mon May 29 18:26:08 NZST 2006


  ----- Original Message ----- 
  From: James Sugrue 
  To: 'NZ Borland Developers Group - Delphi List' 
  Sent: Monday, May 29, 2006 5:40 PM
  Subject: [DUG] Adding Field to Table in SQL


  Is it possible to add a field to a paradox table called Active using SQL. 

In the BDE? Yes. eg:



alter table ":dbdemos:test.db"
  add "test.db"."Active" boolean



That weird syntax "file name including extension"."field name" is the BDE's way of letting you specify fields that are reserved words, contain illegal characters etc.



A similar example: to create a file with an illegal field:



create table ":dbdemos:test.db"
  (id numeric(6),
  "test.db"."Active" boolean)



  I.E Alter table <x> add column Active Boolean

   

  Active is of course a reserved word. I know this - pity the developer I inherited the system from didn't. I have tried 'Active', "Active" and even [Active] but to no avail. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20060529/e03da8aa/attachment-0001.html


More information about the Delphi mailing list