🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.vdbase.data.sql
Article #1402

Vdb variables in SQL statements

#1402
From: Tom Arnold
Date: Sat, 24 Jan 1998 00:00
89 lines
2576 bytes
I am beginning to think I will never get to where I understand how to
use SQL in 7.0.  I have been using code like that below to attempt to
establish a temporary file, and it seems that as long as I have a
variable, in whatever form, in the SQL statement, I get a Table does not
exist error.  If, instead, I hard code a Temp.dbf, it works OK.  Please,
someone tell me what I am doing wrong, and more importantly, the
rationale for doing it the right way.  Code follows:
-- 
   Tom 
   Bena, VA

To reply email, please remove the KILL.SPAM from my address.  Not
necessary for NGs


-----------------------------------------
** END HEADER -- do not remove this line
//
// Generated on 01/24/98
//
parameter bModal
local f
f = new TempDbfForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class TempDbfForm of FORM
   with (this)
      onOpen = class::FORM_ONOPEN
      scaleFontBold = false
      height = 16
      left = 88.4286
      top = 0.8636
      width = 40
      text = ""
   endwith


   this.FLEET1 = new DATABASE()
   this.FLEET1.parent = this
   with (this.FLEET1)
      left = 10
      top = 2
      databaseName = "FLEET"
      active = true
   endwith


   this.AIRCRAFT1 = new QUERY()
   this.AIRCRAFT1.parent = this
   with (this.AIRCRAFT1)
      left = 11.4286
      top = 2.4545
      database = form.fleet1
      sql = "select * from aircraft.dbf"
      active = true
   endwith


   this.QUERY1 = new QUERY()
   this.QUERY1.parent = this
   with (this.QUERY1)
      left = 23
      top = 2.5

   endwith


   this.rowset = this.aircraft1.rowset

   function form_onOpen 
      u = new UpdateSet()  
      u.source = form.aircraft1.rowset
      foo = funique('Temp????.dbf')
      u.destination = foo
      u.copy()
      msgbox(foo+' Exists? - '+file(foo))
      with (form.QUERY1)
          sql = 'SELECT * FROM foo'        
          active = true                // error here
      endwith
      msgbox("Done")
      return
endclass
Technical Details
Message-ID: <34CA5957.6338@inna.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,55c42f16f0b042e2,start
X-Google-Attributes: gidff5a1,public
From: Tom Arnold <tarnold@inna.net>
Subject: Vdb variables in SQL statements
Date: 1998/01/24
Message-ID: <34CA5957.6338@inna.net>
X-Deja-AN: 319071379
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0
Reply-To: KILL.SPAM.tarnold@inna.net
Content-Type: text/plain; charset=us-ascii
Organization: Microaid
Newsgroups: borland.public.vdbase.data.sql