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
Solved

how to execute this function in PL/SQL developer

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

Title # Comments Views Activity
SQL Query 34 116
Select and Insert Query running slow 4 46
Oracle function to insert records? 15 48
oracle collections 2 22
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

829 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