🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: sql and vars.

#1009
From: Romain Strieff [TeamB]
Date: Fri, 29 May 1998 00:00
44 lines
1794 bytes
In article <6kkokc$cph10@forums.borland.com>, jortner@onramp113.org 
grudgingly admits...
> 
> 
> 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.
> 
You need a PRIVATE variable, not LOCAL to use a &macro.

Private aTable
aTable="ROPE1.DBF"
whatever.SQL= [SELECT * FROM '&aTable.']



-- 
Romain Strieff [TeamB]
Want quick help? Check previous Q and A at:
http://forumsearch.borland.com:88/ and TIs at
http://www.borland.com/VdBASE/vdbprod.html 
Technical Details
Message-ID: <MPG.fd8ce23ae90756098adaa@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6kkokc$cph10@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,5fc5d2c5adb0c43e
X-Google-Attributes: gidff5a1,public
From: Romain@Do.not.reply.via.e-mail (Romain Strieff [TeamB])
Subject: Re: sql and vars.
Date: 1998/05/29
Message-ID: <MPG.fd8ce23ae90756098adaa@forums.borland.com>
X-Deja-AN: 357640504
References: <6kkokc$cph10@forums.borland.com>
Organization: TeamB
Reply-To: teamb@opto-pps.com
Newsgroups: borland.public.vdbase.data.sql