Search Postgresql Archives

Re: plperl syntax question

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

 




> On Mar 12, 2020, at 4:34 PM, stan <stanb@xxxxxxxxx> wrote:
> 
> I am trying to run a query in plperl that uses a Perl variable from the
> same function.
> 
> Here is the code snippet:
> 
> my $stmt = qq("SELECT employee_key from employee where id = '$user' ;");
> elog( NOTICE, "stmt = $stmt" );
> my $rv3 = spi_exec_query('$stmt');
> 
> Here is the runtime output:
> 
> NOTICE:  stmt = "SELECT employee_key from employee where id = 'stan' ;"
> ERROR:  syntax error at or near "$" at line 22.
> 
> As you can see, the statement seems correctly formatted, right?
> 
> What am I doing wrong here?
> 
> -- 
> "They that would give up essential liberty for temporary safety deserve
> neither liberty nor safety."
> 						-- Benjamin Franklin
> 
?try
 my $rv3 = spi_exec_query($stmt);
> 
> 






[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