Search Postgresql Archives

Re: plperl syntax question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday, March 12, 2020, Rob Sargent <robjsargent@xxxxxxxxx> wrote:


On Mar 12, 2020, at 7:44 PM, stan <stanb@xxxxxxxxx> wrote:

On Thu, Mar 12, 2020 at 06:37:02PM -0700, David G. Johnston wrote:
On Thursday, March 12, 2020, stan <stanb@xxxxxxxxx> wrote:

my $rv3 = spi_exec_query('$stmt');
What am I doing wrong here?


Putting a variable name into a single-quoted string and expecting it to
resolve to the contents of said variable instead of being treated as a
literal.
David J.

Please look at this.

Here is the code:

my $stmt = qq('SELECT employee_key from employee where id = $user ;');
elog( NOTICE, "stmt = $stmt" );
my $rv3 = spi_exec_query($stmt);

So you fixed the error in the third line i and others pointed out but then decided to introduce a new error by changing the first line...

David J.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux