🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

sql and vars.

#1008
From: Jason Ortner
Date: Thu, 28 May 1998 00:00
38 lines
1783 bytes
In the following function I am trying to pass the table to use via a
var.  I have tried several different methods, none with success.  What
I would like to do is programmatically chose the table to use with the
query.  I can do this by writing the query for each choice, but that
seems clumsy.  If I could pass the var. for the table then you would
only have to have the query once in the code.  Is this possible?
Thanks for any help you can give.  The query works fine if I just hard
code the table to use.

Jason Ortner




FUNCTION NUMENTRIES
LOCAL thisrope,a
a = 'rope1.dbf'
thisrope = {|a|a}

if _app.curpgec = 1
   cnt = new query()
   cnt.sql = "SELECT HEADFN, HEADLN, HEELFN, HEELLN, DRAWNUM,
DATEOFROPE ;
    FROM 'rope1.dbf' Rope1 ;  //this var. "rope1.dbf" is the one I am
trying to pass.  I have tried more than this scenario, much more.
      WHERE (HEADFN <> '') ;
      AND  (HEADLN <> '') ;
      AND  (HEELFN <> '') ;
      AND  (HEELLN <> '') ;
      AND  (DATEOFROPE = :dt)"
      cnt.params["dt"] = _app.dofrec1  *this param works
      //cnt.params["b"] = thisrope(a)     *this does not
   cnt.active = true
   _app.nrent1 = cnt.rowset.count()
   cnt.active = false
   cnt = null
return
Technical Details
Message-ID: <6kkokc$cph10@forums.borland.com>
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,5fc5d2c5adb0c43e,start
X-Google-Attributes: gidff5a1,public
From: "Jason Ortner" <jortner@onramp113.org>
Subject: sql and vars.
Date: 1998/05/28
Message-ID: <6kkokc$cph10@forums.borland.com>
X-Deja-AN: 357444135
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.vdbase.data.sql