Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Plain query does not transform in PostgreSQL function
 

Pages: 1
LLBLGen Pro Runtime Framework
Plain query does not transform in PostgreSQL function
Page:1/1 

  Print all messages in this thread  
Poster Message
dodyg
User



Location:

Joined on:
04-Dec-2014 15:48:05
Posted:
30 posts
# Posted on: 28-Jan-2019 05:25:49.  
I am using LLBLGen 5.5 and the latest driver for NPGSql.

Code:

await adapter.ExecuteSQLAsync(@"
DO $$
BEGIN
    SELECT * FROM institute_view WHERE institute_id=@instituteid AND day=@day AND month=@month AND year=@year;
END
$$
", new{
        instituteid = notification.Id,
        day = notification.DateUTC.Day,
        month = notification.DateUTC.Month,
        year = notification.DateUTC.Year
        })


returns PostgresException: 42703: column "instituteid" does not exist.

If I remove the function declaration, it will work

Code:

await adapter.ExecuteSQLAsync(@"
    SELECT * FROM institute_view WHERE institute_id=@instituteid AND day=@day AND month=@month AND year=@year;
", new{
        instituteid = notification.Id,
        day = notification.DateUTC.Day,
        month = notification.DateUTC.Month,
        year = notification.DateUTC.Year
        })
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8088 posts
# Posted on: 28-Jan-2019 06:56:29.  
It's seems like if the parameter name is not recognized as it's out of scope of the function. Any reason you would like to use an anonymous code block here (function)?

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.