Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
| 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
 
Old March 21st, 2007, 12:43 PM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Package Body Problem

Hi,

I hope someone can give some help to resolve this problem. I am trying to create a package that encapsulates a stored procedure to return the results to the user.

It is very simple and my understanding is if you specify a parameter as being OUT then this means the program requires no input from the user to work but using this code:

CREATE OR REPLACE PACKAGE tables
IS
  TYPE CURSOR_TYPE IS REF CURSOR;
  PROCEDURE viewColumnsFor (out_columns OUT CURSOR_TYPE);
END;
/
CREATE OR REPLACE PACKAGE BODY tables
IS
  PROCEDURE viewColumnsFor (out_columns OUT CURSOR_TYPE)
    IS
    BEGIN

    OPEN out_columns FOR
         SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, NULLABLE, DATA_DEFAULT
         FROM USER_TAB_COLUMNS
         WHERE TABLE_NAME = 'STRINGS';
    END;
END;
/

I based this off of an example and all it is supposed to do in this case is return certain columns from the USER_TAB_COLUMNS table for the TABLE_NAME STRINGS.

But when I execute the package

EXEC TABLES.viewColumnsFor

I get this error:

ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'VIEWCOLUMNSFOR'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

What am I doing wrong? I am used to writing procedures in MSSQL and it is much simpler to me but I want to learn the correct way to do this in ORACLE.

It looks like its still expecting an input variable though I didn't specify it in the procedure.

help plz




Similar Threads
Thread Thread Starter Forum Replies Last Post
package and import problem Prince Java Basics 0 May 29th, 2006 06:49 AM
Package Problem (ActiveX) bmains SQL Server DTS 4 May 31st, 2005 08:35 AM
Package problem dglnz JSP Basics 9 April 11th, 2005 03:35 AM
Package Deployment Problem bveerendrakumar Pro VB 6 8 March 16th, 2005 05:05 AM





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