Thread: Calling a function within a function - plpsql

Calling a function within a function - plpsql

From
Godshall Michael
Date:
Hi,
 
I have created a function(a) that within this function(a) another function(b) is called.  When I execute function(a) I am getting a syntax error near ; message.
When I comment out the line of code that calls function(b) then function(a) works fine.
When I execute function(b) on its own function(b) works fine.
 
Does psql support a function calling other functions?   
 

Michael Godshall
GMAC Global Relocation Services
900 So. Frontage Road
Woodridge, IL 60517
630-427-2070 office
630-972-2287 fax

michael_godshall@gmachs.com

 

Re: Calling a function within a function - plpsql

From
Tom Lane
Date:
Godshall Michael <Michael_Godshall@gmachs.com> writes:
> I have created a function(a) that within this function(a) another
> function(b) is called.  When I execute function(a) I am getting a syntax
> error near ; message.
> When I comment out the line of code that calls function(b) then function(a)
> works fine.
> When I execute function(b) on its own function(b) works fine.

> Does psql support a function calling other functions?

Certainly.  You're making some syntax error or other, but since you've
not shown us your code, we cannot help much.

            regards, tom lane

Re: Calling a function within a function - plpsql

From
Godshall Michael
Date:

Thank you for the response.  I found the syntax error.  Function(b) was defined to return void so I assumed that when I called function(b) in function(a) that I did not need to assign the result(or lack of in this case) to a variable. 

Mike

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Thursday, September 25, 2003 3:10 PM
To: Godshall Michael
Cc: 'pgsql-novice@postgresql.org'
Subject: Re: [NOVICE] Calling a function within a function - plpsql

Godshall Michael <Michael_Godshall@gmachs.com> writes:
> I have created a function(a) that within this function(a) another
> function(b) is called.  When I execute function(a) I am getting a syntax
> error near ; message.
> When I comment out the line of code that calls function(b) then function(a)
> works fine.
> When I execute function(b) on its own function(b) works fine.
 
> Does psql support a function calling other functions?  

Certainly.  You're making some syntax error or other, but since you've
not shown us your code, we cannot help much.

                        regards, tom lane