Solved

how do i concatenate two fields of "image" datatype

Posted on 2003-11-04
7
714 Views
Last Modified: 2012-06-21
hi! we have sybase (ASE/11.9.2.5 set on NT4).i have a stored proc where i am retrieving two sets of values from a table and inserting into a temp table. both the values and the destination field are of datatype "image". based on certain conditions, i need to concatenate the two values and populate the destination field. when i try to concatenate, i get an error "the once aggregate operation cannot take a image datatype as an argument". can someone advise how i can concatenate / update fields with "image"?

thx in advance
0
Comment
Question by:nsujesh
[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
  • 3
7 Comments
 
LVL 15

Accepted Solution

by:
namasi_navaretnam earned 100 total points
ID: 9689817
You cannot issue distinct or group by statements on image datatypes.
You will need to use writetext function to deal with image datatype.

See example,

http://sybooks.sybase.com/onlinebooks/group-as/asg1251e/sqlug/@ebt-link;pt=28254?target=%25N%15_28709_START_RESTART_N%25;__prev_hit__=28314;__next_hit__=28756;DwebQuery=writetext

0
 
LVL 10

Expert Comment

by:bret
ID: 9704526
Sort of saying the same thing in a different way:

You can't do that in a stored procedure.  If you want to manipulate IMAGE data, your best option is probably to write a simple open client application that can read in the two IMAGE values, concatentate them in a buffer on the client side, then insert the resulting value using writetext.
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9704877
Bret,

I think writetext can be used with stored procedure. Need to get text pointer and then loop thru to insert.
0
 
LVL 15

Expert Comment

by:namasi_navaretnam
ID: 9704881
There are some examples in the link that I specified above.
0
 
LVL 2

Expert Comment

by:mansoor_a_khan
ID: 9722209
you can't concatenate image data type, however as BRET suggested you can use WRITETEXT


Cheers,
Mak
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Here's how to start interacting with our community through Post.
Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

707 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