Re: psqlODBC text length with no records
От | Barry Bell |
---|---|
Тема | Re: psqlODBC text length with no records |
Дата | |
Msg-id | b69daf8c28f741a3ae1206b160aa4a7d@BY2PR08MB281.namprd08.prod.outlook.com обсуждение исходный текст |
Ответ на | Re: psqlODBC text length with no records (Adrian Klaver <adrian.klaver@aklaver.com>) |
Список | pgsql-odbc |
I am referring the output of the odbc driver from SQL statement: SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=0 You link only show the date type in postgres and I am asking about the driver output. Are you using this statement with the ODBC driver? (Output from the ODBC driver may be different format then for pg admin etc). SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=0 I am expending a "character varying" or "varchar" output from the sql statement But the I getting the postgres "text" If the SQL is changed to return records, SELECT initcap('ABCDEF')::varchar vv FROM dual The output is varchar So SELECT initcap('ABCDEF')::varchar vv FROM dual Works, returns varchar So the issues is with: SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=0 Returning "text", sqllongvar a different type then above, Does not change with any unknownsize or datetype setting in ODBC driver. Barry Bell Senior Developer/Analyst Logistics Harte Hanks 1525 NW 3rd ST Deerfield Beach FL, 33442 954-429-3771 Ext 267 office 954-281-1464 fax hartehanks.com / linkedin / twitter / facebook -----Original Message----- From: Adrian Klaver [mailto:adrian.klaver@aklaver.com] Sent: Wednesday, May 14, 2014 9:23 AM To: Barry Bell; Hiroshi Saito; Michael Paquier; Hiroshi Inoue Cc: Heikki Linnakangas; Anna Gershnik; pgsql-odbc@postgresql.org Subject: Re: [ODBC] psqlODBC text length with no records On 05/14/2014 06:11 AM, Barry Bell wrote: > Use the cast work fine but we are using the initcap function in a lot > of places And do not want to cast to every place. > (Plus we use a lot of other functions that may have the same issue). > > You said the initcap function return "text", Is this a "short" text > like a varchar Or a long text like a clob,memo etc? This is text vs varchar(n) or char(n). I show the 'n' because in Postgres a varchar without a length is equivalent to text.See here for all the details: http://www.postgresql.org/docs/9.3/interactive/datatype-character.html > > Barry Bell > Senior Developer/Analyst > Logistics > Harte Hanks > 1525 NW 3rd ST > Deerfield Beach FL, 33442 > 954-429-3771 Ext 267 office > 954-281-1464 fax > > -- Adrian Klaver adrian.klaver@aklaver.com
В списке pgsql-odbc по дате отправления: