The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to execute multiple(batch) oracle script in unix mechine ravi gongati Shell Programming and Scripting 2 03-21-2008 07:37 AM
Execute oracle query determined at runtime from a unix script infyanurag Shell Programming and Scripting 4 02-01-2008 07:54 AM
Execute a UNIX script from DOS prompt. er_aparna Shell Programming and Scripting 24 12-15-2006 07:47 AM
Can Unix (Solaris) execute a dos .bat script? BCarlson UNIX for Dummies Questions & Answers 4 08-26-2006 09:52 PM
Execute script on Unix/Linux from Windows brbillyh UNIX for Dummies Questions & Answers 4 07-11-2005 12:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-12-2009
reptile reptile is offline
Registered User
  
 

Join Date: May 2009
Posts: 1
Execute PL/SQL function from Unix script (.sql file)

Hi guys,
I am new on here, I have a function in oracle that returns a specific value:

create or replace
PACKAGE BODY "CTC_ASDGET_SCHED" AS
FUNCTION FN_ASDSCHEDULE_GET
RETURN VARCHAR2
AS
BEGIN
DECLARE
ASDSchedule varchar2(6);
ASDComplete VARCHAR2(50);
BEGIN
(Some code here)

RETURN ASDComplete;
END;
END;

END CTC_ASDGET_SCHED;


So the above basically should return a value eg. 090512,

now in my .sql script (which I execute from a Korn Shell script) I have in Unix I call this function as follows:

SET AUTOPRINT OFF;
VAR VAL VARCHAR2(50);
VAR ASDSCHEDULE VARCHAR2(50);
VAR NAME VARCHAR2(50);
BEGIN
:VAL := MTMREP.CTC_ASDGET_SCHED.FN_ASDSCHEDULE_GET;
:NAME := MTMREP.M01100_MTMIMPORT.P01102_ImportControl(:VAL,'PF');
END;
/
quit;


I'm trying to pass the value which will be stored in (VAL) from the above first function (eg. 090512), I then need to pass this value in the 2nd procedure above called P01102_ImportControl but it still gives me an error.

The procedure P01102_ImportControl is as follows:


PROCEDURE P01102_ImportControl (ASDSchedule IN VARCHAR2, ASDVersion In VARCHAR2) AS
Begin

-- some code

End P01102_ImportControl;

Here is the error:

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

ppadev1 SQL> :NAME := MTMREP.M01100_MTMIMPORT.P01102_ImportControl(:VAL,'PF');
*
ERROR at line 3:
ORA-06550: line 3, column 10:
PLS-00222: no function with name 'P01102_IMPORTCONTROL' exists in this scope
ORA-06550: line 3, column 1:
PL/SQL: Statement ignored


Can someone please help me with this or give me some idea how to do this so it works. Thanks in advance.


Last edited by reptile; 05-12-2009 at 04:45 PM..
  #2 (permalink)  
Old 05-14-2009
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 500
I don't know much about Oracle or PL/SQL ...
However did find the following, so I hope it helps a little.

ORA-06550: ORA-06550: line <i>string</i>, column <i>string</i>: <i>st...

PLS-00222: PLS-00222: no function with name '<i>string</i>' exists in...

Cheers,
Cameron
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0