Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 503
  • Last Modified:

SyBase SQL Query Syntax

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
triphen
Asked:
triphen
1 Solution
 
pablito70Commented:
Could you, please, try this statement (not tested)

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

HTH
0
 
triphenAuthor Commented:
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
 
Pratima PharandeCommented:
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!

 
Pratima PharandeCommented:
ELECT CAST(posnote as  VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
0
 
Pratima PharandeCommented:
SELECT CAST(posnote as  VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
0
 
triphenAuthor Commented:
SELECT CAST(posnote as  VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005

Returns  "(MEMO)" as the SQL result.
0
 
Pratima PharandeCommented:
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
 
triphenAuthor Commented:
Blank Result

and

---------------------------
Adodc1
---------------------------
[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'SQL_VARCHAR' on line 1
---------------------------
OK  
---------------------------
0
 
triphenAuthor Commented:
Apparently this is not possible :/
0
 
GanapathiFacets DeveloperCommented:
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
 
triphenAuthor Commented:
Apparently this is not possible :/
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now