Solved

how to execute this function in PL/SQL developer

Posted on 2006-06-21
5
8,581 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I am getting not all varaibles found;

for varchar2 should i pass 'aaaa'
0
 
LVL 9

Expert Comment

by:neo9414
Comment Utility
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.

Join & Write a Comment

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

743 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

12 Experts available now in Live!

Get 1:1 Help Now