Re: Passing a variable from the user interface to PostgreSQL

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Passing a variable from the user interface to PostgreSQL
Date: 2011-01-23 02:44:01
Message-ID: 4D3B95F1.6000007@vmsinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Jasen Betts wrote:
> On 2011-01-21, Chris Campbell <ccampbell(at)cascadeds(dot)com> wrote:
>
>> --_000_453A24085F801842AEA8D0B6B269065D45E2521023HDMCcdslocal_
>> Content-Type: text/plain; charset="us-ascii"
>> Content-Transfer-Encoding: quoted-printable
>>
>> Using:
>> Windows 7 64bit
>> VB.net 2010
>> The latest devart.data.PostgreSQL (.net data connection)
>> PostgreSQL 9.0.2
>>
>> Hi all,
>>
>> Question: Is there a way to pass a variable from an application's user inte=
>> rface to the database such that it would be visible inside a database trigg=
>> er and any corresponding function call?
>>
>
>
> you can embed the extra value in an sql comment and retrieve
> it with current_query()
>
> "-- this is extra value
> delete from sometable where thiscolumn='thatvalue';"
>
> works in 8.4
>
>
Once you have to resort to the parsing of the initial SQL within the
database trigger, you know that the application design is fubar.
It's time to think about the new application design.

--
Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
www.vmsinfo.com

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message matt w 2011-01-24 02:54:35 Select and update with limit and locking
Previous Message Jasen Betts 2011-01-22 08:16:14 Re: Passing a variable from the user interface to PostgreSQL