logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: ODBC int2 parameters to pg function: msg#00046

db.postgresql.odbc

Subject: Re: ODBC int2 parameters to pg function

Tom,
Thanks for the reply.

I agree with your solution in principle, but I have nearly 100 databases
so far across several servers and many at customer sites. I am trying to
migrate some from and maintain compatibility with MS SQLServer.
These quantities have been smallint for quite some time. Changing the
underlying database types now would be a problem.

I can cast inside the function, this is my current solution. Given that
there is no implicit downcast wouldn't the best solution be to get the
ODBC driver do the cast on the function call?

Thanks,
Gary.

On 13 Mar 2004 at 19:40, Tom Lane wrote:

> Gary Doades <gpd@xxxxxxxxx> writes:
> > I have delcared a pg function as:
> > function GENERATE_TIMESHEETS(timestamp,timestamp,smallint,smallint)
> > ....
>
> You're probably best off to declare the inputs as integer not smallint.
> Integer literals are assumed to be int4 by default, and since there's
> no implicit downcast to int2 (anymore), writing a function this way will
> require you to cast to smallint explicitly a lot. It's seldom worth
> that notational hassle. You can cast inside the function if you really
> need the values to be int2 inside it.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo