View previous topic :: View next topic
|
Author |
Message |
tecnokrat Warnings : 1 Active User
Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
Hi,
i'm having an existing update query which needs to be modified to reuse it. so i have to add a CASE statement in it the query i ran in SPUFI is executing but the result is not been modified.
The existing update query is as
Code: |
update abc_table
set abc_1 = :abc-1
abc_2 = :abc-2
where
aaa_1 = :aaa-1
and abb_1 = :abb-1
|
Now I modified the query like
Code: |
update abc_table
set abc_1 = :abc-1
abc_2 = :abc-2
abc_3 = (CASE abc_3 WHEN 'XYZ'
then 'BBB'
else abc_3
end)
where
aaa_1 = :aaa-1
and abb_1 = :abb-1
|
this query in SPUFI says execution successful but the table value is not updated. please help......!!!!! |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Check your SPUFi settings.
Code: |
AUTOCOMMIT ...... ===>,NO |
Change it to YES |
|
Back to top |
|
|
tecnokrat Warnings : 1 Active User
Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
Hi srihari,
The SPUFI settings is
Code: |
AUTOCOMMIT ...... ===> YES |
|
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
Can you show your spufi output? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, stop giving us bullshit.
you could not be running spufi and have
aaa_1 = :aaa-1
and abb_1 = :abb-1
host variables. |
|
Back to top |
|
|
tecnokrat Warnings : 1 Active User
Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
Oh Common...
i knew that spufi does'nt take the host variables....
Code: |
update abc_table
set abc_1 = val1
abc_2 = val2
abc_3 = (CASE abc_3 WHEN 'XYZ'
then 'BBB'
else abc_3
end)
where
aaa_1 = VVV1
and abb_1 = NNN2
|
well the above is the query to be run in the SPUFI |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
well the above is the query to be run in the SPUFI |
which it will not, but that seems to be common behavior for you.
instead of UPDATE, do a SELECT COUNT(*) WHERE
and see if any rows are selected by the WHERE clause for the results table.
also, spufi, when there is no negative sqlcode, will tell you how many rows were updated.
a zero sqlcode from an update only means you managed to get your sql syntactically correct
- something which you have evaded in all your posts in this thread so far. |
|
Back to top |
|
|
tecnokrat Warnings : 1 Active User
Joined: 22 May 2009 Posts: 160 Location: Bangalore
|
|
|
|
sorry, for troubling you all ,Actually the silly mistake i have done was 'WHERE' condition was an improper |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
tecnokrat,
unfortunately, most problems are due to 'silly mistakes', typos, etc...
that is why all the BS questions about what,where and why.
thanks for getting back to us.
my apologizes for any demeaning comments I made.
what you have posted motivates me, in the future, to use more respect in answering your questions.
dbz |
|
Back to top |
|
|
|