Board index » delphi » How do I concatenate fields in Interbase SQL?
Daniel Grace
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Daniel Grace
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
How do I concatenate fields in Interbase SQL?
I want to select the concatenation of two character based fields, but
Interbase SQL does not like the "+" and seems expect numeric fields e.g. SELECT char_field1 + char_field2 FROM some_table; This command raises Interbase error 413: conversion from string. Is there another operator or function that will acheive the concatenation? SELECT char_field1, char_field2 FROM some_table; Thanks, Daniel. |
Steve Lee-Woo
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do I concatenate fields in Interbase SQL?Don't know about Interbase, but in MySQL you concatenate by using comma- separated identifiers rather than using a + e.g. SELECT CONCAT(Lastname, ' ', Initials) FROM person; AFAIK, this is standard SQL, so it should work in Interbase. In article <A0G65.12885$Hm2.21869@NewsReader>, dgr...@encrypta.com Quote> I want to select the concatenation of two character based fields, but Stephen Lee-Woolf Academic Information Services University of Salford Salford, Manchester |
Martijn Tonie
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do I concatenate fields in Interbase SQL?Hi there, InterBase uses the SQL 92 standard there: the double pipe select char_field1 || ' ' || char_field2 from some_table However, when one of the fields is NULL it results in a NULL value. Martijn Tonies For InterBase Workbench, For Delphi Components and InterBase tools: Quote"Daniel Grace" <dgr...@encrypta.com> wrote in message Quote> I want to select the concatenation of two character based fields, but |
Bruce Biddl
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do I concatenate fields in Interbase SQL?In Oracle you can use vertical bars in your SQL statement like this SELECT ||Field1||Field2||' '||Field3||'sometext'||Field4 it doesn't care if numeric and string are mixed it just gives you a string ! QuoteDaniel Grace <dgr...@encrypta.com> wrote in message Quote> I want to select the concatenation of two character based fields, but |
Bruce Biddl
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do I concatenate fields in Interbase SQL?Never had a problem with that null thing in Oracle Martin !! If so you he could always try the NVL function if available in interbase. Select NVL(FieldOrValue1,FieldOrValue2) Regards QuoteMartijn Tonies <m.tonies@stopspam_upscene.com> wrote in message Quote> Hi there, |
1. Concatenating field on Interbase
2. concatenating fields SQL Statement
3. Concatenating two fields in an sql statement
4. String concatenating in Interbase
5. Saving TMemo field data to a Blob field (Interbase Table) via SQL Update Query
6. String concatenating in Interbase
7. String concatenating with Interbase
8. Lookup fields with concatenated keys...