Creating external function

We are trying to create an external function that will be linked at run- time. How is such a function compiled?
Does it need to be compiled into a Dynamic library? Or would the function be called?
The operating system we are trying to do this is Sun UNIX Solaris. However any insight would be of great
assistance.

I have a nasty feeling there is in XQuery expressions, but I'm not going there. ;-)
michaels>  WITH t AS
     (SELECT 1 ID, 1 x, 2 y FROM DUAL UNION ALL
      SELECT 2,    3,   4   FROM DUAL UNION ALL
      SELECT 3,    5,   6   FROM DUAL)
SELECT   *
    FROM XMLTable('declare function local:a($a,$b)
                     ($a + $b)
                   }; (: eof :)
                   for $i in /ROWSET/ROW
                   return <ROW>
                          <ID>{$i/ID}</ID>
                          <X>{$i/X}</X>
                          <Y>{$i/Y}</Y>
                          <A>{local:a($i/X,$i/Y)}</A>
                          <B>{local:a($i/X,$i/Y) + 2}</B>
                          </ROW>' PASSING XMLTYPE(CURSOR(SELECT * FROM t))
                   COLUMNS ID NUMBER PATH 'ID',
                            X NUMBER PATH 'X',
                            Y NUMBER PATH 'Y',
                            A NUMBER PATH 'A',
                            B NUMBER PATH 'B'
        ID          X          Y          A          B
         1          1          2          3          5
         2          3          4          7          9
         3          5          6         11         13

Similar Messages

  • In BOX R2 Universe how to create External Function in C++??

    Hi All,
    Can any one tell me how to create dynamic SQL Query in BOXI R2 Universe, I heard that we can create c++ custom external functions.
    i know the procedure for using Oracle functions but that is taking more time to generate report.
    I want to create a conditional statement inside universe
    Following are three queries
    Query1 = select a,b,c,d from aab where a=@Prompt(jjjjjjj)
    Query2 = select a,b,c,d from aab where a=oracleFunction(@Prompt(jjjjjjj))
    Query3 = select a,b,c,d from aab where a=@myFunc(@Prompt(jjjjjjj))
    The above example is a simple one but in my real senario that function is called 120 times in my single query.
    Query1 takes 7 minutes
    Query2 takes 30-35 minutes (as that oracle function is called 120 times)
    So i want to create a custom external function in c++ so that the conditional expression is evaluated at BOBJ Server and the result of that function goes as a normal static string to oracle server.
    so it will again reduce the time
    Any ideas..

    Hi Mehmet,
    Please provide following information:
    1. How are you creating these functions (are you creating a Webi Extension Point)?
    2. How are you compiling these functions?
    3. Are you using Visual Studio to create these functions?
    Webi Rich Client is a 32 bit application so a function which is compiled in 32 bit mode would be visible in it.
    To access these functions through BI LaunchPad which is a 64bit application, we need to compile the function in x64 mode.
    Also make sure you compile the function in Release mode.
    Hope this helps.
    Regards,
    Vinit Shete

  • Tnx. IW22 Change PM Notification -  Create external document (URL) posting

    Hi:
    I am in transaction IW22 i.e. Change PM Notification.  There is a 'Services for object' drop down which appears below the enter tick.  This appears in online but not in BDC.  I have tried it through the transaction SHDB i.e. Transaction Recorder also herein the 'Services for object' does not appear.  I need to post entries through 'Create external document (URL)' through the 'Services for object' drop down using BDC / BAPI / etc.
    Please advice.
    NB.

    Hi NB,
    We have similar issue for QM notification and I have used function "SO_OBJECT_INSERT".
    I am enclosing my code may be useful for you:
    FORM CREATE-URL-ATTACHMENT.
      CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
        EXPORTING
          REGION    = 'B'
        IMPORTING
          FOLDER_ID = FOLDER_ID
        EXCEPTIONS
          OTHERS    = 1.
      CLEAR: LS_OBJCONT, LT_OBJCONT, LT_OBJHEAD.
      REFRESH: LT_OBJCONT, LT_OBJHEAD.
      CONCATENATE '&KEY&' H-URL INTO LS_OBJCONT.
      APPEND LS_OBJCONT TO LT_OBJCONT.
      CLEAR: L_OBJ_DATA.
      L_OBJ_DATA-OBJSNS = 'O'.
      L_OBJ_DATA-OBJLA  = SY-LANGU.
      L_OBJ_DATA-OBJDES = 'NOTES URL'.
      CALL FUNCTION 'SO_OBJECT_INSERT'
        EXPORTING
          FOLDER_ID             = FOLDER_ID
          OBJECT_TYPE           = 'URL'
          OBJECT_HD_CHANGE      = L_OBJ_DATA
        IMPORTING
          OBJECT_ID             = L_OBJ_ID
        TABLES
          OBJHEAD               = LT_OBJHEAD
          OBJCONT               = LT_OBJCONT
        EXCEPTIONS
          ACTIVE_USER_NOT_EXIST = 35
          FOLDER_NOT_EXIST      = 6
          OBJECT_TYPE_NOT_EXIST = 17
          OWNER_NOT_EXIST       = 22
          PARAMETER_ERROR       = 23
          OTHERS                = 1000.
      CLEAR: IS_OBJECT.
      IS_OBJECT-OBJKEY = WQMNUM.
      IS_OBJECT-OBJTYPE = 'BUS2078'.
      CLEAR: REL_DOC.
      CONCATENATE FOLDER_ID L_OBJ_ID INTO REL_DOC-OBJKEY.
      REL_DOC-OBJTYPE = 'MESSAGE'.
      CALL FUNCTION 'BINARY_RELATION_CREATE'
        EXPORTING
          OBJ_ROLEA    = IS_OBJECT
          OBJ_ROLEB    = REL_DOC
          RELATIONTYPE = 'URL'
        EXCEPTIONS
          OTHERS       = 1.
      IF SY-SUBRC EQ 0.
        COMMIT WORK.
      ELSE.
        T_MESSAGE = 'Notification Attachment Add Failed'.
        APPEND T_MESSAGE.
        CLEAR: T_MESSAGE.
        T_MESSAGE = 'Reference:'.
        T_MESSAGE+11(20) = H-REF.
        APPEND T_MESSAGE.
        CLEAR: T_MESSAGE.
        T_MESSAGE = 'Notification:'.
        T_MESSAGE+14(12) = WQMNUM.
        APPEND T_MESSAGE.
        CLEAR: T_MESSAGE.
        T_MESSAGE = 'URL:'.
        T_MESSAGE+5(72) = H-URL.
        APPEND T_MESSAGE.
        PERFORM SEND-EMAIL.
      ENDIF.
    ENDFORM.                    "create-url-attachment
    Hope this may help you.
    Please reward all the useful answers.
    Regards,
    Lanka

  • MM03/MM02 Need to create external document URL

    Hi All,
        We are having a requirement to create web link for materials using transactions MM03 or MM02.
        The exact path for this is as follows:
        Go to MM03/MM02 -> Enter material ->Basic data view -> Systems Menu -> Services for object -> Create external document URL.Here we need to enter the title and URL.
        The other path is clicking on the services for objects button that comes on the title bar and create the same.
        Is there any BAPI that can be used to achieve this.
    Reward points assured.
    Thanks and regards,
    Nilesh.

    Hi Nilesh,
        can you try 
    Using this function module:
      CALL FUNCTION 'GUI_RUN'
      EXPORTING
      command ='IEXPLORE.EXE'
      PARAMETER ='WWW.YAHOOMAIL.COM'.
    CD =
    IMPORTING
    RETURNCODE =
    in the appr place of coding
    <u>Reward pts if found usefull :)</u>
    Regards
    Sathish

  • FM to create external document(URL)   FBL1n transaction

    Hi!
    I'm trying to create a URL link in FBL1n but I'm not been able to do it.
    I checked this link[ FM to create external document(URL)|FM to create external document(URL)]
    but I'm not getting the URL in the link list.
    I can create the link manually as Vimal kumar  did, but in transaction FBL1n.
    My code is like this (I think one of the parameters is wrong.)
    data: it_BAPIPROPER type BAPIPROPER occurs 0,
          wa_BAPIPROPER like BAPIPROPER.
    DATA: WA_logical_system LIKE TBDLS-LOGSYS.
    CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
    IMPORTING
       OWN_LOGICAL_SYSTEM         = WA_logical_system
    EXCEPTIONS
       OWN_LOGICAL_SYSTEM_NOT_DEFINED       = 1
       OTHERS                               = 2.
    wa_bapiproper-prop_name = 'DESCRIPTION'.
    wa_bapiproper-prop_value = 'Test'.
    APPEND wa_bapiproper TO it_bapiproper.
    CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CRE_O_URL'
    EXPORTING
    LOGICAL_SYSTEM        = WA_logical_system
    classname = 'BSEG'
    classtype = 'BO'
    object_key ='10001900000000210001'
    url = 'http://metcold/ss2000/plainlinkurl.asp?dbid=08&k=Supplier_No,Invoice_No&v=22549,029214758&username=guest&password=guest.url'
    mimetype = 'TEXT/PLAIN'
    TABLES
    properties = it_bapiproper
    commit WORK.
    this is been execute with sy-subrc eq 0.
    Any idea?
    Thanks.

    Hi
    I tried attach an URL to document line, but without results. If I tried add URL to document header, all works perfectly. Maybe its not possible to add url-s into document lines...

  • FM to create external document(URL)

    Hi All,
    I need to create external document(URL) for equipment and functional location. Manually it is done by clicking a button (called Services for Object) which appears in the left upper corner (on the left side of the transaction heading) and then selecting option (Create External Document URL). Infact this button is availaible in many transactions.
    I need FM/BAPI using which i can create external document(URL) to equipment and functional location programmaticaly.
    Regards,
    Vimal

    Hi Viquar Iqbal,
    Thanks for ur help. It worked.
    The working code (For others reference)
    wa_BAPIPROPER-PROP_NAME = 'DESCRIPTION'.
    wa_BAPIPROPER-PROP_VALUE = 'Test'.
    APPEND wa_BAPIPROPER to it_BAPIPROPER.
    CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CRE_O_URL'
      EXPORTING
        classname             = 'EQUI'
        classtype             = 'BO'
       OBJECT_KEY            ='000000000020000038'
        url                   = 'http://sparsh/V1/'
        mimetype              = 'TEXT/PLAIN'
    TABLES
      PROPERTIES            = it_BAPIPROPER
    Regards,
    Vimal
    Edited by: Vimal  kumar on Feb 18, 2009 2:59 PM

  • FM to create external document(URL) in IE02

    Hi,
    I need to create external document(URL) for equipment master.
    We can create manually it is done by clicking a button Services for Object and then selecting option (Create External Document URL).
    I refered many links but failed to create the url in IE02.Please help me with the example.
    Regards,

    Hi,
    You will need to use function BINARY_RELATION_CREATE for this.
    Check how is it handled in function SGOS_URL_CREATE_DIALOG. Also check code in PAI of screen 2400 (subroutine create_url_doc). You will need to use that code.
    Sridhar

  • Problem in the External Function returned data RAW

    Hi,
    I have a problem, I would want to create an external function in Oracle 10g, than given in input a data RAW it gives back in output the value in format raw.
    I have realized such function through language C.
    these are the prototypes of the function
    ORACLE side:
    CREATE OR REPLACE FUNCTION F_RETURN_RAW (inputText IN RAW)
    RETURN RAW                                                                  -- I do not know to return RAW !!!
    AS LANGUAGE C
    NAME "f_Return_Raw"
    LIBRARY C_Library_DAN
    PARAMETERS
    (inputText RAW,
    inputText INDICATOR,
    inputText LENGTH);
    C side:
    ???? f_Return_Raw(CK_BYTE_PTR in_Text,
    short *in_TextInd,
    int *in_TextLen)
    I do not know what to put in place of ????
    someone can help me with some example?
    thanks to all!
    Regards
    Daniele

    Hello I had already seen the package UTL_RAW,
    in particular is CAST_TO_VARCHAR2 that CAST_TO_RAW,
    but these me are useful Oracle side,
    my problem are to give back to Oracle, from side C, one RAW.
    Perhaps it is not possible to give back a RAW directly?
    or I have more probably not understood your suggestion!
    I would want to create a function that he concurred me to make that
    insert into table_example values(f_Return_Raw(RAW_INPUT))
    that the function gives back RAW directly
    Regards
    Daniele

  • User Defined External Function - How to work?

    I have defined some external functions in java by following the description in
    C:\OraBPELPM_3\integration\orabpel\samples\demos\XSLMapper\ExtensionFunctions
    I can use my functions in JDeveloper, but they do not work on the Oracle BPEL engine.
    Is it enough just to place the jar-file in <OC4J_HOME>\j2ee\home\applib and add the jar-file in class-path (as described)?
    What about the xml-file specifying the functions (called SampleExtentionFunctions.xml in the documentation)?
    Should this file be copied to <OC4J_HOME>\... ?
    Here is the error message I get by running my service:
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "ora:processXSLT("TransformationInput.xsl", bpws:getVariableData("inputVariable", "request"))", the reason is java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xpath.objects.XNodeSet.leadingZeros([ExpressionContext,] #NUMBER)..
    Please verify the xpath query.
    ______________ MY JAVA CODE EXAMPLE: _____________________________
    package extentionfunctions;
    This is a sample XSL Mapper User Defined Extension Functions implementation class.
    public class JavaExtensionFunctionsBpel
    * Inserts leading zeros to a text, if this starts with a digit.
    * Else the return value will be the same as the given text.
    * The return value will have the specified length.
    public static String leadingZeros(String text, int len)
    {  String retur = text;
    char c = (text == ""?'0':text.charAt(0));
    if ('0'<=c && c<='0'+9) { // Is first char a digit?
    retur = "";
    int n = len - (text == ""?0:text.length());
    for (int i=0; i<n; i++) { // Insert zeros:
    retur = '0' + retur;
    retur = retur + text;
    return retur;
    * Removes leading zeros from a text.
    public static String removeLeadingZeros(String text)
    {  String retur = text;
    int pos = 0;
    int len = (text == ""?0:text.length());
    for (int i=0; i<len; i++) {
    if (text.charAt(i)=='0') { // Is char a digit?
    pos++;
    return retur;
    public static void main(String[] args)
    { // Basic test of functions:
    int len = 5;
    String s = "1234";
    String r;
    System.out.println("leadingZeros("+s+","+len+")="+(r=leadingZeros(s,len)));
    System.out.println("removeLeadingZeros("+r+")="+removeLeadingZeros(s));
    Regards
    Flemming Als

    Flemming, it looks like somthing is wrong in the xsl that it still goes to org.apache.xpath.objects.XNodeSet package instead of yours ..
    I created a sample that illustrates the usage of this functions (even with 2 params, different types).
    Java class (com.otn.samples.xslt.CustomXSLTFunctions)
    package com.otn.samples.xslt;
    public class CustomXSLTFunctions
    <function name="extension:multiplyStringAndInt" as="number">
    <param name="base" as="String"/>
    <param name="multiplier" as="number"/>
    </function>
    public int multiplyStringAndInt (String pString, int pMultiplier)
    int base = Integer.parseInt(pString);
    return base * pMultiplier;
    XML descriptor:
    Note the types (in the java class and the xml descriptor)
    for java:base -> string and for xslt:base -> string
    for java:multiplier -> int and for xslt:multiplier -> number
    <?xml version="1.0" encoding="UTF-8"?>
    <extension-functions>
    <functions extension:multiplyStringAndInt="http://www.oracle.com/XSL/Transform/java/com.otn.samples.xslt.CustomXSLTFunctions">
    <function name="extension:multiplyStringAndInt" as="number">
    <param name="base" as="string"/>
    <param name="multiplier" as="number"/>
    </function>
    </functions>
    </extension-functions>
    Definition of variables in the process:
    (as you can see, the base is a string - I do the conversion in my method, and the return value
    is converted to a string by the engine)
    <!-- Input -->
    <element name="CustomXSLTFunctionProcessRequest">
    <complexType>
    <sequence>
    <element name="base" type="string"/>
    <element name="multiplier" type="int"/>
    </sequence>
    </complexType>
    </element>
    <!-- Output -->
    <element name="CustomXSLTFunctionProcessResponse">
    <complexType>
    <sequence>
    <element name="result" type="string"/>
    </sequence>
    </complexType>
    </element>
    Using the new function in the XSL transformation:
    - watch out for the namespace declaration (xmlns:sample="...")
    - and the usage (sample:multiplyStringAndInt)
    <xsl:stylesheet version="1.0"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:extension="http://www.oracle.com/XSL/Transform/java/com.otn.samples.xslt.CustomXSLTFunctions"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:ns0="http://www.w3.org/2001/XMLSchema"
    xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:client="http://xmlns.oracle.com/CustomXSLTFunction"
    exclude-result-prefixes="xsl plnk ns0 client ldap xp20 bpws extension ora orcl">
    <xsl:template match="/">
    <client:CustomXSLTFunctionProcessResponse>
    <client:result>
    <xsl:value-of select="extension:multiplyStringAndInt(/client:CustomXSLTFunctionProcessRequest/client:base,/client:CustomXSLTFunctionProcessRequest/client:multiplier)"/>
    </client:result>
    </client:CustomXSLTFunctionProcessResponse>
    </xsl:template>
    </xsl:stylesheet>
    Then I created a jar file with the class (and for testing the xml descriptor in it)...
    and put it into j2ee/home/applib directory
    hth clemens

  • The troubles with creating SQL function in Java

    Hi!
    I use Oracle 10g and connect to it from Java application. I need in creating SQL functions from Java code.
    In Java I have:
    Statement stm = null; try{     stm = dbConnection.createStatement();     stm.executeUpdate( query ); }catch(SQLException ex){     throw ex; }finally{     try{ stm.close(); }catch(Exception ex){ stm.close(); } }
    And I'm passing the next SQL function:
    create or replace function get_me return number is
    result number;
    begin
    select 5 into result from dual;
    return result;
    end;
    This code is run successful, but I can't call this funtion, because it has status Invalid
    I'm looked the next error: PLS-00103: Encountered the symbol "" when expecting one of the following: . @ % ; is authid as cluster order using external character deterministic parallel_enable pipelined aggregate
    But I don't understand, What the matter? From Oracle Enterprise Manager I can create this function without problems. So, I wrote the wong Java code. Also, I can't find my error :(
    May be, do u have the some ideas?
    Thank you very much!

    Post the whole pl/sql code please.
    To run PL/SQL from within java you'll need callablestatement.
    [here |http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java] an example : http://www.idevelopment.info/data/Programming/java/jdbc/PLSQL_and_JDBC/CallPLSQLFunc.java

  • Using external function in xquery

    hi all,
    i'm using the Java Api to access Berkeley dbxml.
    i'm trying to raise a number, i get from the database,to a power
    the code i use is :
    String Query = "declare namespace power = 'java:java.lang.Math';";
    Query += "declare function power:pow($this as xs:double,$val as xs:double) as xs:double external; \n"+
    "power:pow(number1,number2)";
    XmlQueryContext context = XmlManager.createQueryContext();
    XmlResults results = XmlManager.query(str, context, null);
    ,,when i run the programm the answer is an uncaught exception from the database.
    Does somebody know how i can use the external function power?
    Message was edited by:
    user556027

    On closer reflection, I realized that external functions would not help with the problem I described. I suppose I would need to do some parsing on my own side and let Javascript retrieve the files (as with non-XML AJAX), let Firefox convert each file to its inner (well-formed) representation, do any necessary processing to circumvent deliberate attempts to create poorly convertible documents (e.g., a certain famous site's trick to have an attribute like )="", an incomplete DOCTYPE, or comments like <!--- ). Though, I do think it would be nice if BDBXML could do such cleaning up HTML to be well-formed before including it (or even allow non-XML documents to be loaded into a document which was flagged as non-XML where detected as such).

  • External Function memory leak

    The ExternalFunction.java sample code distributed with v.2.5.16 has a memory leak.
    You can see this by changing the loop to iterate a million times; eventually it runs out of memory and crashes.
    (I used jdk 1.7 u2 on Windows 7.)
    I tried adding explicit calls to delete() for every created Java object in the example, none of which helped.
    As far as I can tell, it is simply not possible to use external functions from Java without leaking memory.
    Any thoughts on this?

    thanks Silviu
    i create two bugs
    https://bugbase.adobe.com/index.cfm?event=bug&id=3341143
    https://bugbase.adobe.com/index.cfm?event=bug&id=3341146

  • External function specification

    Hi All!
    (Envs: Centos 5.2, Oracle 10.2.0.4)
    According to documentation a developer should provide RETURN clause in the external function parameters declaration.
    But I faced a conflict with additional extproc specific parameters , INDICATOR for example...
    Option 1 (no INDICATOR variable in specification)
    CREATE OR REPLACE FUNCTION MyTest(Lang IN VARCHAR2, Form IN VARCHAR2) RETURN VARCHAR2
    AS EXTERNAL
    LIBRARY Lemma_Ext
    NAME "MyExtTest"
    LANGUAGE "C"
    WITH CONTEXT
    PARAMETERS(CONTEXT,Lang string, Form string, RETURN string)
    and it works OK with it's "C" prototype
    +char * MyExtTest (char Lang, char Form);+
    Option 2 (with INDICATOR, doesn't work):
    CREATE OR REPLACE FUNCTION MyTest(Lang IN VARCHAR2, Form IN VARCHAR2) RETURN VARCHAR2
    AS EXTERNAL
    LIBRARY Lemma_Ext
    NAME "MyExtTest"
    LANGUAGE "C"
    WITH CONTEXT
    PARAMETERS(CONTEXT, Lang string, Form string, RETURN INDICATOR short, RETURN string)
    and it is not works with following "C" prototype:
    +char * MyExtTest (char Lang, char Form, short *return_ind);+
    Option 3 (with INDICATOR, works!):
    CREATE OR REPLACE FUNCTION MyTest(Lang IN VARCHAR2, Form IN VARCHAR2) RETURN VARCHAR2
    AS EXTERNAL
    LIBRARY Lemma_Ext
    NAME "MyExtTest"
    LANGUAGE "C"
    WITH CONTEXT
    PARAMETERS(CONTEXT, Lang string, Form string, RETURN INDICATOR short)
    and it works like a charm with the same "C" prototype as in the Option 2:
    +char * MyExtTest (char Lang, char Form, short *return_ind);+
    Just removing "RETURN string" was a correct solution!
    And I found a couple of examples of successful external functions (with extra parameters) from Metalink. All these examples don't contain RETURN <type> in function specification.
    So, where is the source of misunderstanding?
    Regards,
    Andrew.

    Hi AndresG,
    Are you using O2A cartridges or not?
    If you are not, by default, the fulfillment states are in the following location --
    a) external fulfillment state -- /ControlData/Functions/<Function>/orderItem/ExternalFulfillmentState
    b) composite fulfillment state (i.e. output of FS composition) -- /ControlData/OrderItem/OrderItemFulfillmentState for order items, and /ControlData/OrderFulfillmentState for overall order.
    Note that mapped fulfillment states are not persisted.
    These defaults are configurable by creating FulfillmentStateModule.xquery file, and have XML catalog include the file. In fact, this is how O2A cartridges override these defaults; the fulfillment states are stored in /OrderLifeCycleManagement area.
    Yes, you can update the external fulfillment state during function execution -- in your automation of the function, simply return the external fulfillment state in your xquery automator.
    To send composite fulfillment state to CRM, yes, you need to create a Data Changed Event Notification -- set it to trigger by Composite Fulfillment State change.
    Cheers,
    Daniel Ho
    OSM Product Management

  • Trying to Create External Table in 8i

    hi Grus,
    We are still on 8.1.7 version. And oracle 8i doesn't support the External table feature. last week i found a very useful documentation to access an operating system file from SQPLUS. but i am having a small problem, may be one of you guys can give me a tip if i am doing something wrong. below is the story.
    1) i created a object type with 4 attributes in database.
    CREATE OR REPLACE TYPE Artist_Row_Type AS OBJECT
    ARTIST_ID NUMBER(10),
    LASTNAME VARCHAR2(255),
    FIRSTNAME VARCHAR2(255),
    LASTNAMEFIRSTNAME VARCHAR2(255)
    2) Then i created a collection type of obove object type.
    CREATE OR REPLACE TYPE artist_tab_type AS TABLE OF artist_row_type;
    3) Created a function
    CREATE OR REPLACE FUNCTION Get_Artist
    RETURN artist_tab_type
    IS
    artist_tab artist_tab_type := artist_tab_type ();
    l_file UTL_FILE.file_type;
    l_text VARCHAR2 (2000);
    l_orig_str VARCHAR2 (2000);
    cnt PLS_INTEGER := 0;
    l_start_pos INTEGER := 1;
    l_end_pos INTEGER := 1;
    TYPE xyz IS TABLE OF VARCHAR2 (2000)
    INDEX BY BINARY_INTEGER;
    var xyz;
    BEGIN
    l_file := UTL_FILE.fopen ('/export/home/taskmgr/SA/DAT', 'artist.dat', 'r');
    BEGIN
    FOR i IN 1 .. 4
    LOOP
    var (i) := ' ';
    END LOOP;
    LOOP
    UTL_FILE.get_line (l_file, l_text);
    FOR i IN var.FIRST .. var.LAST
    LOOP
    IF l_end_pos <> 0
    THEN
    l_end_pos := INSTR (l_text, '|', l_start_pos);
    IF l_end_pos = 0
    THEN
    var (i) := l_text;
    END IF;
    l_orig_str := l_text;
    l_text := SUBSTR (l_text, INSTR (l_text, '|') + 1);
    IF l_end_pos <> 0
    THEN
    var (i) := SUBSTR (l_orig_str, 1, INSTR (l_orig_str, '|') - 1);
    END IF;
    END IF;
    END LOOP;
    artist_tab.EXTEND;
    artist_tab (artist_tab.LAST) := artist_row_type (var (1), var (2), var (3), var (4));
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    NULL;
    END;
    UTL_FILE.fclose (l_file);
    RETURN artist_tab;
    END;
    suppoose first line in a external file is '14522|||Lessig|||Minna|||Lessig, Minna'
    and when i execute the following query.
    select * FROM TABLE(Cast(Get_Artist() AS artist_tab_Type));
    i get the following result.
    ARTIST_ID LASTNAME FIRSTNAME LASTNAMEFIRSTNAME
    14522 Lessig
    while i should get the following result
    ARTIST_ID LASTNAME FIRSTNAME LASTNAMEFIRSTNAME
    14522 Lessing Minna Lessig, Minna
    is any body can have look in my function code if something is missing please let me know.
    Thanks
    Asif

    The data in your file is separated by ||| (three pipes) but your routine is using | (one pipe) as its token.
    Cheers, APC

  • Creating Externally Authenticated users

    Greetings,
    We recently migrated our Security team from Windows XP to Windows 7. With this upgrade, they were forced to stop using the java Oracle 9i Enterprise Manager to manage security and database users. I was able to find the View->DBA tab in Oracle SQL Developer which allows for things like CREATE LIKE, CREATE, etc, but under the CREATE USER, I see nowhere where the tool allows for a user other than a normal database authenticated account. We have a few key databases where we must create externally authenticated users (EXTERNAL) and this just isn't an option. Is this functionality anywhere in the tool?
    Thanks
    Bradd

    We recently migrated our Security team from Windows XP to Windows 7. With this upgrade, they were forced to stop using the java Oracle 9i Enterprise Manager to manage security and database users. I was able to find the View->DBA tab in Oracle SQL Developer which allows for things like CREATE LIKE, CREATE, etc, but under the CREATE USER, I see nowhere where the tool allows for a user other than a normal database authenticated account. We have a few key databases where we must create externally authenticated users (EXTERNAL) and this just isn't an option. Is this functionality anywhere in the tool?
    I don't understand what you are trying to do.
    Post your full sql developer info and explain in detail what you mean; with an example if possible.
    You can create users in the DB the way you do with any tool: write the appropriate DDL for CREATE USER. For OS authentication you add the OS_AUTHENT_PREFIX to the user name.
    In sql developer create connections for those users using the connections dialog that you use for any other user. On that dialog there is a checkbox for OS authentication.
    See this article by Sue Harper and see if the example for local OS authentication she provides answers your question:
    http://www.oracle.com/technetwork/issue-archive/2008/08-may/o38sql-102034.html
    To configure local OS authentication for a new user, first find the value of the OS_AUTHENT_PREFIX database initialization parameter in your system's init.ora file. When you create this new user in the database, you must add this parameter value as a prefix to the OS username. The default value is OPS$, for backward compatibility with earlier database releases. (If the value is "", the OS username and the database username are the same, so you don't need to add a prefix to create the Oracle usernames.)
    Establish a basic connection with the HR schema as the SYSTEM user. Execute the following from the SQL worksheet, using your database's OS_AUTHENT_PREFIX prefix and substituting your own OS username for "sue":
    CREATE USER ops$sue IDENTIFIED EXTERNALLY;  GRANT Connect, resource to sue;     
    Now create a basic connection for this user from the New / Select Database Connection dialog box. Enter a connection name; select Basic for Connection Type ; fill in the Hostname and Port fields; select OS Authentication ; and provide a SID or Service name . Click Test and Connect as before.

Maybe you are looking for

  • Status Change for Purchase order in Process Purchase order

    Hi All, We have implemented SRM 4.0 with Extended Classic scenario. SRM does provide standard status for Process Purchase order worklist (such as Ordered, Held, Error in Process etc.). Is there any BADI i can use to overright my own status message fo

  • Sub contracting Order

    Hi , I am having a question that what decide the child components to be pulled on to the component screen if I have already maintained for the parent component (1) Material Master with subcontracting Key 30 - Subcontracting (2) Bill of material for c

  • EXPORT using OEM10g

    Hi All, I am trying to export(Instead of running a daily backup using RMAN, I want to schedule a daily export) a Oracle 11gR2 non-ASM database to ASM file system that we have on the server. Basically I want to use ASM file system as the backup direct

  • Initialization Error when starting an OS9 app. Network name already in use.

    Just this morning when opening an application that I've been working with over a week, I got an Initialization Error stating that the computer's network name is already in use and startup cannot continue. I renamed the computer in both OS9 and OSX an

  • GDS: Material not inserted into repository

    Hi all, When trying to load a material from our ERP system into the GDS repository (via XI and the JavaProxy call), we notice an increased load on the MDM server, but the material does not show up in the repository. Neither in the MDM logs, nor in th