how to return return value?

imagine there was an sp beyond your control (i.e. you cannot use output
parameters to obtain the value)
but you had to catch the return value submitted by "return <value>"
how would you do that?
execute returns boolean
executeUpdate returns int, but obviously not the return value but rows
affected or so
what the..?
--
pat




0
patrick
4/7/2003 5:27:12 PM
sybase.jconnect 798 articles. 0 followers. Follow

2 Replies
1317 Views

Similar Articles

[PageSpeed] 27
Get it on Google Play
Get it on Apple App Store

Hello Pat,

For the return value you wills till need to register it as an output
parameter,
no matter how you execute the sproc.

You would need to send the SQL as something like:

{? = call sprocName(?, ?, ....)}

The for the return value (first "?"):

stmt.registerOutParameter(1, java.sql.Types.INTEGER);
execute it  ( stmt.executeUpdate )
/ Get parameter #1 (the return status)
            System.out.println("Call return code = " + stmt.getInt(1));


This should work for you..

pv


patrick wrote:
> 
> imagine there was an sp beyond your control (i.e. you cannot use output
> parameters to obtain the value)
> but you had to catch the return value submitted by "return <value>"
> how would you do that?
> execute returns boolean
> executeUpdate returns int, but obviously not the return value but rows
> affected or so
> what the..?
> --
> pat
0
odbcpse
4/8/2003 2:47:15 PM
Look in the sample2 directory as there are several samples such as 
MyCallable.java (of the top of my head) which demo this.


-lance
0
lance
5/8/2003 4:30:11 PM
Reply:

Similar Artilces:

Returning value from return dialog
Hi, I want to execute a confirm dialog from in my code behind.  A user clicks the submit button and then they check for a field.  If the field isnt in the database I want to query the user and ask if they want to add that item to the database.  I am not sure I know how to capturethe boolean return value. it will look something like this:btn_onclick(....) handles btn.click....if field emptyshowConfirmDialog()... where my confirmDialog method will be as follows.  For your question,I think you should look up the field to check if the field is in the database.If n...

App.Config returning null values in Windows Services but returns right values in Windows Application.
Hi All, I have created an Windows Service where I am using App.Config for global variables. But, it is always returning null values (string xyz=ConfigurationSettings.AppSettings["abc"]) for all the variables I have declared in App.Config. (But the same thing if I am doing as a Windows Application then it's returning the right values.) Interestingly, this same Windows Service is working properly in another machine but not working in other three machines. Can anyone please help me to resolve this issue. Thanks a lot. Regards, Lita. Since this is a Windows service, I recommend yo...

Stored Procedure only returns 1 value when it should return 7
Hello. I have a web page where i would like to fill a detailsview with some statistics from my database. I tried creating a stored procedure in the sql management studio and when i ran the query it seemed to return 7 values. However when i hook up my SP to a SqlDataSource and bind it to a gridview the datasource is only populated with the first value "ANTAL". What i would like to get is 7 values to bind in my detailsview. Bellow is my SP: CREATE PROCEDURE GetStats AS BEGIN SELECT COUNT(COUNTER) AS ANTAL FROM ARTIKEL SELECT COUNT(DISTINCT PLATS) AS ETABLERINGAR FROM ART...

Store Procedure never returns expected return value
Hi, I am having a SP as following: .... @ai_return int output as .... select @ai_return = 0 update AAA set A = "AAA" if @@error <> 0 begin select @ai_return = -1 return end .... But even the UPDATE statement fails, I can't get the -1. This might depend upon which DBMS you are using and how you are invoking the sp and how you are trying to get the output parm. Can you post some info related to the above? steve [TeamPS] Sherwin wrote: > > Hi, > > I am having a SP as following: > ... > @ai_return ...

Return "hello" Return more than one value...
Hello: I have a page that includes a component... The component has a function in that uses the following statement to return a value: Return "hello"... Then on my main page I would do something like thisIf myComponenet.DoSomething = "hello" Then response.write("hello") End If How can I use that same component that I made to return more than one value? I know that this can be done by using the Return keyword and returning XML data that has all the info in it... but is there a more simpler way of doing this?Need ASP.NET web hosting? Private ...

WebMethod returns undefined, yet return value in response?
I'm fairly new to Asp.net/Ajax/javascript, as I'm coming from a winforms world, so please bear with me. I'm working on a prototype of an Asp.net page combining existing Ajax controls with some custom WebMethod and javascript functionality on the aspx page.  I've written a static WebMethod which returns a simple string value.  I then call the WebMethod from javascript placed directly within the <script> tag on the .aspx page.  I've got the javascript to call the method using "var myValue = PageMethods.MyFunction();", however when I try and us...

How to Return SqlDataReader and return value (page count) from SPROC
This is my function, it returns SQLDataReader to DATALIST control. How to return page number with the SQLDataReader set ? sql server 2005, asp.net 2.0     Function get_all_events() As SqlDataReader         Dim myConnection As New SqlConnection(ConfigurationManager.AppSettings("..........."))         Dim myCommand As New SqlCommand("EVENTS_LIST_BY_REGION_ALL", myConnection)         myCommand.CommandType = CommandType.StoredProcedure      ...

Return single val (max) and supressing the return value
 Hi I have a sproc: select max(p.papernumber)as "MaxPaperId" from ksg_publications pwhere p.pubtype = 'rp' and PaperYear = YEAR (GETDATE()) and p.statuscd = 'app' or p.statuscd = 'sub'That correctly returns the max id for my papers.  But it also gives me a return value of 0.  I'm writing in vbnet and the class keeps picking up the '0' of the return val. Anyway for me to make the return value the maxpaperid? Try to add at the top SET NOCOUNT ONBeware of bugs in the above code; I have only proved it correct, not tried ...

superreview requested: [Bug 242208] JavaScript strict warning in mailWindowOverlay.js: function MsgOpenFromFile does not always return a value : [Attachment 147397] removing useless return values
Karsten "Mnyromyr" D�sterloh <mnyromyr@tprac.de> has asked David Bienvenu <bienvenu@nventure.com> for superreview: Bug 242208: JavaScript strict warning in mailWindowOverlay.js: function MsgOpenFromFile does not always return a value http://bugzilla.mozilla.org/show_bug.cgi?id=242208 Attachment 147397: removing useless return values http://bugzilla.mozilla.org/attachment.cgi?id=147397&action=edit ...

superreview cancelled: [Bug 242208] JavaScript strict warning in mailWindowOverlay.js: function MsgOpenFromFile does not always return a value : [Attachment 147397] removing useless return values
Karsten "Mnyromyr" D�sterloh <mnyromyr@tprac.de> has cancelled Karsten "Mnyromyr" D�sterloh <mnyromyr@tprac.de>'s request for superreview: Bug 242208: JavaScript strict warning in mailWindowOverlay.js: function MsgOpenFromFile does not always return a value http://bugzilla.mozilla.org/show_bug.cgi?id=242208 Attachment 147397: removing useless return values http://bugzilla.mozilla.org/attachment.cgi?id=147397&action=edit ...

superreview cancelled: [Bug 270342] In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" :
neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com> has cancelled Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 270342: In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=270342 Attachment 166201: (Av1) <threadPane.js> https://bugzilla.mozilla.org/attachment.cgi?id=166201&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil.parkw...

superreview granted: [Bug 270342] In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" : [
David Bienvenu <bienvenu@nventure.com> has granted Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 270342: In <threadPane.js>, "Warning: function MsgSortThreadPane does not always return a value" and "Warning: function MsgToggleThreaded does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=270342 Attachment 168078: (Av2b) <threadPane.js> https://bugzilla.mozilla.org/attachment.cgi?id=168078&action=edit ...

superreview granted: [Bug 294989] In <editorInlineSpellCheck.js>, 4 "Warning: anonymous function does not always return a value" : [Attachment 186968] trivially remove all unused return values
Dan Mosedale <dmose@mozilla.org> has granted Karsten "Mnyromyr" D�sterloh <mnyromyr@tprac.de>'s request for superreview: Bug 294989: In <editorInlineSpellCheck.js>, 4 "Warning: anonymous function does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=294989 Attachment 186968: trivially remove all unused return values https://bugzilla.mozilla.org/attachment.cgi?id=186968&action=edit ------- Additional Comments from Dan Mosedale <dmose@mozilla.org> sr=dmose ...

superreview requested: [Bug 294989] In <editorInlineSpellCheck.js>, 4 "Warning: anonymous function does not always return a value" : [Attachment 186968] trivially remove all unused return values
Karsten "Mnyromyr" D�sterloh <mnyromyr@tprac.de> has asked Dan Mosedale <dmose@mozilla.org> for superreview: Bug 294989: In <editorInlineSpellCheck.js>, 4 "Warning: anonymous function does not always return a value" https://bugzilla.mozilla.org/show_bug.cgi?id=294989 Attachment 186968: trivially remove all unused return values https://bugzilla.mozilla.org/attachment.cgi?id=186968&action=edit ------- Additional Comments from Karsten "Mnyromyr" D�sterloh <mnyromyr@tprac.de> All these return values are unused and can be remove...

Web resources about - how to return return value? - sybase.jconnect

Sample return mission - Wikipedia, the free encyclopedia
A sample return mission is a spacecraft mission with the goal of returning tangible samples from an extraterrestrial location to Earth for analysis. ...

Jarryd Hayne inches closer to return for San Francisco 49ers
... US and Australian journalists alike for the past two months. But now, more than ever, Jarryd Hayne&nbsp;is within touching distance of a return ...

Australia v West Indies: Fifteen years after Boxing Day delight, 'Funky' Miller returns to MCG
When the players run out on the MCG on Saturday it will mark 15 years since one of Australia's most unlikely and unconventional Test cricketers ...

Andrew Bogut puts back issues behind him in return performance against Utah Jazz
... Day clash with the Cleveland Cavaliers. Oakland, California Andrew Bogut showed he has recovered from back tightness with an energetic return ...

Pope Francis urges return to essential values during Christmas Eve Mass
Pope Francis leads the world's 1.2 billion Roman Catholics into Christmas.

Pope on Christmas Eve urges return to essential values
... 1.2 billion Roman Catholics into Christmas on Thursday, urging people concerned with superficial appearances and their possessions to return ...

'Star Wars' animator says 'I took LSD' while working on 'Return of the Jedi'
... his work, Tippett admits he was under the influence for at least one of the "Star Wars" movies. "I took LSD when I was working on 'Return of ...

Pope urges return to simplicity in Christmas message
... billion Roman Catholics into Christmas on Thursday, urging those &quot;intoxicated&quot; by possessions and superficial appearances to return ...

'Tis the season to return your gifts
The holidays aren't even over yet and shoppers are planning their gift returns.

Pope, on Christmas, urges return to essential values
CNN Pope, on Christmas, urges return to essential values CNN Vatican (Reuters) — Pope Francis led the world's 1.2 billion Roman Catholics ...

Resources last updated: 12/26/2015 9:01:52 AM