How to pass a structure in PL/SQL external proc.

This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Everything is working fine, except When there is a structure in OUT parameter.
My database version.
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - ProductionI have set up the listner.ora and tnsnames.ora and written a package called dbms_kernel32sb.
There are 9 program units.
1. CreateFile -- working fine
2. CloseFile -- working fine
3. GetSize -- working fine
4. FindFirstFile -- NOT working, because one OUT parameter has the structure type WIN32_FIND_DATA.
5. GetFileTime -- NOT working, because one OUT parameter has the structure type FILETIME
6. GetDiskFreeSpace -- working fine
7. GetDriveType -- working fine.
8. GetLastError -- working fine
9. ExecuteCommand -- working fine.
Here is the package specification:
CREATE OR REPLACE PACKAGE dbms_kernel32sb AS
    Name: dbms_kernel32sb.pks
    Author: Saubhik Banerjee
    Date: 24th Jan 2011
    Version: 1.0
    Comment: This package is to implement some functionality from kernel32.dll.
             Usng extproc
OPEN_EXISTING_FILE CONSTANT PLS_INTEGER :=3;
FILE_ATTRIBUTE_NORMAL CONSTANT PLS_INTEGER :=128;
DISABLE_FILE_SHARE_MODE CONSTANT PLS_INTEGER :=0;
NO_FILE_SECURITY_ATTRIBUTE CONSTANT PLS_INTEGER :=0;
NO_TEMPLATE_FILE CONSTANT PLS_INTEGER :=0;
GENERIC_FILE_ACCESS CONSTANT PLS_INTEGER :=0;
FILE_SIZE_HIGH CONSTANT PLS_INTEGER :=400000000;
EXECUTE_FILE CONSTANT VARCHAR2(4):='open';
PRINT_FILE CONSTANT VARCHAR2(5):='print';
NO_PARAMATER CONSTANT VARCHAR2(2):=' ';
FUNCTION CreateFile(pi_FileName VARCHAR2 --1, File name
            ,pi_DesiredAccess BINARY_INTEGER --2, Type of access required (read/write ect)
            ,pi_ShareMode BINARY_INTEGER --3,  share mode
            ,pi_SecurityAttributes BINARY_INTEGER --4, securoty attribute
            ,pi_CreationDisposition BINARY_INTEGER --5, open existing, create new etc
            ,pi_FlagsAndAttributes BINARY_INTEGER --6, File attribute- normal
            ,pi_TemplateFile BINARY_INTEGER) --Not required.
    Return BINARY_INTEGER;
FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
                     Return BINARY_INTEGER;
FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
                   pio_FileSizeHigh IN OUT BINARY_INTEGER)
               RETURN BINARY_INTEGER;
FUNCTION FindFirstFile ( pi_FileName VARCHAR2
                         ,pio_Win32_Find_data OUT 
                             WIN32_FIND_DATA
RETURN BINARY_INTEGER;                                             
FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
                       ,pio_FileCreationTime IN OUT FILETIME
                       ,pio_LastAccessTime   IN OUT FILETIME
                       ,pio_LastWriteTime    IN OUT FILETIME
RETURN BINARY_INTEGER;
FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
                            ,pio_SectorsPerCluster  OUT BINARY_INTEGER
                            ,pio_BytesPerSector   OUT BINARY_INTEGER
                            ,pio_NumberOfFreeClusters  OUT BINARY_INTEGER
                            ,pio_TotalNumberOfClusters  OUT BINARY_INTEGER
RETURN BINARY_INTEGER;    
FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2;
FUNCTION GetLastError RETURN BINARY_INTEGER;   
FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
                          ,pi_FileName VARCHAR2
                          ,pi_Parameters VARCHAR2
                          ,pi_DefaultDirectory VARCHAR2
RETURN VARCHAR2;
END dbms_kernel32sb;
Here is the package body:
CREATE OR REPLACE PACKAGE BODY dbms_kernel32sb AS
/* Name: dbms_kernel32sb.pkb
    Author: Saubhik Banerjee
    Date: 24th Jan 2011
    Version: 1.0
    Comment: This package is to implement some functionality from kernel32.dll.
             Usng extproc
  FUNCTION
  CreateFile( pi_FileName VARCHAR2 --1
            , pi_DesiredAccess BINARY_INTEGER --2
            , pi_ShareMode BINARY_INTEGER --3
            , pi_SecurityAttributes BINARY_INTEGER --4
            , pi_CreationDisposition BINARY_INTEGER --5
            , pi_FlagsAndAttributes BINARY_INTEGER --6
            , pi_TemplateFile BINARY_INTEGER) --7
    Return BINARY_INTEGER IS EXTERNAL LIBRARY kernel32 Name "CreateFileA"
    PARAMETERS(  pi_FileName STRING
               , pi_DesiredAccess long
               , pi_ShareMode long
               , pi_SecurityAttributes long
               , pi_CreationDisposition long
               , pi_FlagsAndAttributes long
               , pi_TemplateFile long
               , return long);
FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
                     Return BINARY_INTEGER
     IS EXTERNAL
     LIBRARY kernel32 Name "CloseHandle"
     PARAMETERS (pi_FileHandle long, return long);
FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
                   pio_FileSizeHigh IN OUT BINARY_INTEGER)
               RETURN BINARY_INTEGER
     IS EXTERNAL
    LIBRARY kernel32 NAME "GetFileSize"
    PARAMETERS (pi_FileHandle long, pio_FileSizeHigh long, return long );
  FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
                       ,pio_FileCreationTime IN OUT FILETIME
                       ,pio_LastAccessTime   IN OUT FILETIME
                       ,pio_LastWriteTime    IN OUT FILETIME
   RETURN BINARY_INTEGER
     IS EXTERNAL
    LIBRARY kernel32 NAME "GetFileTime"
    WITH CONTEXT
    PARAMETERS ( CONTEXT,
                  pi_FileHandle long
                , pio_FileCreationTime  OCIColl
                , pio_FileCreationTime INDICATOR SHORT
                , pio_LastAccessTime  OCIColl
               , pio_LastAccessTime INDICATOR SHORT
                , pio_LastWriteTime OCIColl
                , pio_LastWriteTime INDICATOR SHORT
                , return long );                  
FUNCTION FindFirstFile ( pi_FileName VARCHAR2
                         ,pio_Win32_Find_data OUT 
                             WIN32_FIND_DATA
RETURN BINARY_INTEGER
IS EXTERNAL
    LIBRARY kernel32 NAME "FindFirstFileA"
    --WITH CONTEXT
    PARAMETERS
                ( --CONTEXT,
                 pi_FileName STRING--, pi_FileName INDICATOR SHORT
                , pio_Win32_Find_data  BY REFERENCE OCIColl--,pio_Win32_Find_data INDICATOR long
                , return long );
FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
                            ,pio_SectorsPerCluster  OUT BINARY_INTEGER
                            ,pio_BytesPerSector   OUT BINARY_INTEGER
                            ,pio_NumberOfFreeClusters  OUT BINARY_INTEGER
                            ,pio_TotalNumberOfClusters  OUT BINARY_INTEGER
RETURN BINARY_INTEGER
  IS EXTERNAL
    LIBRARY kernel32 NAME "GetDiskFreeSpaceA"
    PARAMETERS (  pi_RootPathName STRING
                , pio_SectorsPerCluster BY REFERENCE long
                , pio_BytesPerSector BY REFERENCE long
                , pio_NumberOfFreeClusters BY REFERENCE long
                , pio_TotalNumberOfClusters BY REFERENCE long
                , return long );   
  FUNCTION GetDriveTypeA( pi_driveLetter VARCHAR2) RETURN BINARY_INTEGER   
  IS EXTERNAL
  LIBRARY kernel32 NAME "GetDriveTypeA"
  PARAMETERS (pi_driveLetter STRING, RETURN long);
FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2 IS
BEGIN
  CASE  GetDriveTypeA(pi_driveLetter) 
   WHEN 2 THEN RETURN 'Removable';
   WHEN 3 THEN RETURN 'Drive Fixed';
   WHEN 4 THEN RETURN 'Remote';
   WHEN 5 THEN RETURN 'Cd-Rom';
   WHEN 6 THEN RETURN 'Ram disk';
   ELSE RETURN 'Unrecognized';
END CASE;                              
END;
FUNCTION GetLastError  RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY kernel32 NAME "GetLastError"
PARAMETERS (return long);
FUNCTION ShellExecute( pi_Hwnd BINARY_INTEGER
                      ,pi_Operation VARCHAR2
                      ,pi_FileName VARCHAR2
                      ,pi_Parameters VARCHAR2
                      ,pi_DefaultDirectory  VARCHAR2
                      ,pi_ShowCmd BINARY_INTEGER
                      ) RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY SHELL32 NAME "ShellExecuteA"
PARAMETERS (pi_Hwnd long,pi_Operation STRING,pi_FileName STRING
             ,pi_Parameters STRING,pi_DefaultDirectory STRING
             ,pi_ShowCmd long, return long
FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
                          ,pi_FileName VARCHAR2
                          ,pi_Parameters VARCHAR2
                          ,pi_DefaultDirectory VARCHAR2
RETURN VARCHAR2 IS
  v_return_val BINARY_INTEGER;
BEGIN
  v_return_val:= ShellExecute(0,pi_OperationType
                             ,pi_FileName,pi_Parameters
                             ,pi_DefaultDirectory,0
  IF v_return_val <=32 THEN
   RETURN 'Error!';
  ELSE RETURN 'Success!';
  END IF;
END;
END dbms_kernel32sb;
Now the working demos:
SQL> SET SERVEROUT ON
SQL> /* Demo I:- How to obtain file size */
SQL> DECLARE
  2    v_FileSize BINARY_INTEGER;
  3    v_FileSizeHigh PLS_INTEGER;
  4    v_FileHandle BINARY_INTEGER;
  5    v_filename VARCHAR2(500) :='C:\test2.csv';
  6    v_dummy BINARY_INTEGER;
  7  BEGIN
  8    v_FileSizeHigh := DBMS_KERNEL32SB.FILE_SIZE_HIGH;
  9    v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
10                            ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
11                            ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
12                            ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUT
13                            ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
14                            ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
15                            ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
16   v_FileSize := DBMS_KERNEL32SB.Getsize(v_FileHandle, v_FileSizeHigh)
17   DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_FileSize);
18   v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
19  END;
20  /
File Size in Bytes: 61
PL/SQL procedure successfully completed.
SQL>
SQL> /* Demo II:- How to find free disk space  */
SQL> DECLARE
  2    v_rootpath VARCHAR2(500) :='C:\';
  3    v_dummy BINARY_INTEGER;
  4    v_sectorspercluster BINARY_INTEGER;
  5    v_bytespersector BINARY_INTEGER;
  6    v_numberoffreeclusters BINARY_INTEGER;
  7    v_totalnumberofclusters BINARY_INTEGER;
  8    v_freespace NUMBER;
  9    v_totalspace NUMBER;
10  BEGIN
11    v_dummy:=DBMS_KERNEL32SB.GetDiskFreeSpace(v_rootpath
12                                              ,v_sectorspercluster
13                                              ,v_bytespersector
14                                              ,v_numberoffreeclusters
15                                              ,v_totalnumberofclusters
16                                              );
17                                              
18    DBMS_OUTPUT.put_line('Sector pre Cluster: ' ||v_sectorspercluster);
19    DBMS_OUTPUT.put_line('Bytes per sector: ' ||v_bytespersector);
20    DBMS_OUTPUT.put_line('Number Of Free Clusters: ' ||v_numberoffreeclusters);
21    DBMS_OUTPUT.put_line('Total Number Of Clusters: ' ||v_totalnumberofclusters);
22    v_freespace:=v_numberoffreeclusters/1024/1024/1024;
23    v_freespace:=ROUND(v_freespace*v_sectorspercluster*v_bytespersector,3);
24    v_totalspace:=v_totalnumberofclusters/1024/1024/1024;
25    v_totalspace:=ROUND(v_totalspace*v_sectorspercluster*v_bytespersector,3);
26    DBMS_OUTPUT.put_line('Total Space (GB):' ||v_totalspace);
27    DBMS_OUTPUT.put_line('Total number of Free space (GB): '||v_freespace );
28  END;
29  /
Sector pre Cluster: 8
Bytes per sector: 512
Number Of Free Clusters: 739477
Total Number Of Clusters: 9765622
Total Space (GB):37.253
Total number of Free space (GB): 2.821
PL/SQL procedure successfully completed.
SQL>
SQL> /* Demo IV:- How to get drive type*/
SQL> SELECT dbms_kernel32sb.GetDriveType('C:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('C:\')
Drive Fixed
SQL> SELECT dbms_kernel32sb.GetDriveType('D:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('D:\')
Cd-Rom
SQL> SELECT dbms_kernel32sb.GetDriveType('E:\') FROM dual;
DBMS_KERNEL32SB.GETDRIVETYPE('E:\')
Unrecognized
SQL>
SQL> /* Demo V:- How to execute an Operating System Command*/
SQL> DECLARE
  2   v_FileToExecute VARCHAR2(20):='test.bat';
  3   v_Parameter VARCHAR2(20):='test1.csv';--dbms_kernel32sb.NO_PARAMATER
  4   v_DefaultDirectory VARCHAR2(20):='C:\';
  5   v_ReturnValue VARCHAR2(20);
  6  BEGIN
  7    v_ReturnValue:=dbms_kernel32sb.ExecuteCommand(dbms_kernel32sb.EXECUTE_FILE
  8                                                  ,v_FileToExecute
  9                                                  ,v_Parameter
10                                                  ,v_DefaultDirectory
11                                                  );
12   DBMS_OUTPUT.put_line('Status: '||v_ReturnValue);                               
13  END;
14  /
Status: Success!
PL/SQL procedure successfully completed.
SQL> Now the sub programs with structures are NOT getting called successfully.
SQL> /* Demo III:- How to obtain file time */
SQL> DECLARE
  2    v_FileHandle BINARY_INTEGER;
  3    v_filename VARCHAR2(500) :='C:\test2.csv';
  4    v_dummy BINARY_INTEGER;
  5    v_filecreationtime FILETIME;
  6    v_lastaccesstime FILETIME;
  7    v_lastwritetime FILETIME;
  8    v_err BINARY_INTEGER;
  9  BEGIN
10    v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
11                            ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
12                            ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
13                            ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUTE
14                            ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
15                            ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
16                            ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
17   v_dummy := DBMS_KERNEL32SB.GetFileTime( v_FileHandle
18                                          ,v_filecreationtime
19                                          ,v_lastaccesstime
20                                          ,v_lastwritetime
21                                          );
22   v_err:=DBMS_KERNEL32SB.GetLastError;                                
23   DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_dummy);
24   DBMS_OUTPUT.put_line('Error:'||v_err);
25   v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
26  END;
27  /
File Size in Bytes: 0
Error:203
PL/SQL procedure successfully completed.
SQL> So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.
CREATE OR REPLACE TYPE FILETIME_rec IS OBJECT
                          ( LowDateTime NUMBER
                           ,HighDateTime NUMBER
CREATE OR REPLACE TYPE FILETIME IS TABLE OF  FILETIME_rec;Edited by: Saubhik on Feb 1, 2011 4:15 PM

Saubhik wrote:
This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Interesting. Familiar with the Wn32 API, but do not run Oracle on Windows and never looked at this aspect of integration.
So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.The problem is that this passes the parameter by reference and not value. In a vanilla C/C++/Delphi program, you will create a variable of that struct and then pass a long pointer to that variable when making the API call. That pointer will be dereferenced and the memory it points to, populated. This is not a problem as the underlying DLL you call that does this, uses your process's data segment.
Extproc is different. In order to protect the integrity of the database server process, an external call is done by a "proxy" process. It acts as the interface between your PL/SQL code and the actual external call.
In this case, this "proxy" process will be doing the implicit LoadLibrary() call to load kernel32.dll interface - and the DLL will expect to dereference and access this process's memory struct to populate it. This "proxy" process in turn needs to know that despite it calling the interface by reference, it needs to return that parameter to PL/SQL by value - as your PL/SQL code cannot dereference a pointer passed back by that "proxy" process and access its memory to gain access to that struct.
In basic terms - that argument is a 32 bit number containing a pointer. That is what the "proxy" process needs to pass to the interface call. Your code is passing a struct and not a pointer, right?
And that is the basic problem I believe. How to address this.. not sure. You can have your own DLL as interface that does not use pointers but expect arguments to be passed by value. But this will suck as you then need to include a custom DLL to deploy and have PL/SQL call that, instead of simply accessing and calling the native kernel interface.
Doubt that many Win32 programmers with OCI (Oracle Call Interface) frequents this forum. So perhaps this is not the best place to ask. I would be hitting Metalink (support.oracle.com) search function in your sho3s though as there should be support notes dealing with this subject matter.

Similar Messages

  • How to invoke adobe life cycle webservice using c++ (how to pass blob structure as argument)

    We already wrote sample code (.NET C#) to access livecycle webservice(this convert the input file into pdf file) using below link from adobe
    http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/ht ml/wwhelp.htm?context=sdkHelp&file=000088.html
    We want to write c++ client to invoke adobe life cycle webservice. I have sample code to invoke the given webservice using plain c++ but I am stuck up with 'how to pass BLOB structure as argument to CreatePDF() method' and
    plus 'how to get ouput as mapItem[]' . Is the code to convert to pdf works fine with .NET and java only? Not with c++ or VB?

    In this case the LiveCycle services are exposed as web services that can be consumed by any application language that can interact with web services. While the sample published are for c# and Java there is no reason that other web service aware languages (C++, Perl, etc) wouldn't work.
    I'm not a Microsoft C++ expert, but as far as I understand all you need to do is create a web reference and then have your C++ classes interact via the generated proxy classes. The syntax will be different, but the concept is the same

  • How to pass XMLType as parameters to Java stored procs ?

    How to pass XMLType as parameters to Java stored procs ?
    ORA-00932: inconsistent datatypes: expected an IN argument at position 1 that is an instance of an Oracle type convertible to an instance of a user defined Java class got an Oracle type that could not be converted to a java class
    Java stored proc -->
    CREATE or replace FUNCTION testJavaStoredProcMerge( entity xmltype,event xmltype ) RETURN VARCHAR2 AS LANGUAGE JAVA
    NAME 'XDBMergeOp.merge(org.w3c.dom.Document,org.w3c.dom.Document) return java.lang.String';
    PL/SQL -->
    declare
    theQuote VARCHAR2(50);
    entity xmltype;
    event xmltype;
    begin
    entity := xmltype('<Quote><Fields><Field1>f1</Field1></Fields></Quote>');
    event := xmltype('<Quote><Fields><Field2>f2</Field2></Fields></Quote>');
    theQuote := testJavaStoredProcMerge(entity,event);
    dbms_output.put_line(theQuote);
    end;
    Java class -->
    public class XDBMergeOp {
    public static String merge(Document entity, Document event) throws Exception {
    return ...
    Thanks in advance.

    I think you'll need to use XMLType and then extract the DOM inside java..
    create or replace package SAXLOADER
    as
      procedure LOAD(P_PARAMETERS XMLTYPE, P_DATASOURCE BFILE);
    end;
    create or replace package body SAXLOADER
    as
    procedure LOAD(P_PARAMETERS XMLTYPE, P_DATASOURCE BFILE)
    AS
    LANGUAGE JAVA
    NAME 'com.oracle.st.xmldb.pm.saxLoader.SaxProcessor.saxLoader ( oracle.xdb.XMLType, oracle.sql.BFILE)';
    end;
      public static void saxLoader(XMLType parameterSettings, BFILE dataSource)
      throws Exception {
        Document parameters = parameterSettings.getDocument();
        SaxProcessor app = new SaxProcessor(parameters);
        app.processXMLFile(dataSource);
      Edited by: mdrake on Apr 6, 2009 11:28 AM

  • How to pass a col of pl/sql tab to a parametrized cursor?

    Hi,
    I'm getting this error constantly:
    Error on line 1
    declare
    j number :=1;
    cursor f
    ORA-06550: line 9, column 20:
    PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table LONG_ double ref
    char time timestamp interval date binary national character
    nchar
    Code Snippet:
    declare
    j number :=1;
    cursor firstquery (c_item in varchar2) is
    SELECT SEARCH, NAME, ID FROM tablename
    WHERE name LIKE c_item;
    first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
    first_rec_tbl first_rec_tbl_type;
    type act_str_tbl_type is table of varchar2(50) index by binary_integer;
    act_put_str_tbl act_str_tbl_type;
    begin
    this is executing fine as i have executed it as a standalone script also
    act_put_str_tbl table has values here.passing these to below:
    ----------------------------------- i guess the problem lies here------------------------
         begin
              dbms_output.put_line('reached second begin');
    For i in act_put_str_tbl.first..act_put_str_tbl.last
         loop
         dbms_output.put_line('inside loop of second begin');
         open firstquery(act_put_str_tbl(i));
              loop
              fetch firstquery into first_rec_tbl(j);
              j:=j+1;
              exit when firstquery%notfound or firstquery is null;
              end loop;
         close firstquery;
         end loop;
    How to use parametrized cursor with PL/SQL table, any help is appreciated in the above snippet.
    Thanks

    Satyaki_De wrote:
    first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;Create this type in side any package like ->
    create or replace package patch_array
    is
    first_rec_tbl_type is table of firstquery%rowtype index by pls_integer;
    end;But, you have to use explicit record type instead of firstquery%rowtype here.
    And, then refer this type inside your parametrized cursor to use that properly, that might solve your current problem - i guess.
    So, you cursor should look something like this ->
    cursor firstquery (c_item in patch_array.first_rec_tbl_type)
    is
    SELECT SEARCH, NAME, ID
    FROM tablename
    WHERE name LIKE c_item; N.B.:Not Tested...
    Regards.
    Satyaki De.
    Edited by: Satyaki_De on Dec 28, 2008 1:32 AM??? No package is needed:
    SQL> declare
      2      j number := 1;
      3      cursor firstquery(
      4                        c_item in varchar2
      5                       )
      6        is
      7          SELECT  ename,
      8                  sal
      9            FROM  emp
    10            WHERE ename LIKE c_item;
    11      type first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
    12      first_rec_tbl first_rec_tbl_type;
    13      type act_str_tbl_type is table of varchar2(50) index by binary_integer;
    14      act_put_str_tbl act_str_tbl_type;
    15  begin
    16      act_put_str_tbl(1) := 'S%';
    17      act_put_str_tbl(2) := '%L%';
    18      act_put_str_tbl(3) := 'KING';
    19      begin
    20          dbms_output.put_line('reached second begin');
    21          For i in 1..nvl(act_put_str_tbl.count,0) loop
    22            dbms_output.put_line('inside loop of second begin');
    23            dbms_output.put_line('act_put_str_tbl(' || i || ') = ' || act_put_str_tbl(i));
    24            open firstquery(act_put_str_tbl(i));
    25            loop
    26              fetch firstquery into first_rec_tbl(j);
    27              exit when firstquery%notfound;
    28              dbms_output.put_line('first_rec_tbl(' || j || ').ename = ' || first_rec_tbl(j).enam
    e);
    29              dbms_output.put_line('first_rec_tbl(' || j || ').sal = ' || first_rec_tbl(j).sal);
    30              j:=j+1;
    31            end loop;
    32            close firstquery;
    33          end loop;
    34      end;
    35  end;
    36  /
    reached second begin
    inside loop of second begin
    act_put_str_tbl(1) = S%
    first_rec_tbl(1).ename = SMITH
    first_rec_tbl(1).sal = 800
    first_rec_tbl(2).ename = SCOTT
    first_rec_tbl(2).sal = 3000
    inside loop of second begin
    act_put_str_tbl(2) = %L%
    first_rec_tbl(3).ename = ALLEN
    first_rec_tbl(3).sal = 1600
    first_rec_tbl(4).ename = BLAKE
    first_rec_tbl(4).sal = 2850
    first_rec_tbl(5).ename = CLARK
    first_rec_tbl(5).sal = 2450
    first_rec_tbl(6).ename = MILLER
    first_rec_tbl(6).sal = 1300
    inside loop of second begin
    act_put_str_tbl(3) = KING
    first_rec_tbl(7).ename = KING
    first_rec_tbl(7).sal = 5000
    PL/SQL procedure successfully completed.
    SQL> To OP. It is better to use BULK COLLECT:
    SQL> declare
      2      cursor firstquery(
      3                        c_item in varchar2
      4                       )
      5        is
      6          SELECT  ename,
      7                  sal
      8            FROM  emp
      9            WHERE ename LIKE c_item;
    10      type first_rec_tbl_type is table of firstquery%rowtype index by binary_integer;
    11      first_rec_tbl first_rec_tbl_type;
    12      type act_str_tbl_type is table of varchar2(50) index by binary_integer;
    13      act_put_str_tbl act_str_tbl_type;
    14  begin
    15      act_put_str_tbl(1) := 'S%';
    16      act_put_str_tbl(2) := '%L%';
    17      act_put_str_tbl(3) := 'KING';
    18      begin
    19          dbms_output.put_line('reached second begin');
    20          For i in 1..nvl(act_put_str_tbl.count,0) loop
    21            dbms_output.put_line('inside loop of second begin');
    22            dbms_output.put_line('act_put_str_tbl(' || i || ') = ' || act_put_str_tbl(i));
    23            open firstquery(act_put_str_tbl(i));
    24            fetch firstquery bulk collect into first_rec_tbl;
    25            for j in 1..nvl(first_rec_tbl.count,0) loop
    26              dbms_output.put_line('first_rec_tbl(' || j || ').ename = ' || first_rec_tbl(j).enam
    e);
    27              dbms_output.put_line('first_rec_tbl(' || j || ').sal = ' || first_rec_tbl(j).sal);
    28            end loop;
    29            close firstquery;
    30          end loop;
    31      end;
    32  end;
    33  /
    reached second begin
    inside loop of second begin
    act_put_str_tbl(1) = S%
    first_rec_tbl(1).ename = SMITH
    first_rec_tbl(1).sal = 800
    first_rec_tbl(2).ename = SCOTT
    first_rec_tbl(2).sal = 3000
    inside loop of second begin
    act_put_str_tbl(2) = %L%
    first_rec_tbl(1).ename = ALLEN
    first_rec_tbl(1).sal = 1600
    first_rec_tbl(2).ename = BLAKE
    first_rec_tbl(2).sal = 2850
    first_rec_tbl(3).ename = CLARK
    first_rec_tbl(3).sal = 2450
    first_rec_tbl(4).ename = MILLER
    first_rec_tbl(4).sal = 1300
    inside loop of second begin
    act_put_str_tbl(3) = KING
    first_rec_tbl(1).ename = KING
    first_rec_tbl(1).sal = 5000
    PL/SQL procedure successfully completed.
    SQL> SY.
    Edited by: Solomon Yakobson on Dec 27, 2008 12:32 PM

  • How to pass a variable for a SQL query in OLEDB source?

    Hi All,
    I am new to SSIS and working on it past few days. Can anyone please help me getting through a scenario where I need to pass a variable in the SQL statement in OLEDB source connection. Please find below for the details.
    eg:
    1) I have a SQL table with the columns SerialNumber, Name, IsValid, FileName with multiple rows.
    2) I have the file Name in a variable called Variable1.
    3) I want to read the data from my SQL table filtering based on the FileName (Variable1) within a data flow task and pull that data to the destination table.
    Question: In the data flow task, added source and destination DB connection with a script component in between to perform my validations. When trying to retrieve the data from source using the variable (i.e. SQL Query with variable), I am not able to add
    the query as the SQL statement box is disabled. How to filter the data based on the variable in the source DB ?
    Any help/suggestions would be of great help.
    Thanks,
    Sri

    Just to add with Vaibhav comment .
    SQL Command  : SQL query either with SQL variable or any condition  or simple Sql statement
    Like ;
    Select * from dimcustomer
    SQL Command using Varible :
    Sometimes we design our dynamic query in variable and directly use that variable name in oledb source.
    If you Sql query needs a condition based on SSIS variable .
    you can find a Example here :
    http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/01/17/ssis-replace-dynamic-sql-with-variables.aspx
    http://www.select-sql.com/mssql/how-to-use-a-variable-inside-sql-in-ssis-data-flow-tasks.html
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • How to pass a parameter into execute sql task and later use it into dataflow task?

    i am in a situation, where i have a logging table in which i have a primary key called ETL_log_ID which is an identity column and acts as a foreign key for various fact table and dimension tables which are populated using SSIS packages. Now i wanna use the
    ETL_log_ID as a parameter in the execute sql task which populates the log table and pass the same value in the data flow task which populates the facts and dimension. Can you let me know how to pass the parameter in a step by step procedure.
    Thanks,
    Nikhil
      

    Nikhil,
    You can check the following :
    http://www.programmersedge.com/post/2013/03/05/ssis-execute-sql-task-mapping-parameters-and-result-sets.aspx
    http://stackoverflow.com/questions/7610491/how-to-pass-variable-as-a-parameter-in-execute-sql-task-ssis
    Regarding the usage in Dataflow task, Can you elaborate on that a little?
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • How to Pass table-structure-fields data to BRF PLUS Application

    Dear Eperts,
    i have a question related to BRF Plus management through abap program.
    In brf plus application end, Field1,field2,field3 these 3 are importing parameters.
                                           Table1->structure1->field4,field5 this is the table,with in one structure is there and 2 fields.
    in my abap program, i am getting values of fields let us take field1,field2,field3,field4,field5.
    And my question is
    1) How to pass fields to BRF Plus application from abap program.
    2)How to pass Table data to BRF Plus application from abap program.
    3)How to pass Structure data to BRF Plus application from abap program.
    4)How to get the result data from BRF Plus application to my abap program.
    And finally , how to run FDT_TEMPLATE_FUNCTION_PROCESS.
    How do i get the code automatically when calling the function in brf plus application.
    Regards
    venkata.

    Hi Venkat,
            As said by Jocelyn Dart, you need to go through BRF+ tutorials.
    -->You can see a on of the tutorial from the below link
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/50879cee-f9b5-2e10-039e-b2d6c4b10e6b

  • How to pass a parameter into a sql expression?

    How to pass a report parameter into a sql expression?

    Hi Donald,
        The functionality of using a parameter in a function is only available in the formula editor and not in SQL Expression. Parameters cannot be passed to the SQL Expression, the main purpose of the SQL Expression is to make use of Database functions to make calculations at the database level but the current functionality of the product only allows you to use Database fields.
    There is an article that talks on SQL Expressions and can be useful http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2016184&sliceId=&dialogID=6018612&stateId=1%200%206020316
    Regards,
    Vinay

  • How to pass a Structure as input parameter

    Hello,
    Anyone knows how to instanciate, populate and pass a Structure into RFCInvoke?
    Thanks!

    Hello,
    Please take a look at the documentations of netweaver RFC programing in this blog: 
    /people/ulrich.schmidt/blog/2008/11/08/new-developments-in-netweaver-rfc-communication
    It contains useful information of rfcInvoke.
    Kind regards, Istvan Elek

  • How to pass a refcursor to a java stored proc

    Hi all,
    Please forgive me as I am new to Java and JDeveloper....
    I want to pass a refcursor to a java stored proc. Does anyone know how to accomplish this?
    Thanks,
    dayneo

    Hi,
    As Avi has indicated, you can map ref cursor to java.sql.ResultSet
    here are Call Specs and a code snippet from chapter 3 in my book.
    procedure rcproc(rc OUT EmpCurTyp)
    as language java
    name 'refcur.refcurproc(java.sql.ResultSet[])';
    function rcfunc return EmpCurTyp
    as language java
    name 'refcur.refcurfunc() returns java.sql.ResultSet';
    * Function returning a REF CURSOR
    public static ResultSet refcurfunc () throws SQLException
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:oracle:kprb:");
    ((OracleConnection)conn).setCreateStatementAsRefCursor(true);
    Statement stmt = conn.createStatement();
    ((OracleStatement)stmt).setRowPrefetch(1);
    ResultSet rset = stmt.executeQuery("select * from EMP order by empno");
    // fetch one row
    if (rset.next())
    System.out.println("Ename = " + rset.getString(2));
    return rset;
    Kuassi

  • How to pass values to dashboard prompts from external applications

    Any idea is well appreciated.
    How can I pass values of dashboard prompts from external applications to the dashboard prompts so that the dashboard is prefiltered based on values sent by external applications.
    Thanks in Advance!
    Kris

    Kris,
    i am able to change the session variable and able to call the dashboard from external app, but i identified prompt value not changing. but Finally i am able to found a workaround for you.
    Use the following URL and it explained here
    http://localhost:9704/analytics/saw.dll?Dashboard&nquser=Administrator&nqpassword=Administrator&PortalPath=/shared/abcd/_portal/dash1&Options=rmf&DSN=madan
    PortalPath is your dashboard location. /shared/abcd is folder where i saved dashboards. dash1 is my dashboard name.
    internally this dashboard includes many reports that uses the session variable. after doing above this i am able to update the session variable to the value i have given in URL, DSN=value.
    You may observer here that calls the dashboard and passes the value but its not updating the prompt value. so workaround for this is edit your prompt,
    change the Default to - SQL Results and place the sql
    SELECT CASE WHEN 1=0 THEN Markets.Region ELSE VALUEOF(NQ_SESSION.DSN) END saw_0 FROM Paint
    again here Market.Region is column from presentation layer and Paint is subject area. After doing this step, your prompt always shows value in the session varible as default.
    Now include reports and dashboard prompt in the dashboard and run this url from external applicaitons.
    http://localhost:9704/analytics/saw.dll?Dashboard&nquser=Administrator&nqpassword=Administrator&PortalPath=/shared/abcd/_portal/dash1&Options=rmf&DSN=madan
    it worked for me and blog this soon. if it works for you mark the question as answered and mark my replies as correct.
    thanks
    - Madan

  • Passing parameters from Excel to SQL stored proc. to analyse resultset in PowerPivot

    Hi,
    Not sure if I posted this question at the right forum ...
    I would like to implement the following scenario:
    - Enter parameters @startdate and @enddate in cells in an Excel worksheet (i.e. cell A2 has the value for the startdate parameter; cell B2 has the value for the endate parameter).
    - Pass these parameters to a SQL stored procedure (using MSQuery?). See below.
    - Calling stored procedure in PowerPivot to get the resultset in PowerPivot.
    The SP calls some functions in SQL Server. See below.
    I have read several posts on several forums but I can't get the parameters from Excel (MSQuery?) to the SP.
    What's the best way to have PowerPivot picking up the resultset from the SP?
    How do I get the Excel cells A2 and B2 to the SP below?
    SP:
    USE [Test]
    GO
    /****** Object: StoredProcedure [dbo].[_Pink_SP_CapaciteitTest] Script Date: 29-7-2014 15:41:04 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[_Pink_SP_CapaciteitTest]
    @startdate DATETIME,
    @enddate DATETIME
    AS
    BEGIN
    SET NOCOUNT ON
    SET DATEFIRST 1
    DECLARE @TempCapacity TABLE
    ResourceNo INT,
    ResourceName NVARCHAR(60),
    JobCode NVARCHAR(12),
    JobDescription NVARCHAR(50),
    CostcenterCode NCHAR(8),
    CostcenterDescription NVARCHAR(50),
    CostcenterClass NVARCHAR(30),
    CostcenterClassDescription NVARCHAR(60),
    Date DATETIME,
    Weekday INT,
    WeekNo INT,
    Month INT,
    Year INT,
    Capacity FLOAT,
    ConsultancyTot FLOAT,
    ConsultancyTotReserved FLOAT,
    Sick FLOAT,
    Doctor FLOAT,
    Pregnant FLOAT,
    Vacation FLOAT,
    VacationCancellation FLOAT,
    SpecialLeave FLOAT,
    CompHours FLOAT,
    Support FLOAT
    INSERT INTO @TempCapacity
    SELECT h.res_id AS ResourceNo,
    h.fullname AS ResourceName,
    h.job_title AS JobCode,
    j.descr50 AS JobDescription,
    h.costcenter AS CostcenterCode,
    cc.oms25_0 AS CostcenterDescription,
    ccc.CostcenterClassCode AS CostcenterClass,
    ccc.Description AS CostcenterClassDescription,
    CONVERT(VARCHAR(10), t.datum, 105) AS [Date],
    DATEPART(DW, t.datum) AS [Weekday],
    (SELECT [dbo].[ISOWeekNumber] (t.datum)) AS WeekNo,
    MONTH(t.datum) AS [Month],
    YEAR(t.datum) AS [Year],
    (SELECT ROUND([dbo].[HRCapacityHours] (h.res_id, t.datum, t.datum), 2)) AS Capacity,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (50, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTot,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (51, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTotReserved,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9538, h.res_id, t.datum, t.datum + 1), 0)) AS Sick,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8531, h.res_id, t.datum, t.datum + 1), 0)) AS Doctor,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9924, h.res_id, t.datum, t.datum + 1), 0)) AS Pregnant,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8501, h.res_id, t.datum, t.datum + 1), 0)) AS Vacation,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8551, h.res_id, t.datum, t.datum + 1), 0)) AS VacationCancellation,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (8511, h.res_id, t.datum, t.datum + 1), 0)) AS SpecialLeave,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (9518, h.res_id, t.datum, t.datum + 1), 0)) AS CompHours,
    (SELECT ISNULL([dbo].[HRAbsenceHours] (3200, h.res_id, t.datum, t.datum + 1), 0)) AS Support
    FROM humres h (NOLOCK)
    LEFT OUTER JOIN hrjbtl j (NOLOCK) ON h.job_title = j.job_title
    LEFT OUTER JOIN kstpl cc (NOLOCK) ON h.costcenter = cc.kstplcode
    LEFT OUTER JOIN CostcenterClasses ccc (NOLOCK) ON cc.Class_01 = ccc.CostcenterClassCode AND ccc.ClassID = 1
    CROSS APPLY (SELECT * FROM [dbo].[AllDays] (@startdate, @enddate)) t
    WHERE h.ldatindienst <= t.datum
    AND ISNULL(h.ldatuitdienst, t.datum) >= t.datum
    AND h.fullname NOT LIKE '%inhuur%'
    AND h.emp_type IN ('E', 'C')
    AND h.job_title IN ('F09CONS', 'F09PRIN')
    ORDER BY h.fullname,
    t.datum
    SELECT * FROM TempCapacity
    END
    Thanks!

    Hi,
    According to your description, I think you want to call a store procedure in PowerPivot with the parameters which are stored in the cells of an Excel workbook.
    Are you using the PowerPivot add-in in Excel or PowerPivot in SQL Server?
    This forum is to discuss problems of Office development such as VBA, VSTO, Apps for Office .etc. If you are using Excel PowerPivot, since it is an add-in for Excel and it doesn't publish API for us, we cannot automatically call a stored procedure in Excel.
    We can get the data from Cells A2 and B2 with code, but it's hard to set it as the parameters of a SP when calling it from PowerPivot. About calling a SP from Excel manually, you could post in
    Excel IT pro forum for more effective responses.
    If you are using PowerPivot in SQL Server, I'm afraid your issue is more related to the feature of PowerPivot. We can get data from SQL Server database into Excel workbook, but I'm not sure whether we can get data from Excel cells in SQL Server. So I suggest
    you posting in
    SQL Server PowerPivot forum for more effective responses.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to pass a report value to an external website URL??

    Hello,
    Clicking on one of the fields in a report needs to take me to an external website and should pass the value of the field to the URL
    Example:
    1. Let's assume external site is http://www.abc.com
    2. The values in a column in my report range from 1 to 1000.
    3. When I click on say value 21 in my report, the URL formed should be http://www.abc.com/21 and should open in a new browser. Similary, when I click on value 994 in my report, the URL should be http://www.abc.com/994
    Note: I have created reports before and linked them(passed parameters) sucessfully to other objects(forms,reports) etc.. But, haven't passed parameters to external websites before!
    Would really appreciate if anyone could point me in the right direction.
    Thanks
    Dev Govindaswamy

    Please take a look @
    how-to-pass-null-value-to-multi-value
    Passing NULL parameter from aspx page to Report Server

  • How to pass a structure/array of structure as input parameter in a webservice

    Hi Team,
    I am trying to create a webservice in powerbuilder .net( pb 12.5.1) . As this webservice will be used by external world to access some of data on basis of some input paarameter.
    So can i use array of structure as input parameter to a webservice ? If no, then how can i pass a result set ( mora then 1 row with more than one column)
    as an argument to the webservice.
    Regards
    Subrat

    I am assuming this is the same for .Net but in Classic you can create NVO's with Instance Variables and then reference them in the NVO that will be used as the parameter for the Public WebService.
    WS NVO's:
    Children
         String             Child[]
    Customer
         String             FirstName
         String             LastName
         String             DOB
         Children          Children
    Public Interface uses Customer
    Calling Code Example:
    integer    rc, liNdx
    string     lsReturn
    SoapConnection lSoapConnect
    proxy_testing  px_Testing
    lSoapConnect = CREATE SoapConnection
    if IsValid(lSoapConnect) then
    TRY
      rc = lSoapConnect.CreateInstance(px_Testing, 'proxy_testing')
      CHOOSE CASE rc
       CASE 100
        lsReturn = "Invalid proxy name"
       CASE 101
        lsReturn = "Failed to create proxy"
       CASE 0
        Proxy_Customer lNewCustomer
        lNewCustomer = CREATE Proxy_Customer
        lNewCustomer.FirstName = 'Chris'
        lNewCustomer.LastName = 'Craft'
        lNewCustomer.DOB = 'Getting Older'
        Proxy_Children lChildren
        lChildren = CREATE Proxy_Children
        lChildren.Child[1] = 'Madeline'
        lChildren.Child[2] = 'Hayden'
        lNewCustomer.Children = lChildren
        lsReturn = px_Testing.NewCustomer(lNewCustomer)
       CASE ELSE
        lsReturn = "Unknown error (" + String(rc) + ")"
      END CHOOSE
      if rc <> 0 then MessageBox("Invocation Error", lsReturn, Exclamation!)
    CATCH (RuntimeError rte)
      rc = -1
      MessageBox("Runtime Error", rte.text, Exclamation!)
    END TRY
    end if
    Chris Craft

  • How to pass a value into a SQL Query?

    Hi There,
    I want to know if there is a possibility to pass a dynamic value in a sql query. For example I have a currency rate value (ex: rate = 1.319, 2.23 etc) which user wants to input when running the query (The rate is not taken from the system, so I cannot compare to any table column and pass it as a parameter).
    And this rate has to be used in my query to do some calculation. Is this possible? The value :p_currency_rate doesn't work
    Any ideas please?
    Thank you,
    Prathibha

    SELECT DISTINCT
    hou.name
    ,poh.segment1 po_num
    ,pol.line_num po_line_num
    ,poh.currency_code
    --,trunc(poh.creation_date) po_creation_date
    ,pol.cancel_flag
    ,msi.segment1 item_num
    ,pol.unit_price
    ,round(cost.item_cost,5)
    ,round((&p_rate * pol.unit_price),5) "CONVERSION"
    ,(cost.item_cost - round((&p_rate * pol.unit_price),5)) difference
    ,pov.vendor_name
    FROM
    po.po_headers_all poh
    ,po.po_lines_all pol
    ,po.po_vendors pov
    ,hr.hr_all_organization_units hou
    ,inv.mtl_system_items_b msi
    ,bom.cst_item_costs cost
    WHERE
    poh.po_header_id = pol.po_header_id
    and pov.vendor_id = poh.vendor_id
    and poh.org_id = hou.organization_id
    and hou.organization_id = :p_operating_unit
    and poh.currency_code = :p_currency
    and poh.creation_date between :po_creation_date_from and :po_creation_date_to
    and poh.type_lookup_code = 'BLANKET'
    and msi.inventory_item_id = pol.item_id
    and cost.INVENTORY_ITEM_ID = pol.ITEM_ID
    --and (cost.item_cost - pol.unit_price) <> 0
    and (cost.item_cost - round((&p_rate * pol.unit_price),5)) <> 0
    and cost.organization_id = 1
    and msi.organization_id = 1
    and cost.cost_type_id = 3 --- Pending cost type
    and nvl(upper (pol.closed_code),'OPEN') not in('CANCELLED', 'CLOSED', 'FINALLY CLOSED', 'REJECTED')
    and nvl(upper (poh.closed_code),'OPEN') not in('CANCELLED', 'CLOSED', 'FINALLY CLOSED', 'REJECTED')
    and nvl(pol.cancel_flag, 'N') = 'N'
    and &p_rate user parameter
    I want this p_rate to be passed as a user parameter.

Maybe you are looking for

  • Photoshop CS5 downloading duplicate files

    How do you keep Bridge in CS5 from duplicating files when dumping an SD card in Windows 7 64-bit?  I frequently have to dump 400 pics at a time and if I don't get to the backup before the next dump, I have the old files and new on the card.  Unchecki

  • Duplicating contacts

    Hi Have set up iCloud on my iPhone4, iPad2, iMac, and Mac Air. Now have each contact appearing 3 times in mu iPhone contacts. What have I done wrong?

  • MessagingException: No response available

    Hi Experts, I am facing a problem in Production server (PI 7.1). I have synchronous interfaces between SOAP to RFC and RFC to RFC via PI. Some time, the interfaces are failing with the error u201Ccom.sap.engine.interfaces.messaging.api.exception.Mess

  • N8 problem installing panorama app

    Hello, I'm unable to get the panorama app to install. I've read that this could be due to a qt runtime issue but the links to the download are no longer valid. Can someone help me find it? Thanks,

  • DVCPRO HD Workflow? What is the CODEC?

    What is the best or preferred workflow to edit and export the final project for highest quality output? Background: we shot our film on The HVX 200 - 24p, 16 x 9 - 720p. Our editor imported the files with this codec, however, I'm not confident that w