[SQL] concatenate question

2010-12-07 Thread Tony Capobianco
Here's my table: plsql_dw=# \d tmpsv_parent_master Table "staging.tmpsv_parent_master" Column |Type | Modifiers +-+--- memberid | numeric

Re: [SQL] concatenate question

2010-12-07 Thread Tony Capobianco
Ok, that worked. Why did I need to cast both as text though? plsql_dw=# select memberid::text||addeddate::text from tmpsv_parent_master limit 5; ?column? -- 4005941032010-11-16 19:32:17 4005941952010-11-16 19:33:29 4005942842010-11-16 19:34:32

Re: [SQL] concatenate question

2010-12-07 Thread Peter Steinheuser
I think the HINT is what you need to look at. Cast both columns to text. On Tue, Dec 7, 2010 at 4:37 PM, Tony Capobianco wrote: > Here's my table: > >plsql_dw=# \d tmpsv_parent_master > Table "staging.tmpsv_parent_master" > Column |Type

Re: [SQL] concatenate question

2010-12-07 Thread Dmitriy Igrishin
Hey Tony, Because there is no implicit conversion to text. 2010/12/8 Tony Capobianco > Ok, that worked. Why did I need to cast both as text though? > > plsql_dw=# select memberid::text||addeddate::text from > tmpsv_parent_master limit 5; > ?column? > -- >

Re: [SQL] concatenate question

2010-12-07 Thread Kenneth Marshall
What does a 'timestamp || numeric' actually look like? It means the timestamp written out a.k.a text and the same for numeric. The database does not know that that is what you wanted without the casts to text. Cheers, Ken On Tue, Dec 07, 2010 at 04:47:46PM -0500, Tony Capobianco wrote: > Ok, that

Re: [SQL] concatenate question

2010-12-07 Thread Richard Broersma
On Tue, Dec 7, 2010 at 1:47 PM, Tony Capobianco wrote: > Why did I need to cast both as text though? http://www.postgresql.org/docs/8.3/interactive/release-8-3.html#AEN87134 -- Regards, Richard Broersma Jr. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your

Re: [SQL] concatenate question

2010-12-07 Thread Peter Steinheuser
I don't know what Postgres version you're using but check out the doc related to String Functions and Operators. Cheers, Peter On Tue, Dec 7, 2010 at 4:47 PM, Tony Capobianco wrote: > Ok, that worked. Why did I need to cast both as text though? > > plsql_dw=# select memberid::text||addeddate

[SQL] mybatis 3 RETURNING id problem with insert.

2010-12-07 Thread -
Hello. Iam trying to do an insert for return generated id INSERT RETURNING id. In postgres editor it work without problems, but in code execution - java 1.6 with iBatis 3 (mybatis-3.0.3.jar) (8.4.5 postgres, driver version 8.4-702) return always - 1 Code iBatis xml With this code, always return