Capture Error Message in Store Procedure

In "isql", when sql error, we can see the the code and message immediately.

In store procedure, after the sql, I can get the code by @@error , but how
can I get the message at the same time because it is more helpful for
troubleshooting.

Thanks.

Summer


0
Summer
8/22/2003 9:07:37 AM
sybase.ase.general 8655 articles. 0 followers. Follow

2 Replies
907 Views

Similar Articles

[PageSpeed] 21

How do you run this stored proc? I mean which application you use for
running a stored proc?
Regards.
"Summer" <xzhang8@fedex.com> wrote in message news:3f45dd7a@forums-2-dub...
> In "isql", when sql error, we can see the the code and message
immediately.
>
> In store procedure, after the sql, I can get the code by @@error , but how
> can I get the message at the same time because it is more helpful for
> troubleshooting.
>
> Thanks.
>
> Summer
>
>


0
ALPER
8/22/2003 10:15:56 AM
try this

use tempdb
go
create table #t1 (
col1 int,
constraint t1_pk primary key (col1)
)
go

insert into #t1 values ( 1)
if @@error <> 0 raiserror @@error
insert into #t1 values ( 1)
if @@error <> 0 raiserror @@error
go

drop table #t1
go

"ALPER ONEY" <aoney@takasbank.com.tr> wrote in message
news:3f45ed7a@forums-2-dub...
> How do you run this stored proc? I mean which application you use for
> running a stored proc?
> Regards.
> "Summer" <xzhang8@fedex.com> wrote in message
news:3f45dd7a@forums-2-dub...
> > In "isql", when sql error, we can see the the code and message
> immediately.
> >
> > In store procedure, after the sql, I can get the code by @@error , but
how
> > can I get the message at the same time because it is more helpful for
> > troubleshooting.
> >
> > Thanks.
> >
> > Summer
> >
> >
>
>


0
Nirav
8/22/2003 5:31:29 PM
Reply:

Similar Artilces:

How to capture the output message from stored procedure with ASE ??
Dear all, someone know if it's possible to capture the message from stored procedures eg: (17 rows affected). I have a sp that insert 17 rows in a table, i would like to tell to pb program how many rows are inserted. TIA Roberto I am sorry, i have reposted on general section. R.Lammoglia "Roberto Lammoglia" <NOSPAMrlamm@becromal.it> wrote in message news:3f991646@forums-2-dub... > Dear all, > someone know if it's possible to capture the message from stored procedures > eg: (17 rows affected). > > I have a sp that insert 17 ...

error message does not show error when used with stored procedure...help!
i've two labels which is used to display success and failed messages. but when user enters wrong userID or email, the label for success msg appears. it should be the fail message label appearing and not the success message label... below are my codes and stored procedure... Private Sub btnShow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShow.Click Dim objcmd As New OleDbCommand Dim dbConn As OleDbConnection Dim myDataReader As OleDbDataReader ' Try dbConn = connectToDB() Dim objparam As ...

Stored Procedures Error Message
Hello, I am running a stored procedure, and get a error message "The instruction at XXXXXX referenced memory at ######. The memory could not be read". The environment is: Windows 2000/ ASA 6.0.3 build 2747. Does anyone know the reason and how to fix it? Thanks a lot, Zhijiang FYI, this question would have been better suited to the general newsgroup. Which application is given the GPF? The engine, dbremote, your application? According to the Supported Platforms and Support Status web page (http://my.sybase.com/detail?id=1002288) in order to run ASA603 on Win...

multiple error messages from stored procedure ?
I wonder if it is possible to retrieve several error messages from a stored procedure... In my scenario I'm executing SP which processes a batch. Some of the processes may have "warnings", which are coded with help of RAISERROR. Accessing the SQLCA.DBCode and SQLCA.SQLErrText I can see only one of them ( I'm not sure if it's the first or the last one ), but is there a way of retrieving them all ? I have workaround - instead of using RAISERROR I can populate my warnings into a temp table and select them at the end of the execution, I'm just curious if any of yo...

Custom error messages in stored procedures
Is there a way to capture a system database error message in order to combine it with a custom error message generated with RAISERROR ? Thanks. Hello, Felipe! You wrote on 22 Aug 2003 13:21:50 -0700: FG> Is there a way to capture a system database error message in order FG> to combine it with a custom error message generated with RAISERROR ? FG> Thanks. It's impossible. You can only replace or append the text of the message in master..sysmessages, but you can't do this for every particular case of this error, youn can't add you own parameters and thi...

Trapping error message within stored procedure
Is there a way to trap the message associated to an sqlcode and/or sqlstate? Within a stored procedure I would like to build the error message that is returned on a bad sqlcode. In this error message, I would like to include sybase's message along with some additional information regarding the statement that caused the error. Does anyone have any ideas on how I can do this? Thanks in advance. Linda Butler This can be accomplised using the ERRORMSG function in version 8 For more information see Adaptive Server Anywhere SQL Reference Manual 3. SQL Functions Al...

How to capture rows affected number from Stored Procedure with ASE ??
Dear all, someone know if it's possible to capture the message from stored procedures eg: (17 rows affected). I have a sp that insert 17 rows in a table, i would like to tell to pb program how many rows are inserted. TIA Roberto Begin DECLARE @rc integer INSERT blah into tBLAH select @rc = @@rowcount SELECT '(' + string( @rc ) + ' rows affected)' End -- Paul Horan[TeamSybase] Get the new PB9 books! http://www.pb9books.com?source=newsgroups Code samples on Sybase CodeXchange: http://codexchange.sybase.com ISUG Enhancemen...

Need help figuring out error messages from stored procedure
I was wondering if someone can help me debug this stored procedure. It has been one of those 15 hour developer days we all dread and I need some help with this. Can anyone spot what the errorsare in my stored procedure below. I listed the error messages also. USE [Mikcustomer]GO /****** Object:  StoredProcedure [dbo].[InsertRow]    Script Date: 08/14/2008 13:10:19 ******/ SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOCREATE PROCEDURE [dbo].[UpdateRowInCustomerTable](      @CustomerID int,      @FirstName  varchar(10...

Make error message parameters visible to stored procedures
Please provide a way for a stored procedure to get the same error information available through ODBC. For example, if a stored procedure is doing inserts, and a foreign key violation occurs, as far as I know, there's no way to tell which column had the offending value. This information could be very useful. Thanks, -Eric ...

How to capture the general failure error message generated by the PassWordRecovery control
If a general failure occurs with the PassWordRecovery control, it doesn't seem like their is a way to deteremine what went wrong.  The only indication that an error occurred is the fact that the GeneralFailureText is displayed.  Is there a way to capture this exception and log it so that I can determine why this exception occurs?  You would think their would be a GeneralFailureError event since there is a UserLookupError and AnswerLookupError event.  Any help would be greatly appreciated.  Jason Hi Jason and welcome to www.ASP.net Here is resolv...

Powebuilder 8 error message when declaring stored procedure with output parameters
Hi All, I have recently migrated from PB 6.5 - PB 8 and when creating a function which has the following declaration I get the below message. A message I did not get in PB6.5 ERROR = Cant use the output option when passing a constant to a stored procedure DECLARE sp_media_preview_select PROCEDURE FOR sp_media_preview_select @item = :al_item, @source_ref = :gi_source_ref out, @preview_path = :gs_preview_path out, @preview_high = :gs_preview_high out, @preview_med = :gs_preview_med out, @preview_low = :gs_preview_low out, @path = :gs_path out...

Stored Procedure Parameter Supplied But Error Messages Says It's Not
I keep getting this error on one of my pages when trying to do an update to the table via a stored procedure: *System.Data.SqlClient.SqlException: Procedure or function 'sp_u_contractor_references' expects parameter '@p_contractorrfid', which was not supplied  I have verified that I am adding this parameter and that the spelling is correct. I have also made sure that the value is not NULL.  I'm confused as to what else the problem could be. Any ideas?http://www.krissteele.net - http://www.steeleits.com - http://www.evilscale.com - http://www.starcraftlive.ne...

Powebuilder 8 error message when declaring stored procedure with output parameters
Hi All, I have recently migrated from PB 6.5 - PB 8 and when creating a function which has the following declaration I get the below message. A message I did not get in PB6.5 ERROR = Cant use the output option when passing a constant to a stored procedure DECLARE sp_media_preview_select PROCEDURE FOR sp_media_preview_select @item = :al_item, @source_ref = :gi_source_ref out, @preview_path = :gs_preview_path out, @preview_high = :gs_preview_high out, @preview_med = :gs_preview_med out, @preview_low = :gs_preview_low out, @path = :gs_path out...

Error Binding Listbox Using Stored Procedure: Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).
Error when binding Listbox Using Stored Procedure: Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).If I removed the stored procedure and enter the same query that is in the stored proc it works fine.  If I bind the control manually to the stored proc it works fine.  What am I missing? This Fails with the error:<asp:SqlDataSource                 ID="sqlDsTopics"                 runat="server"     &n...

Web resources about - Capture Error Message in Store Procedure - sybase.ase.general

Invasiveness of surgical procedures - Wikipedia, the free encyclopedia
There are three main categories which describe the invasiveness of surgical procedures . These are: non-invasive procedures , minimally invasive ...

Procedure is more a snap than a snip
A QUEENSLAND doctor is bidding to set an unusual world record by performing the highest number of vasectomies in one day, with the help of fellow ...

Rushed cosmetic procedures a 'recipe for disaster'
&#8203;When Chanelle O'Hare went searching online for a deal on potential cosmetic procedures, she could not have imagined that what she ended ...

Jetstar procedures under investigation after planes took off too heavy
Jetstar's procedures for calculating the weight of its aircraft are under review by the Australian Transport Safety Bureau after two of its planes ...

NFL Announces Changes to Officiating Procedures for Playoffs - Bleacher Report
The NFL formally approved changes to its postseason officiating procedures to allow referees the opportunity to consult Vice President of Officiating ...

Will Paul Ryan Make His Mark As Speaker By Instituting Impeachment Procedures Against President Obama ...
Wisconsin Ayn Rand devotee Paul Ryan just started his new job as Speaker of the dysfunctional House Republicans. And he's already headed for ...

NFL security procedures in question after rappelling protesters
Two protesters with sophisticated gear disrupted the Panthers-Colts game in Charlotte Monday night, bringing into question security at the stadium ...

'Painless' dental cavity procedure regrows tooth enamel
... "cavity" a lot of people sweat thinking about painful injections and relentless drilling. But scientists in Britain have developed a new procedure ...

'Daily Show' Host Trevor Noah Hospitalized for Emergency Procedure
'Daily Show' Host Trevor Noah Hospitalized for Emergency Procedure

Why Are Web Login Security Procedures So #$*&!% Dumb And Obnoxious?
The geeks who design our websites talk a lot about user friendliness, but they often let an exaggerated security concerns get in the way of commonsense. ...

Resources last updated: 12/21/2015 12:16:13 AM