Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to execute this function in PL/SQL developer

Posted on 2006-06-21
5
Medium Priority
?
9,717 Views
Last Modified: 2012-05-05
begin
  :result := x_pkg.getstatus(document_id => :document_id,
                                                        document_type => :document_type,
                                                        document_mode => :document_mode);
end;



how to execute this function in PL/SQL developer IDE;

getstatus(varchar2,varchar2,number)

getstatus('1','xxx',2)

i am getting 01036:illegal variable name/number;
0
Comment
Question by:chaitu chaitu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Assisted Solution

by:neo9414
neo9414 earned 450 total points
ID: 16951673
assuming that x_pkg.getstatus function returns number datatype. if it returns anythig else then please modify the datatype of "result" variable accordingly. also change the size of other variables according to your need. I have assumed 100.

below is a pl/sql block

declare
document_id varchar2(100) := '1';
document_type varchar2(100) := 'xxx';
document_mode number := 2;
result number;
begin
  result := x_pkg.getstatus(document_id => document_id,
                                                        document_type => document_type,
                                                        document_mode => document_mode);
end;


if you don't wan to hard code the  values then create a procedure to do this task as given below

create or replace procedure exec_func(document_id varchar2, document_type varchar2, document_mode number) as
result number;
begin
  result := x_pkg.getstatus(document_id => document_id,
                                                        document_type => document_type,
                                                        document_mode => document_mode);
end;
/

to execute the above procedure....

sql> exec exec_func('1','xxx',2)


0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16956864
this is not what i expected;

i know how to execute function in sqlplus but i asked how to pass parameters in IDE to execute the above function
0
 
LVL 2

Accepted Solution

by:
KJlt earned 1050 total points
ID: 16958289
begin
  dbms_output.put_line(
   x_pkg.getstatus(document_id => '&document_id',
                                                        document_type => '&document_type',
                                                        document_mode => '&document_mode')
  );
end;

Place this block into SQL Window of PL/SQL Developer and press "Execute".
You will be prompted for parameters.
The result you will see in "Output" tab.

0
 
LVL 20

Author Comment

by:chaitu chaitu
ID: 16958350
I am getting not all varaibles found;

for varchar2 should i pass 'aaaa'
0
 
LVL 9

Expert Comment

by:neo9414
ID: 16960037
no... just pass
aaaa instead of 'aaaa'

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question