🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Memory variable in Where clause

#1260
From: Ken Chan
Date: Fri, 20 Mar 1998 00:00
23 lines
1208 bytes
David McCullough wrote:
> I have been trying to use a memory variable in a select * statement with  a
> statement such as SELECT * FROM FEATURES  WHERE CODE = M->variable

Variables work only when using the embedded SQL feature of the language, 
i.e. typing SQL statements as straight dBASE statements:

  x = 'abc'
  select * from whatever where field = :x

To use a variable in the a Query object's SQL statement, you can 
formulate the SQL statement as the others suggest. You can also place the 
parameter in the sql statement, then fill in the resulting params array:

  q = new Query()
  q.sql = "select * from whatever where field = :x"
  q.params[ "x" ] = 'abc'
  q.active = true

-- 
//Ken@Borland
<Please follow-up to newsgroup; do not reply to email>
Technical Details
Message-ID: <MPG.f7c856576d071a198988c@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6eu59i$5jl3@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ff5a1,dd0309f1a85fd8d3
X-Google-Attributes: gidff5a1,public
From: supportinfo@borland.com (Ken Chan)
Subject: Re: Memory variable in Where clause
Date: 1998/03/20
Message-ID: <MPG.f7c856576d071a198988c@forums.borland.com>
X-Deja-AN: 336087260
References: <6eu59i$5jl3@forums.borland.com>
Organization: Borland
Newsgroups: borland.public.vdbase.data.sql