[SQL] How to simulate (run) the function

2009-09-04 Thread bilal ghayyad
Hello; I have an SQL function and I need to know how to simulate it (calling it and pass for it the argument and see what the value it returns), HOW? Can I do this from the pgAdminIII GUI or from the CLI? This method help to check that the function is working fine specially if it will be calle

[SQL] Substring

2009-09-04 Thread bilal ghayyad
Hello; I have an sql script function that take one text parameter "funct (text)", what I need to do is the following: If the parameter name is string and its value was for example "abcd" then I need to do a query based on ab and then based on the abc, how? Example: SELECT * from voipdb where

[SQL] LIMIT 1; The Integer part only

2009-09-03 Thread bilal ghayyad
Hello List; I have two questions: 1) When writing the function (I mean sql function) in the postgresql, I noticed the use for LIMIT 1, but did not understand what does it mean and why we use it? 2) Also in the function (the sql function) in the postgresql, if I need to take the integer part of

[SQL] PostgreSQL Function: how to know the number of the returned results of the Query

2009-08-31 Thread bilal ghayyad
Hi List; I am building a function in the SQL (PostgreSQL), so I will be able to call this function using a SELECT query. Inside the body of this function, I was need to do the following but not able to know how: I have a SELECT statement (inside the function script itself), and I need to know