dbTalk Databases Forums  

debug with message statement

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss debug with message statement in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kevin Saegerman
 
Posts: n/a

Default debug with message statement - 01-11-2010 , 08:38 AM






I'm able to debug a stored procedure with the message-statement in Sybase
Central. The messages are displayed in the console window.
example: message 'step 1' type info to console;

But it doesn't seem to work if I call the stored procedure from a
vb-application.
Which parameter settings do I need to use?

regards,

Kevin Saegerman

Reply With Quote
  #2  
Old   
Jeff Albion [Sybase iAnywhere]
 
Posts: n/a

Default Re: debug with message statement - 01-11-2010 , 10:01 AM






Hi Kevin,

Please post the build and version you're using (e.g. dbsrv11 -v).

Please post your existing code and describe the behaviour you're
currently observing. Once we have those details, we will hopefully be
able to point you in the right direction.

Regards,

On 1/11/2010 8:38 AM, Kevin Saegerman wrote:
Quote:
But it doesn't seem to work if I call the stored procedure from a
vb-application.
Which parameter settings do I need to use?
--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

Reply With Quote
  #3  
Old   
Kevin Saegerman
 
Posts: n/a

Default Re: debug with message statement - 01-11-2010 , 10:25 AM



I'm using Sybase 11 build 2222.

I'm trying to debug a stored procedure with the message-statement

message 'step 1' type info to console;

So this works from Sybase Central, but it doesn't work if I call it from
somewhere else, for example vb-application or report.



"Jeff Albion [Sybase iAnywhere]" <firstname.lastname (AT) ianywhere (DOT) com> wrote in
message news:4b4b3d48$1 (AT) forums-1-dub (DOT) ..
Quote:
Hi Kevin,

Please post the build and version you're using (e.g. dbsrv11 -v).

Please post your existing code and describe the behaviour you're currently
observing. Once we have those details, we will hopefully be able to point
you in the right direction.

Regards,

On 1/11/2010 8:38 AM, Kevin Saegerman wrote:
But it doesn't seem to work if I call the stored procedure from a
vb-application.
Which parameter settings do I need to use?

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation :
http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

Reply With Quote
  #4  
Old   
Jeff Albion [Sybase iAnywhere]
 
Posts: n/a

Default Re: debug with message statement - 01-11-2010 , 10:27 AM



Kevin,

Can you please post the VB code you're trying? I understand the MESSAGE
statement you're using - how are you executing it in VB?

Regards,

On 1/11/2010 10:25 AM, Kevin Saegerman wrote:
Quote:
So this works from Sybase Central, but it doesn't work if I call it from
somewhere else, for example vb-application or report.
--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

Reply With Quote
  #5  
Old   
Kevin Saegerman
 
Posts: n/a

Default Re: debug with message statement - 01-11-2010 , 11:12 AM



cmdproc.CommandType = adCmdStoredProc
cmdproc.CommandText = UCase(strProcedureName)

Dim rsExcel As New ADODB.Recordset

Set rsExcel = cmdproc.Execute(100, arrCRParams, adAsyncFetch)


"Jeff Albion [Sybase iAnywhere]" <firstname.lastname (AT) ianywhere (DOT) com> wrote in
message news:4b4b4376$1 (AT) forums-1-dub (DOT) ..
Quote:
Kevin,

Can you please post the VB code you're trying? I understand the MESSAGE
statement you're using - how are you executing it in VB?

Regards,

On 1/11/2010 10:25 AM, Kevin Saegerman wrote:
So this works from Sybase Central, but it doesn't work if I call it from
somewhere else, for example vb-application or report.

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation :
http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

Reply With Quote
  #6  
Old   
Jeff Albion [Sybase iAnywhere]
 
Posts: n/a

Default Re: debug with message statement - 01-11-2010 , 01:50 PM



Hi Kevin,

This is an incomplete code sample. When submitting issues to the
newsgroup in the future, it is important that you provide as much
information as possible in order for people to best help you. Many
people that monitor this newsgroup have limited time to investigate
issues, so having a succinct, accurate description of an issue is very
important for a resolution.

---

Quote:
cmdproc.CommandType = adCmdStoredProc
This sets the RecordSet to expect a single *stored procedure* name as a
query to execute. This type cannot execute arbitrary SQL queries (e.g.
you cannot use the MESSAGE statement directly using this CommandType).

Here's how to use adCmdStoredProc, normally:

cmdproc.CommandType = adCmdStoredProc
cmdproc.CommandText = "sa_conn_info"
....

---

Instead, you need to set the query type to "adCmdText" for arbitrary SQL
queries that return RecordSets:

cmdproc.CommandType = adCmdText
cmdproc.CommandText = "select GivenName, Surname from Customers"
....

Finally, the MESSAGE SQL statement is a type of statement that does not
return a result set, so it should just be executed by itself without
expecting a result set. Instead, just try:

=========
Dim msgConsoleStmt As New ADODB.Command
msgConsoleStmt.CommandText = "message 'step 1' type info to console;"
msgConsoleStmt.Execute()
=========

Regards,

On 1/11/2010 11:12 AM, Kevin Saegerman wrote:
Quote:
cmdproc.CommandType = adCmdStoredProc
cmdproc.CommandText = UCase(strProcedureName)

Dim rsExcel As New ADODB.Recordset

Set rsExcel = cmdproc.Execute(100, arrCRParams, adAsyncFetch)
--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/libr...ere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.