public inbox for [email protected]  
help / color / mirror / Atom feed
Function can not use the 'NEW' variable as a direct parameter inside trigger function?
2+ messages / 2 participants
[nested] [flat]

* Function can not use the 'NEW' variable as a direct parameter inside trigger function?
@ 2024-04-05 17:17 intmail01 <[email protected]>
  2024-04-05 19:21 ` Re: Function can not use the 'NEW' variable as a direct parameter inside trigger function? Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: intmail01 @ 2024-04-05 17:17 UTC (permalink / raw)
  To: [email protected]

Hi,

Why a function can not pass the 'NEW' variable as a direct parameter ?
When I use myFunction(NEW) inside a trigger function an error appears :

pq_driver: [PGRES_FATAL_ERROR]ERROR:  function myFunction(MyTableStruct)
does not exist
LINE 1: ...myFunction(NEW)...
              ^
HINT:  No function matches the given name and argument types. You might
need to add explicit type casts.

I have to use trick by using a temporary variable to run the code :

theVariable MyTableStruct;
theVariable = NEW ;
myFunction(theVariable) ;

Thanks


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Function can not use the 'NEW' variable as a direct parameter inside trigger function?
  2024-04-05 17:17 Function can not use the 'NEW' variable as a direct parameter inside trigger function? intmail01 <[email protected]>
@ 2024-04-05 19:21 ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-04-05 19:21 UTC (permalink / raw)
  To: intmail01 <[email protected]>; +Cc: [email protected]

intmail01 <[email protected]> writes:
> Why a function can not pass the 'NEW' variable as a direct parameter ?
> When I use myFunction(NEW) inside a trigger function an error appears :

> pq_driver: [PGRES_FATAL_ERROR]ERROR:  function myFunction(MyTableStruct)
> does not exist
> LINE 1: ...myFunction(NEW)...
>               ^
> HINT:  No function matches the given name and argument types. You might
> need to add explicit type casts.

That doesn't look like NEW's fault.  You lack a suitable function
to be called.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-04-05 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 17:17 Function can not use the 'NEW' variable as a direct parameter inside trigger function? intmail01 <[email protected]>
2024-04-05 19:21 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox