Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Dudes! Great site. You've saved me hours and hours...and I have just started using your site. I've already passed your URL onto my entire company. Keep up the awesome work. Bingo-bango..."

Geography

Where in the world do Tek-Tips members come from?

Error when trying to copy columns using stored procedure

limester (TechnicalUser)
12 May 06 9:25
Hi,

I am using Sybase v11.x.  I am trying to copy from one
column to another column in a stored procedure as follows:

UPDATE tbl1
SET column1 = (select column2 from tbl2 where @variable =
variable)
WHERE @parameter = parameter

Everything is declared approriately.

The problem seems to be the datatypes TEXT for both column1
and column2, the error I get is:
"The ONCE AGGREGATE operation cannot take a TEXT datatype as
an argument."

I cannot covert these to other data types and they will
always be longer than 255 characters.

Does anyone know a way I can get around this? (apart from
using version 12.x where I can convert/cast and > 255
characters)

Thanks!
limester (TechnicalUser)
12 May 06 12:23
Seems the fact of encapsulating the subquery in brackets I am creating a local variable which is a TEXT datatype and not allowed in this case.

Instead I:

UPDATE tbl1
SET tbl1.col1 = tbl2.col1 from tbl2
WHERE @param = tbl1.col2 and @param = tbl2.col2

Cheers

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close