Solved

SyBase SQL Query Syntax

Posted on 2014-04-03
11
477 Views
Last Modified: 2014-04-26
Hello Experts,

I am working with SyBase SQL Anywhere v10. I am executing this SQL statement:

select Notes from customer where custid = 100

It returns "(MEMO)"

There is long note that is stored in there. How can I view it via SQL? I believe the datatype for the column is Long Varchar.

Thanks!
0
Comment
Question by:triphen
[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
11 Comments
 
LVL 2

Expert Comment

by:pablito70
ID: 39977262
Could you, please, try this statement (not tested)

SELECT CONVERT(Notes, SQL_CHAR) AS MyNotes FROM customer WHERE custid = 100

HTH
0
 

Author Comment

by:triphen
ID: 39977279
SELECT CONVERT(posnote, SQL_CHAR) AS MyNotes FROM member WHERE memcode = 2005



General SQL error.

[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'posnote' on line 1.
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 39977301
ELECT CAST(posnote, VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
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 39

Expert Comment

by:Pratima Pharande
ID: 39977302
ELECT CAST(posnote as  VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 39977304
SELECT CAST(posnote as  VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
0
 

Author Comment

by:triphen
ID: 39977308
SELECT CAST(posnote as  VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005

Returns  "(MEMO)" as the SQL result.
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 39977329
SELECT CONVERT (VARCHAR(500), posnote ) AS MyNotes FROM member WHERE memcode = 2005

OR

SELECT CONVERT (SQL_VARCHAR, posnote ) AS MyNotes FROM member WHERE memcode = 2005
0
 

Author Comment

by:triphen
ID: 39977480
Blank Result

and

---------------------------
Adodc1
---------------------------
[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'SQL_VARCHAR' on line 1
---------------------------
OK  
---------------------------
0
 

Accepted Solution

by:
triphen earned 0 total points
ID: 40014072
Apparently this is not possible :/
0
 
LVL 8

Expert Comment

by:Ganapathi
ID: 40016922
You are correct. It isn't possible.

Instead, you can alter the table to have the Notes column as "TEXT" type and Select. You will get it.

Enable SELECT INTO option by sp_dboption before running ALTER command.
0
 

Author Closing Comment

by:triphen
ID: 40024332
Apparently this is not possible :/
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 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