Solved

SQL Query Resulting in "Malformed String"

Posted on 2014-09-09
8
105 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
8 Comments
 
LVL 48

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 45

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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now