dbTalk Databases Forums  

Re: [PHP] Date type in pl/pgsql function checking passed parameter

mailing.database.pgsql-php mailing.database.pgsql-php


Discuss Re: [PHP] Date type in pl/pgsql function checking passed parameter in the mailing.database.pgsql-php forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John DeSoi
 
Posts: n/a

Default Re: [PHP] Date type in pl/pgsql function checking passed parameter - 10-24-2005 , 09:18 AM







On Oct 24, 2005, at 9:02 AM, Partners Majolee Infotech wrote:

Quote:
We have a pl/pgsql function functionName(date) .. here if it has
been called using functionName('23456') it gives error .. we need
to raise an exception(customized error message) if the passed value
is not date.. how can we do that.

You can add a function with the same name that accepts a text
parameter instead of a date. Then check the date and call your
functionName(date) function or raise your custom exception if the
date is invalid.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.