• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 741
  • Last Modified:

how do i concatenate two fields of "image" datatype

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
nsujesh
Asked:
nsujesh
  • 3
1 Solution
 
namasi_navaretnamCommented:
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
 
bretCommented:
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
 
namasi_navaretnamCommented:
Bret,

I think writetext can be used with stored procedure. Need to get text pointer and then loop thru to insert.
0
 
namasi_navaretnamCommented:
There are some examples in the link that I specified above.
0
 
mansoor_a_khanCommented:
you can't concatenate image data type, however as BRET suggested you can use WRITETEXT


Cheers,
Mak
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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