Solved

SQL Query Resulting in "Malformed String"

Posted on 2014-09-09
8
153 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 50

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

687 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