Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 2nd, 2006, 08:13 AM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object types and methods

Hi,

I was just trying object methods and types. I wrote the followin piece of code for the object:

CREATE TYPE OBJ_NEW AS OBJECT
(
  X NUMBER(4),
  Y NUMBER(4),
  MEMBER FUNCTION ADDITION RETURN INTEGER
)
/

CREATE TYPE BODY OBJ_NEW AS
MEMBER FUNCTION ADDITION(X INTEGER, Y INTEGER) RETURN INTEGER IS
BEGIN
 return (X + Y);
END;
/

Now, I want to call this function from a program and view the sum. This is how i did it;
DECLARE
   q OBJ_NEW;
BEGIN
   q := OBJ_NEW (6,3);
   q.addition(6,3);
END;

But I am getting this error: "wrong number or types of arguments in call to 'ADDITION'" .. Can you please tell whats wrong in this code?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
two methods different results hahaha568 BOOK: Beginning SQL 0 February 10th, 2008 09:47 AM
METHODS magagulad Java GUI 3 May 15th, 2007 12:53 PM
Dispose() methods bpevangelista BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 2 May 12th, 2007 11:15 PM
Text object methods focus() and select() John K. King Javascript How-To 7 May 9th, 2005 03:12 AM
Properties/Methods Not in Object Browser ritag VS.NET 2002/2003 0 January 13th, 2005 12:59 PM



All times are GMT -4. The time now is 05:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.