Solved

SyBase SQL Query Syntax

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

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
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 video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

10 Experts available now in Live!

Get 1:1 Help Now