Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > pl/pgsql functi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 15796 of 17437
Post > Topic >>

pl/pgsql function with argument of type DATE

by bojank@[EMAIL PROTECTED] ("Bojan") Jun 10, 2008 at 06:02 PM

This is a multipart message in MIME format.

------=_NextPart_000_0009_01C8CB24.1530CCC0
Content-Type: text/plain;
	charset="windows-1250"
Content-Transfer-Encoding: quoted-printable

How to invoke function which has arguments declared as type =93date=94?

=20

I want to make function which will return a list of all dates between
starting and ending

 date which are two arguments of that function. I tried with:

=20

select * from foo(2008-06-01, 2008-06-09)

select * from foo(=912008-06-01=92, =912008-06-09=92)

=20

but type mismatch (date vs integer) error occurs.

=20

Thanks,=20

=20

     Bojan=20

=20


No virus found in this outgoing message.
Checked by AVG.=20
Version: 7.5.524 / Virus Database: 270.0.0/1486 - Release Date: =
05/06/2008
18:29
=20

------=_NextPart_000_0009_01C8CB24.1530CCC0
Content-Type: text/html;
	charset="windows-1250"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml"
=
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dwindows-1250">


<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @[EMAIL PROTECTED]
"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@[EMAIL PROTECTED]
 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
..MsoChpDefault
	{mso-style-type:ex****t-only;}
@[EMAIL PROTECTED]
 Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-GB link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>How to invoke function which has arguments declared =
as type &#8220;date&#8221;?<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I want to make function which will return a list of =
all
dates between starting and ending<o:p></o:p></p>

<p class=3DMsoNormal>&nbsp;date which are two arguments of that =
function. I tried
with:<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>select * from foo(2008-06-01, =
2008-06-09)<o:p></o:p></p>

<p class=3DMsoNormal>select * from foo(&#8216;2008-06-01&#8217;, =
&#8216;2008-06-09&#8217;)<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>but type mismatch (date vs integer) error =
occurs.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Thanks, <o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>&nbsp;&nbsp;&nbsp;&nbsp; Bojan <o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>
<BR>

<P><FONT SIZE=3D2>No virus found in this outgoing message.<BR>
Checked by AVG.<BR>
Version: 7.5.524 / Virus Database: 270.0.0/1486 - Release Date: =
05/06/2008 18:29<BR>
</FONT> </P>

------=_NextPart_000_0009_01C8CB24.1530CCC0--
 




 3 Posts in Topic:
pl/pgsql function with argument of type DATE
bojank@[EMAIL PROTECTED]   2008-06-10 18:02:01 
Re: pl/pgsql function with argument of type DATE
andreas.kretschmer@[EMAIL  2008-06-12 10:25:05 
Re: pl/pgsql function with argument of type DATE
pavel.stehule@[EMAIL PROT  2008-06-12 11:14:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 16:20:36 CST 2008.