Function parameters - need help !!!


Read With Formatting | Free Open Source Tutorials Account

PostgreSQL
Thread: Function parameters - need help !!!


pradeepkpj
Hi all,

I am a new joinee to this group. We are using Postgresql for our project. We are trying to port few stored procedures from SQL to PGSQL. But I have problems in passing default values to function parameters. I have tried a lot of tutorials and books and none of them give a good insight into passing default values to arguments in a function in Postgresql. I am totally helpless.
I need ur help....I would really appreciate if anyone could help me out with this.

Thanks in advance.... :)

With Best Regards,
Pradeep

md_doc
I am not sure I follow you 100% but if you want to use a default value can't you just check to see if it ISNULL and if it is set the value? Is that what you are looking for help on or is it something different. I can get you the code, I think, if that is what you are looking for.

Also others have suggested to check to see if the value is null and if it is null then you can use a different insert, assuming you are doing an insert, that would insert without that column and therefore using the default value of the table.

Let us know more of what you are looking for and I am sure we can be of help.