Solved

how do i concatenate two fields of "image" datatype

Posted on 2003-11-04
7
672 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sybase sql anywhere unload database 3 805
Cannot view sybase SCC in browser using Linux 5 1,789
Can I use dynamic SQL in a function for a COLUMN NAME 6 640
Sybase environment variable 1 184
Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

15 Experts available now in Live!

Get 1:1 Help Now