Skip site navigation (1) Skip section navigation (2)

to_date syntax error

From: "ben sewell" <mosherben(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: to_date syntax error
Date: 2006-08-29 09:08:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hi guys,
I'm nearly at the end of my postgres migration apart from from this
small problem so I am hoping somebody can spot what the problem is.

For starters, I am inputing all the parameters as varchar chars and
some of the parameters are optional and Access doesn't like passing
null integers to postgres.

Here's my code:

create or replace function reports (inreport_id varchar,inadviser_id
varchar,inprovider_id varchar,inintroducer_id varchar,
inplangroup_id varchar,inplantype_id varchar,indatespecific_start
varchar,indatespecific_end varchar,inchild24 varchar,inchild26
returns record as'

declare myrec record;
declare ireport_id integer;
declare iadviser_id integer;
declare iprovider_id integer;
declare iintroducer_id integer;
declare iplangroup integer;
declare iplantype integer;
declare idatespecific_start date;
declare idatespecific_end date;
declare ichild24 date;
declare ichild26 date;


ireport_d=CAST(inreport_id as integer);
iadviser_id=CAST(inadviser_id as integer);
iprovider_id=CAST(inprovider_id as integer);
iintroducer_id=CAST(iintroducer_id as integer);
iplangroup=CAST(inplangroup as integer);
iplantype=CAST(inplangroup_id as integer);

I'll be using the variables later in the function so any advice/help
is appreciated.



pgsql-novice by date

Next:From: Tiger QuimpoDate: 2006-08-29 09:17:07
Subject: Re: Shared Objects (Dynamic loading)
Previous:From: Shane AmblerDate: 2006-08-29 05:30:04
Subject: Re: Difference between char and varchar

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group