473,657 Members | 2,453 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_IsFo reignKeyProtect ed

(

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 4364
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

"theperciva l" <me*********@db forums.com> wrote in message
news:35******** ********@dbforu ms.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_IsFo reignKeyProtect ed

(

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
3819
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 Properties"->Advanced->"Environment Variables". However, if I open a console and type 'set', "SSID" is not listed; also if I open a python shell and do os.environ the variable is not found. What am I doing wrong??? import _winreg
7
4287
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 SQL thing is all on one line in the actual code.
1
1986
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 column is System.String. .Net also returns System.String for varchar, char, text, nvarchar and nchar. This obviously does not help me as I want to identify the ntext column I have searched for this and cannot find the answer in .net. I can...
1
3273
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 AllowDBNull this returns always True)
14
3090
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 INNER JOIN tblGC ON tblContacts.GCID = tblGC.gcID WHERE (((tblContacts.GCID)=strGCID))" i am just not sure of the proper syntax.
64
3861
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 years back: correct me if i am wrong) 2) int was word aligned (16bit and 32bit). Writter of above code doesnt want to give choice to compiler.
1
3075
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. CustomAttributes: "<xml><CustomAttribute Name=""Disenrollment Reason Code""' Value=" & "" & " DataType=""TXT"" /> My question is how do I include quotes around the field so that it returns the value included in double
7
2690
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 database. I have used DataTables stored in sessions before for shopping baskets with no problems. However, on this occasion I am only passing the AddHandler the product id and the quantity being added. The Handler then calls a getProductDetail...
1
165
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 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?
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.