triphen
asked on
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!
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!
ASKER
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.
General SQL error.
[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'posnote' on line 1.
ELECT CAST(posnote, VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
ELECT CAST(posnote as VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
SELECT CAST(posnote as VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
ASKER
SELECT CAST(posnote as VARCHAR(500)) AS MyNotes FROM member WHERE memcode = 2005
Returns "(MEMO)" as the SQL result.
Returns "(MEMO)" as the SQL result.
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
OR
SELECT CONVERT (SQL_VARCHAR, posnote ) AS MyNotes FROM member WHERE memcode = 2005
ASKER
Blank Result
and
-------------------------- -
Adodc1
-------------------------- -
[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'SQL_VARCHAR' on line 1
-------------------------- -
OK
-------------------------- -
and
--------------------------
Adodc1
--------------------------
[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'SQL_VARCHAR' on line 1
--------------------------
OK
--------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
Apparently this is not possible :/
SELECT CONVERT(Notes, SQL_CHAR) AS MyNotes FROM customer WHERE custid = 100
HTH