473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problems Converting T-SQL code to SQL PL

I have the following T-SQL code:

SELECT @ErrorDiagInfo = name + ': ' + @ErrorDiagInfo
FROM sysobjects WHERE id = @@PROCID

How can you return a stored procedure identifier in DB2?

Another question:

In T-SQL I have the following:

BEGIN TRAN x
--update code goes here
IF ERROR<> 0
ROLLBACK TRAN x

DB2 errors out with "A rollback to to a savepoint or a named BEGIN
TRANSACTION is not supported."

I know DB2 has a SAVEPOINT command and a BEGIN ATOMIC ... END. Which would
be a better solution here?

Thanks for your help.

Adamco
Nov 12 '05 #1
3 3025

"Adam Greifer" <ag******@adamzapple.com> wrote in message
news:4_dPb.106842$I06.614565@attbi_s01...
I have the following T-SQL code:

SELECT @ErrorDiagInfo = name + ': ' + @ErrorDiagInfo
FROM sysobjects WHERE id = @@PROCID

How can you return a stored procedure identifier in DB2?

Another question:

In T-SQL I have the following:

BEGIN TRAN x
--update code goes here
IF ERROR<> 0
ROLLBACK TRAN x

DB2 errors out with "A rollback to to a savepoint or a named BEGIN
TRANSACTION is not supported."

I know DB2 has a SAVEPOINT command and a BEGIN ATOMIC ... END. Which would
be a better solution here?

Thanks for your help.

Adamco

Do you have an SQL Reference manual? Try looking at the concat function.
Nov 12 '05 #2
This question hasn't been asked in a while:
http://groups.google.ca/groups?q=pro...ibm.com&rnum=1
the procid is served up in DBINFO.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #3
Serge Rielau <sr*****@ca.eye-bee-m.com> wrote:
This question hasn't been asked in a while:
http://groups.google.ca/groups?q=pro...ibm.com&rnum=1 the procid is served up in DBINFO.


And here is an article describing how you can implement the function along
with a bunch of various scenarios where it might be used:

http://www-106.ibm.com/developerwork...302stolze.html

The download in that article contains the C code and the compiled libraries
for pretty much all the different platforms DB2 runs on. There is also a
Java version available.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jørgen Cederberg | last post by:
Hi, using Python 2.2.1 on Windows and QNX I'm having trouble understandig why int() raises a ValueError exception upon converting strings. >>> int('-10') -10 >>> int('10') 10 >>> int(10.1)
12
by: Anna | last post by:
Hi all, I posted the same question this afternoon but my message isn't showing up, so I thought I'd give it another try.... in case you should see it later I apologize for posting the same...
4
by: B. Fletcher | last post by:
Hi, I'm having some trouble with javascript code of mine: When the script runs, I vget an error in line 119: Number Expected. I'm not sure as to why this is happening. Any advice would be...
4
by: David | last post by:
Hi, I want to work with Access 2002. I will need to be able to distribute my application to users that may still have access 2000 on their computers. I know access 2002 has a function that...
1
by: Juli | last post by:
I am converting a db from 97 to 2002. I have a very simple Find Macro from 97- consists of RunCommand: Find SendKeys: %h{up}%e%n After the conversion.... If I try to run the macro from the...
5
by: Dan Smith | last post by:
When I try to create a new C# Web Reference in Visual Studio 2003, I get an error message "The proxy settings on this computer are not configured correctly for web discovery. ..." This web...
2
by: Map Reader | last post by:
Greetings, I am converting an old VB6 application to use .NET. One of the old controls loads icons from the disk and displays them. However, the transparent color turns to blue somewhere in the...
5
by: | last post by:
Can someone help me on a format problem. I am trying to do this.. format a string to a number. The string has a number with a colon in the middle. Format("1:30","00:00") returns 00:00 instead...
1
by: kirsc001 | last post by:
Reading numbers from file into two strings, converting to int using atoi so I can use addition. Now I need to convert back to strings. I can't find a way to converting the ints that I just created...
3
jmoudy77
by: jmoudy77 | last post by:
Hi, I've built a database in XP and when trying to run it on a machine with office 2003 I get a bunch of reference and library problems. Does 2003 not include the same references and libraries that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.