Solved

Sybase Update Image Columns

Posted on 2012-03-21
3
695 Views
Last Modified: 2012-03-21
We have an urgent problem that we need to resolve and our Sybase experience is limited.

Table structures are as follows:

Table T1:
C1 numeric(18)
C2 image
C3 int
C4 varchar

Table T2:
C1 numeric(18)
C2 image

Sequence of events are as follows:

1. Application A inserts the following record into T1 (1,null,5,'junk')
2. Application B inserts the following record into T2 (1,<an jpeg image>)
3. After step #2 happens, we need a trigger on T2 to fire that will UPDATE T1.C2 with the contents of T2.C2.  We have no issues getting this to work with numeric or varchar columns, but we haven't had any luck getting it to work for the image columns.

Any help would be greatly appreciated.

Thanks
0
Comment
Question by:stuntman2625
  • 2
3 Comments
 

Author Comment

by:stuntman2625
ID: 37748796
I should also add we're using Sybase ASE 15.0.3
0
 
LVL 13

Accepted Solution

by:
alpmoon earned 500 total points
ID: 37749139
Have you tried something like below?

create trigger trig1 on T2 for insert
as
  update T1
        set T1.C2 = T2.C2
     from T2
   where T1.C1 = T2.C1
0
 

Author Closing Comment

by:stuntman2625
ID: 37749522
Actually, I just found out my problems were as a result of using some Oracle specific syntax.  But your post led me down a different path which eventually solved my problem.  Thanks!
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

There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

14 Experts available now in Live!

Get 1:1 Help Now