473,569 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a Package

7 New Member
hi all

i am a new member to this forum.i am tryin to call a package from an anonymous pl/sql block(say a wrapper).the package is like(IS SPECIFIC TO OUR APPLICATION).
Expand|Select|Wrap|Line Numbers
  1.  
  2. create or replace package E1QSFR05 as
  3.  
  4. procedure E1QSFPOP(
  5.         P_UlcIfc in out        SRYULCIFC_1
  6.       , P_Hdr    in out nocopy E1Y_SF_HDR_1
  7.       , P_Dtls   in out nocopy E1C_SF_DTLS_1
  8.       );
  9.  
  10.       function F_Revision return char;
  11.  
  12.    end E1QSFR05;
  13. /
  14.  
  15.  
  16. create or replace package body E1QSFR05 as
  17.  
  18.    LOG_DECLARE_ID(G_LogId,'E1QSFR05')
  19.  
  20.    G_UB  number;
  21.    G_SP  number;
  22.    G_SU  number;
  23.  
  24. procedure   E1QSFPOP(
  25.          P_UlcIfc    in out            SRYULCIFC_1
  26.         ,P_Hdr       in out nocopy     E1Y_SF_HDR_1
  27.         ,P_Dtls      in out nocopy     E1C_SF_DTLS_1
  28.        ) is
  29.  
  30.        detrec1 E1Y_SF_DTLS_1;
  31.        anly_type_1 varchar2(1);
  32.  
  33.  
  34.      select_string     varchar2(1000);
  35.      where_string      varchar2(100);
  36.      cond_string       varchar2(100);
  37.      sql_string        varchar2(4000);
  38.  
  39.      type curs_type is ref cursor;
  40.      curs1 curs_type;
  41.  
  42. begin
  43.      P_Dtls := E1C_SF_DTLS_1();
  44.  
  45. --select_string:='select C.E1_POS_ID "POS_NO", decode(row_number() over (partition by C.BEZ_LANG,A.E1_GRP_NO order by C.BEZ_LANG),1,C.BEZ_LANG,NULL)||','||B.E1_QUES_NO "Group/Question" from E1_GRP_MSTR A,  E1_GRP_QUES_MSTR B, E11POS_MSTR C,E1_SF_HDR';
  46. select_string:='select C.E1_POS_ID "POS_NO",A.E1_GRP_NO,B.E1_QUES_NO,C.BEZ_LANG from E1_GRP_MSTR A,  E1_GRP_QUES_MSTR B, E11POS_MSTR C,E1_SF_HDR';
  47. where_string:= 'where E1_ANLY_TYPE =:a';
  48. cond_string:='and A.E1_GRP_NO=B.E1_GRP_NO';
  49.  
  50. begin
  51.   if(P_Hdr.E1_ANLY_TYPE = '1') then 
  52.   anly_type_1:='1';
  53.   sql_string := select_string||' '||where_string||' '||cond_string;
  54.  
  55.  elsif(P_Hdr.E1_ANLY_TYPE = '2') then 
  56.   anly_type_1:='2';
  57.   sql_string := select_string||' '||where_string||' '||cond_string;
  58.  end if;
  59.  
  60.  open curs1 for sql_string using anly_type_1;
  61.  loop
  62.  detrec1:= E1Y_SF_DTLS_1.F_GetNewRecord();
  63.  fetch curs1 into detrec1.E1_POS_ID,detrec1.E1_GRP_NO,detrec1.E1_QUES_NO,
  64.     detrec1.BEZ_LANG;
  65.  
  66.         exit when curs1%notfound;
  67.         P_Dtls.EXTEND;
  68.         P_Dtls(P_Dtls.LAST):= detrec1;
  69.         end loop;
  70.  close curs1;
  71.  end;
  72.  
  73.  exception
  74.       when others then
  75.          RAISE_EXCEPTION
  76.  
  77.  end E1QSFPOP;  
  78.  
  79.     procedure   InitPackage is
  80.    begin
  81.       G_UB := SRQETIF0.F_UB;
  82.       G_SP := SRQETIF0.F_SP;
  83.       G_SU := SRQETIF0.F_SU;
  84.    end;
  85.  
  86.    function    F_Revision return char is 
  87.    begin 
  88.       return('$Revision: 0.0 $'); 
  89.    end F_Revision;
  90.  
  91.     begin
  92.    InitPackage;
  93.    end E1QSFR05;
  94.  
  95.  
  96.  
  97. i WANT TO CALL THE PACKAGED PROCEDURE NOW.I USED THIS TO CALL.. I AM NOT GETTING THE REQUIRED O/P.
  98.  
  99. set serveroutput on size 100000
  100.  
  101. Declare
  102.  
  103.  P_UlcIfc SRYULCIFC_1;
  104.  P_Dtls E1C_SF_DTLS_1;
  105.  P_Hdr E1Y_SF_HDR_1;
  106.  detrec  E1Y_SF_HDR_1;
  107.  detrec1 E1Y_SF_DTLS_1;
  108. Begin
  109.  
  110.   P_Dtls  := E1C_SF_DTLS_1(); 
  111.   detrec1 := E1Y_SF_DTLS_1.F_GetNewRecord();
  112.   detrec  := E1Y_SF_HDR_1.F_GetNewRecord();
  113.  
  114.   detrec.E1_ANLY_TYPE:=1;
  115.  
  116. detrec1.E1_POS_ID:= '101';
  117. detrec1.E1_GRP_NO:= '5';
  118. detrec1.E1_QUES_NO:='1';
  119. detrec1.BEZ_LANG:='Hi';
  120.  
  121. P_Dtls.EXTEND;
  122.      P_Dtls(P_Dtls.LAST):= detrec1;
  123.      DBMS_OUTPUT.PUT_LINE('Procedure Call'||P_Dtls.LAST);
  124.  
  125.     P_Dtls  := E1C_SF_DTLS_1(); 
  126.  
  127. detrec1 := E1Y_SF_DTLS_1.F_GetNewRecord();
  128. detrec  := E1Y_SF_HDR_1.F_GetNewRecord();
  129.  
  130.   detrec.E1_ANLY_TYPE:=1;
  131.  
  132. detrec1.E1_POS_ID:= '102';
  133. detrec1.E1_GRP_NO:= '4';
  134. detrec1.E1_QUES_NO:='2';
  135. detrec1.BEZ_LANG:='Bye';
  136.  
  137. P_Dtls.EXTEND;
  138.      P_Dtls(P_Dtls.LAST):= detrec1;
  139.      DBMS_OUTPUT.PUT_LINE('Procedure Call'||P_Dtls.LAST);    
  140.  
  141.     P_Dtls  := E1C_SF_DTLS_1();     
  142.  
  143.  
  144. e1qsfr05.E1QSFPOP(P_UlcIfc,detrec,P_Dtls);
  145.     end;
  146. O/P:
  147.  
  148. Procedure Call : 1
  149. Procedure Call: 1
  150.  
  151.  
pleas help me with this..
Mar 24 '08 #1
3 2163
amitpatel66
2,367 Recognized Expert Top Contributor
Could you please provide more explanation about your procedure and the output that you are expecting?
Mar 24 '08 #2
ramorac
7 New Member
Could you please provide more explanation about your procedure and the output that you are expecting?
sure amit..
actually i m trying to populate the fields in the front end..
just fr testing purpose..when i call the package from a pl/sql block as u see..i gt an o/p like
procedure call :1..

bt i require the o/p to be: 101 5 1 hi..(something like this).. for THE BELOW DECLARATION..am i clear? pleas any suggestions

detrec1.E1_POS_ ID:= '101';
detrec1.E1_GRP_ NO:= '5';
detrec1.E1_QUES _NO:='1';
detrec1.BEZ_LAN G:='Hi';
Mar 24 '08 #3
amitpatel66
2,367 Recognized Expert Top Contributor
sure amit..
actually i m trying to populate the fields in the front end..
just fr testing purpose..when i call the package from a pl/sql block as u see..i gt an o/p like
procedure call :1..

bt i require the o/p to be: 101 5 1 hi..(something like this).. for THE BELOW DECLARATION..am i clear? pleas any suggestions

detrec1.E1_POS_ ID:= '101';
detrec1.E1_GRP_ NO:= '5';
detrec1.E1_QUES _NO:='1';
detrec1.BEZ_LAN G:='Hi';
Since you are printing array's LAST position using array.LAST, it is printing as 1. If you need to print other values then include them in DBMS_OUTPUT as well.
Mar 24 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4448
by: Marc Shapiro | last post by:
I am relatively new to python (I have used it on and off for a few small projects over the last few years) so I imagine that what I am trying to do has already been done, but practical experience, even if it is reinventing the wheel, is still useful, so... I am trying to write a module to handle drop down menus using curses (on linux). ...
1
4358
by: Robert Scheer | last post by:
Hi. I wrote some stored procedures used by a web application. As I am fairly new to Oracle, I am missing some concepts when creating these procedures, as a result, the application is suffering from poor performance everytime I call these procedures. I would like your help in order to identify potential mistakes when coding these procedures...
4
1224
by: Abhilash | last post by:
I referenced a COM dll in ASP.NET and using the following statement to instantiate the library: Dim Package As New PkgUtil.Package In my development PC it is possible to instantiate the library and also to call different methods exposed by the DLL. The same application deployed on the client's web server fails to instantiate the DLL....
11
407
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I can use dlopen/whatever to convert the function name into a pointer to that function, but actually calling it, with the right number of parameters,...
0
1905
by: =?Utf-8?B?VmlyYWogUmFv?= | last post by:
Hi, I am calling DTS package using C# in my current application on dev server. The DTS package tranfers file from Excel to SQL Server table. When i migrated the package from dev server to production server, i had forgotten to change the server name in DTS package. Is there any way i can pass the connection string to DTS package through...
6
1774
by: Samuel | last post by:
Hi, Given the following directory structure: --------- |-- Obj.py |-- __init__.py |-- foo | |-- FooTest.py | `-- __init__.py
2
1585
by: cnsabar | last post by:
Hi All, Is there any way to call user defined perl package from other system. For Example. In my perl script, I am defining a package/modules using use myPackage;
1
2776
by: Martin Rubey | last post by:
Dear all, I'm trying to call from common lisp functions written for Sage (www.sagemath.org), which in turn is written in python. To do so, I tried http://common-lisp.net/project/python-on-lisp/. It was quite easy to get it to run and do some simple things with python. However, I was unable to get sage to run within it. If I start my...
0
3209
by: pinky22 | last post by:
I am calling SSIS package from a .Net windows UI. Both SSIS & .Net app are created in 2008. The SSIS package is stored in file system. When I ran .Net app I got error- The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6286
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.