473,326 Members | 2,099 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,326 software developers and data experts.

variable datatype returning


Hello,

I have a stored procedure and the return data type is number(16) as you
can see. but I get it back in the code as a var_numeric and then the
precision depends on the value of the returndata. So 0 fits into a short
so I have to convert to a short, although I say that my stored procedure
has to return a NUMBER(16), thus int. Can anyone tell me how I can
determine my return datatype beforehand?

many thanks

CREATE OR REPLACE PROCEDURE ish.applsp_IsForeignKeyProtected

(

cDbd IN VARCHAR2,

cTable IN VARCHAR2,

cFKey IN VARCHAR2,

rc1 IN OUT refcurpkg.rct1

) AS

IsProtected NUMBER(16);

BEGIN

IsProtected := 1;

OPEN rc1 FOR

SELECT IsProtected FROM DUAL;

END;
--
Posted via http://dbforums.com
Jul 19 '05 #1
1 4332
it is very unclear what you are trying to do, especially since the code you
included does not have a valid syntax

strictly speaking, procedures do not have return values (only functions have
return values, but both functions and procedures can have OUT or IN OUT
variables, as in your example) -- so you may be using the wrong construct

the return datatype, or OUT variable datatype, will be whatever you declare
it to be -- if the value you assign to it is of a different datatype (not
recommended, oracle does implicit datatype conversion (also not recommended
in most cased)

i'm guessing that you might be referring to determining return datatypes for
dynamic sql (although that's not apparent from your post), the DBMS_SQL
package has procedures for determining the datatypes returned by SELECT
statements.

at any rate, some clarification on what you're trying to accomplish would be
helpful
--mcs

"thepercival" <me*********@dbforums.com> wrote in message
news:35****************@dbforums.com...

Hello,

I have a stored procedure and the return data type is number(16) as you
can see. but I get it back in the code as a var_numeric and then the
precision depends on the value of the returndata. So 0 fits into a short
so I have to convert to a short, although I say that my stored procedure
has to return a NUMBER(16), thus int. Can anyone tell me how I can
determine my return datatype beforehand?

many thanks

CREATE OR REPLACE PROCEDURE ish.applsp_IsForeignKeyProtected

(

cDbd IN VARCHAR2,

cTable IN VARCHAR2,

cFKey IN VARCHAR2,

rc1 IN OUT refcurpkg.rct1

) AS

IsProtected NUMBER(16);

BEGIN

IsProtected := 1;

OPEN rc1 FOR

SELECT IsProtected FROM DUAL;

END;
--
Posted via http://dbforums.com

Jul 19 '05 #2

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

Similar topics

1
by: Erick Bodine | last post by:
I am trying to set a new environment variable on a W2k machine with only partial success. The name("SSID") and value("ASIM") show up correctly in the registry and when I go to "System...
7
by: Richard Hollenbeck | last post by:
Help! I don't know why this isn't working: Private Sub Combo9_Change() Dim UsersCourseSelection As String UsersCourseSelection = Me("Combo9").Value Combo13.Visible = True 'the following...
1
by: Rippo | last post by:
I am returning a datatable from a stored procedure and then iterating through the columns. I am trying to find out if a column has the sql data type of ntext. In .net the datatype of a sql ntext...
1
by: Meelis Lilbok | last post by:
Hi Still cant resolve problem, how to get datatype and properties for field. If if fill DataSet from SQL Database how can i a) Get DataType for specified field b) Get Allow null (if i read...
14
by: Matt | last post by:
I need to add the following variable into an SQL statement and not sure how to do it. strGCID needs to be inserted into the following statement: SQL = "SELECT tblContacts.* FROM tblContacts...
64
by: shaanxxx | last post by:
I have code which says #define MYBOOL int This code is very old. people who have written is not avaible. I was thinking what could be reason. 1) bool datatype was not available that time (10...
1
by: veaux | last post by:
I'm using Access query and have to spit out a text file to load into a 3rd party program. The text file has to include quotes (" ") around certain infomation. The string I have is below. ...
7
by: ltarrant | last post by:
Hi, I'm having problems with a DataTable I'm storing in a session variable. I use this as a temporary store for a shopping cart until a customer goes through the checkout and the cart is saved to my...
1
by: thepercival | last post by:
Hello, I have a stored procedure and the return data type is number(16) as you can see. but I get it back in the code as a var_numeric and then the precision depends on the value of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.