Solved

how to execute this function in PL/SQL developer

Posted on 2006-06-21
5
8,800 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

Suggested Solutions

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

810 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