Solved

how to execute this function in PL/SQL developer

Posted on 2006-06-21
5
8,698 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
  • 2
  • 2
5 Comments
 
LVL 9

Assisted Solution

by:neo9414
neo9414 earned 150 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 350 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now