?
Solved

SQL Query Resulting in "Malformed String"

Posted on 2014-09-09
8
Medium Priority
?
169 Views
Last Modified: 2015-05-10
Running a simple query and getting "Malformed string" (Query is not actually being run with MS SQL server; I'm actually using Firebird 2.5, dialect 1... but didn't see that in the list.)

I tried to run this query in Database Workbench 4.4.5 Pro:
Select P.PERSONFIRSTNAME || " " || P.PERSONLASTNAME as FullName
from Person P

Open in new window

I've used queries like this thousands of times without issue. I know the fields are good; if I take out " " then this code works fine:
Select P.PERSONFIRSTNAME || P.PERSONLASTNAME as FullName
from Person P

Open in new window

I've regularly added spaces or various punctuation in this way in many other contexts without issue. Any clue why this would suddenly start acting up?
0
Comment
Question by:EricTaylor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 49

Expert Comment

by:PortletPaul
ID: 40313492
have you tried just single quotes?

Select P.PERSONFIRSTNAME || ' ' || P.PERSONLASTNAME as FullName
from Person P
0
 

Author Comment

by:EricTaylor
ID: 40313568
Yes... meant to mention that in my original post. Single vs. double-quotes makes no difference (at least in dialect 1). And, as I said, I've used this construction in many places elsewhere without issue.
0
 
LVL 51

Expert Comment

by:Vitor Montalvão
ID: 40313844
Maybe is the alias?
Just try without alias
Select P.PERSONFIRSTNAME || ' ' || P.PERSONLASTNAME 
 from Person P 

Open in new window

or put the concatenation in brackets '()'
Select (P.PERSONFIRSTNAME || ' ' || P.PERSONLASTNAME) as FullName
 from Person P

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:NickUpson
ID: 40313973
There is an interbase/firebird area

Select P.PERSONFIRSTNAME || " " || P.PERSONLASTNAME as FullName from Person P

I would start by using firebird's own isql tool to run the same query and see if you get the same result, can you narrow down the data row(s) that produce the error. Also use the single quotes just to eliminate that and your connection dialect (dbworkbench may default to 3)
0
 

Author Comment

by:EricTaylor
ID: 40318306
DBWorkbench is clearly set to Dialect 1 for this db. Single quotes makes no difference. And the query runs correctly in IBOConsole and in my applications' calls to the server... so it seems to be a DBWorkbench issue. So, I guess the query was okay... so no real question remains.
0
 

Accepted Solution

by:
EricTaylor earned 0 total points
ID: 40429341
Issue turned out to be a characterset issue in DBWorkbench; dataset somehow got set to an incorrect character set. Nothing was wrong with the query syntax.
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question