0
Concat two fields in SQL
New Here
,
/t5/coldfusion-discussions/concat-two-fields-in-sql/td-p/81857
Jun 08, 2006
Jun 08, 2006
Copy link to clipboard
Copied
I am trying to concatenate two columns in an SQL statement
but haven't been having much success: here is the portion of the
SQL: CONCAT(people_lname||' '||people_fname) as Person
Is this correct syntax?
Reading through one of my oracle books it seems to be the correct syntax but not sure if CF likes it.
Is this correct syntax?
Reading through one of my oracle books it seems to be the correct syntax but not sure if CF likes it.
TOPICS
Database access
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
/t5/coldfusion-discussions/concat-two-fields-in-sql/m-p/81858#M8225
Jun 08, 2006
Jun 08, 2006
Copy link to clipboard
Copied
What database are you using? With Oracle you would use || as
the concatenation operator (without the CONCAT), as in:
people_lname || ' ' || people_fname as Person
for SQL Server or Access you would use + as in:
people_lname +' '+ people_fname as Person
MySQL you might do it this way:
CONCAT(people_lname, ' ', people_fname) as Person
Phil
people_lname || ' ' || people_fname as Person
for SQL Server or Access you would use + as in:
people_lname +' '+ people_fname as Person
MySQL you might do it this way:
CONCAT(people_lname, ' ', people_fname) as Person
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
thomascraig
AUTHOR
New Here
,
/t5/coldfusion-discussions/concat-two-fields-in-sql/m-p/81859#M8226
Jun 08, 2006
Jun 08, 2006
Copy link to clipboard
Copied
I'm using an Oracle db, I tried your suggestion without any
luck.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
thomascraig
AUTHOR
New Here
,
/t5/coldfusion-discussions/concat-two-fields-in-sql/m-p/81860#M8227
Jun 08, 2006
Jun 08, 2006
Copy link to clipboard
Copied
Phil,
Just remembered I'm using SQL Server in my testing environment - oracle in production. Your suggestion worked.
Just remembered I'm using SQL Server in my testing environment - oracle in production. Your suggestion worked.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/concat-two-fields-in-sql/m-p/81861#M8228
Jun 08, 2006
Jun 08, 2006
Copy link to clipboard
Copied
You're using SQL Server in testing and Oracle in development?
You realize that all of your testing is suspect, right?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
/t5/coldfusion-discussions/concat-two-fields-in-sql/m-p/81862#M8229
Jun 08, 2006
Jun 08, 2006
Copy link to clipboard
Copied
If you are using SQL Server in develoment, and Oracle in
production, and you have lot of SQL, it is going to be a minefield
of little syntax and function differences even if you closely
adhere to "standard" ANSI SQL 92, and you will constantly have to
make many many changes when migrating your development code into
production. A very bad idea. I know that Oracle is expensive but
couldn't your DBA create a small instance for you to do your
development and testing?
Phil
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/concat-two-fields-in-sql/m-p/81863#M8230
Jun 08, 2006
Jun 08, 2006
Copy link to clipboard
Copied
Doesn't Oracle have a free edition, Oracle express, just for
situations like this?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
LATEST
/t5/coldfusion-discussions/concat-two-fields-in-sql/m-p/81864#M8231
Jun 09, 2006
Jun 09, 2006
Copy link to clipboard
Copied
Yup. Never used it, but it sounds like it would be much
better than SQL server for dev, and Oracle for production!
Oracle Database 10g Express Edition
Oracle Database 10g Express Edition (Oracle Database XE) is an entry-level, small-footprint database based on the Oracle Database 10g Release 2 code base that's free to develop, deploy, and distribute; fast to download; and simple to administer. Oracle Database XE is a great starter database for:
Developers working on PHP, Java, .NET, and Open Source applications
DBAs who need a free, starter database for training and deployment
Independent Software Vendors (ISVs) and hardware vendors who want a starter database to distribute free of charge
Educational institutions and students who need a free database for their curriculum
Phil
Oracle Database 10g Express Edition
Oracle Database 10g Express Edition (Oracle Database XE) is an entry-level, small-footprint database based on the Oracle Database 10g Release 2 code base that's free to develop, deploy, and distribute; fast to download; and simple to administer. Oracle Database XE is a great starter database for:
Developers working on PHP, Java, .NET, and Open Source applications
DBAs who need a free, starter database for training and deployment
Independent Software Vendors (ISVs) and hardware vendors who want a starter database to distribute free of charge
Educational institutions and students who need a free database for their curriculum
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

