Solved

SyBase SQL Query Syntax

Posted on 2014-04-03
11
485 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

615 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