Using a C function in Oracle

Hi,
I have a field in my table that stores an ID which is encoded using a C function. (third party database)
I have also been provided the C function that decodes that field to display the actual value. I have compiled this code using Visual Studio .Net 2003 to a dll file, but do not know how to use it in Oracle. Or are there other ways to use this decode function in Oracle?
I am on 9i database, Windows 2003 server.
Any help is appreciated.
Thank you.

Hi, see:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9087161189226

Similar Messages

  • Use of between functionality in oracle

    what is the use of between functionality in oracle
    my understanding is if i tell val between a and b then it should be >a and <b
    whether it will vary with different versions of oracle
    please clarify
    thanks in advance

    Have you considered looking in the documentation?
    "This comparison operator tests whether a value lies in a specified range. It means: greater than or equal to low value and less than or equal to high value."

  • T-SQL functions in ORACLE

    Use T-SQL functions in ORACLE too, so you can write one script version that works in SYBASE, SQLSERVER and ORACLE when need to use the following functions:
    ceiling, charindex, dateadd, datediff, datename, datepart, day, db_id, db_name, getdate, host_id, host_name, left, len, month, replicate, right, space, str, str_replace, stuff, substring, suser_id, suser_name, user_id, user_name and year.
    The file [comp_tsql_ORA_schema.txt|http://forums.databasejournal.com/attachment.php?attachmentid=564&d=1258547015] creates the tablespace and schema to put the objects, and the file [comp_tsql_ORA.txt|http://forums.databasejournal.com/attachment.php?attachmentid=569&d=1259256898] creates the functions into the new schema. They will be avaliable for any schema of the oracle instance.
    Hope this help!
    Any suggestion please contact.
    aklein2003
    Edited by: user1958693 on 26/11/2009 10:16

    jgarry wrote:
    J2EE beta released around 1999. Religious programming wars far preceded that. Here's but [one example|http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/1c50bc13e9302f00/34bb8f3ac77e2388?q=programming+language+religion#34bb8f3ac77e2388] from a quick google. I'm no longer convinced that elegance is a desirable trait for a language. So call me a heretic.
    Ever tried XLISP? :-)
    It's different. Back then it was simply the language itself. And it was not really a religious kind of battle, but more a mine-is-bigger-and-better-than-yours one.
    With Java, it is all about The Acrhitecture and the blessed language of Java. ;-)
    I wouldn't so much blame J2EE believers for that. I think there is a fundamental complexity to web type paradigms that hasn't been described in a precise and encompassing enough manner to enable correct project planning.The basic problem is that the database is treated as a persistent storage layer only. A bit bucket. And that is exactly what a database is not.
    But as it is used that, loads of database features now need to be duplicated in the application layer. Which is done. Very poorly.
    Heck, I've even been told that J2EE's 3-tier architecture is not client server. Such ignorance is really unbelievable. Or is it pure stupidity?Until you just made me look it up, I would have thought that too, I'm sure I saw client/server defined as two-tier in the last century. But I have much more stupid misdefinitions to deal with on a daily basis, simply from the multiplicity of paradigms. I tend to retreat into my shell. Hehehe. Know that feeling... These days I rather run away, or set shields to full power, than try to get in yet another frustrating, fruitless and futile discussion with a Java head about the wonders of the J2EE architecture. Or trying to explain that this "new" architecture is predated with what we used in the 80's on mainframe systems with transaction monitors, block devices (the 80's web browsers) and databases - which software layer for software layer was almost identical to "+The Great Architecture+" of today. (and we did it without buzzwords too) ;-)
    Client-server is a software architecture and in essence describes 3 basic software components. The User Interface (UI), the Application (APP) and the Database (DB). And there are various ways to put these components together in a client-server architecture. The mistake that the Java fanbois make is thinking that client-server means having the client as the UI and APP as a single component (so-called fat client) and then the DB component as the server.
    There are numerous versions of these - including the APP component being a server component (as we now these days more commonly used in over the web).
    My beef with the J2EE "+religion+" always has been that client-server is client-server. The fundamentals stay the same.

  • Need Assistance for VBA function in oracle how to implement

    My very respected and Senior, regards,
    Sir, hope you will in best of health and wealth by the grace of God,
    Sir, i have a request problem as i m very junior against you and you have passed this time before many years ago as i m standing where. Sir i m a very junior developer of oracle and have a problem putting on your desk with the hope that you can help my as a boss.
    Sir me have to calculate yield of Bond using oracle form
    i have tried my best and tired
    there is a formulae in excel which give the Yield() when we provide the parameters
    and i need the excel formulae or the oracle calculation code of PLSQL for this.
    How can i get yield when i have price, coupon rate, frequency, issue and maturity of the coupon , coupon period , next coming coupon , and others detail.
    or tell me how to use EXCEL VBA for this problem ,
    thnx n regards,
    yours student, junior developer youngest brother
    Faraz
    How can I get the solution using Excel VBA function with oracle
    so that move values to excel calculate them and copy the result from excel to oracle forms

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Are there different php functions for Oracle 8 and 9?

    Hi!
    Are there different php functions for Oracle 8 and 9?
    Thanks for your answer!

    You can use the oci8* functions for Oracle 8, 9 and 10.
    It is the most recent PHP interface to Oracle, and uses Oracle's most recent
    API.
    The name oci8 comes from the version number of Oracle - version 8 - when
    Oracle introduced a new C API. It succeeded the original OCI and got the
    common name OCI8. The original OCI now has the common name of OCI7.
    -- CJ

  • Generate HTML format report using  DBMS_SQLTUNE.REPORT_TUNING_TASK function

    How could i generate HTML format report using DBMS_SQLTUNE.REPORT_TUNING_TASK function in oracle 11g

    See [url http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_sqltun.htm#CHDGEIHJ]documentation for DBMS_SQLTUNE.
    The TYPE parameter suggests that it would determine the format and whilst the nline documentation in the code (desc DBMS_SQLTUNE) suggests that valid values are TEXT, HTML and XML, it seems that this is not yet implemented. Whilst valid values of TEXT, HTML and XML are validated, only a TEXT report is produced.

  • Using FILTER function in oracle answers

    Gurus,
    I have a question related to using Filter function in oracle answers.
    When trying to insert a Filter (expr) Using (expr) clause in the formula area of a fact table field, It errored out with msg saying about using a wrong measure.
    I know this can be done with a case expression but I tried filter clause since this is available in oracle answers.
    Please help me figuring out this scenario.
    Thanks.

    David / Raghu - Thanks for u'r replies and apologizes for not posting question with proper material.
    Am posting my code and the error message from the screen.
    Code :
    IFNULL(FILTER("Fact - MBS Loan Transactions"."OUTSTANDING PRINCIPAL" USING "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK" = 'HDC'),0)
    Error :
    nQSError: 10058] A general error has occurred. [nQSError: 22032] Function FILTER requires at least one measure attribute in its first argument. (HY000)
    SQL Issued: SELECT "Dim - MBS Loan"."LOAN AMOUNT", "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK", "Dim - MBS Loan"."LOAN TYPE SEN/SUB", "Dim - MBS Project"."PROJECT NAME", "Dim - MBS Project"."PROJECT NUMBER", "Fact - MBS Loan Transactions"."AR BALANCE INTEREST", "Fact - MBS Loan Transactions"."GL BALANCE INTEREST", IFNULL(FILTER("Fact - MBS Loan Transactions"."OUTSTANDING PRINCIPAL" USING "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK" = 'HDC'),0) FROM "Financials - MBS"
    OK (Ignore Error)
    Please continue answering my queries. Since am a newbie your answers won't be just a reply but it's actually learning for me.
    Thanks.

  • Bulk Replacements using Replace function in oracle 8i

    Hi All,
    Iam using oracle 8i version and i need to use Replace function for bulf replacements i mean i need to replace around 250 rows. So please anyone suggest me how to proceed
    on this request as iam using oracle 8i version.
    Thanks!
    Srini

    Write one update statement.
    The where condition is the filter what rows need to be touched.
    The SET condition will do the data change. For example it could use the REPLACE function if that is what it is needed.
    One single update statement over 20 rows would mean the task is done in BULK. 20 single updates that each handle one row would mean it is row by row = slow by slow processing.

  • Using PI - Calling a Function in Oracle

    Hi,
    I understand that the receiver JDBC adapter is capable of calling a stored procedure or a function in Oracle.  I would like to call an Oracle function using the Receiver JDBC Adapter.  How should my structure look like.
    Thanks.
    Krishnan

    Hi,
    I have created a structure like:-
    <STATEMENT>
    <FUNCTION action="EXECUTE">
    <FunctionName>myFunction</FunctionName>
    <SerialNo type="NUMERIC">1000001</record_count>
    <SerialDate hasQuot="NO" type="STRING">TO_DATE(&apos;07-10-2008 04:59:43&apos;,&apos;MM-DD-YYYY HH24:MI:SS&apos;)</SerialDate>
    </FUNCTION>
    </STATEMENT>
    I am getting the following error in the JDBC receiver adapter:-
    com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'myFunction' (structure 'STATEMENT'): java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00221: 'myFunction' is not a procedure or is undefined ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    Thanks.
    Krishnan

  • ODSI service using function from oracle database

    Hi ,
    I need to create a ODSI service using function from oracle database.
    I am not sure how to create a Physical Layer and Logical Layer using the function fron db.
    Kindly provide a sample . I need It ASAP. Thanks in advance.
    Regards,
    Tara

    Here's what you do.
    Create New Physical Data Service -> Relational -> MyDataSource -> Table -> SomeTable ... finish the wizard.
    So now you have a Physical Data Service that represents a database table.
    Create New Physcial Data Service -> Relational -> MyDataSource (the same one as above) -> Database Function -> Enter UPPER for the Function name, enter MyUpper fro the XQuery Function. Finish the Wizard (use something like MyUpperDs for the ds name).
    Open MyUpperDs. Right-click -> Edit Signature on MyUpper. Change the ReturnType to string, change the Occurrence to Zero or One.
    Add a parameter, change the Type to string, change the Occurrence to Zero or One.
    Save.
    Now, open the first ds you made SomeTable.ds (whatever). Run it in the test view.
    Go to the Overview tab. Create New Operation. Give it the name SOMETABLE_UPPER. Save it.
    Go to the Query Map tab, open SOMETABLE_UPPER. Drag and drop SOMETABLE (the system-generated function into the mapper. It will show a dotted line from SOMETABLE to the Return. Now drag-and-drop the SOMETABLE to the top-level element of the return type, it will show solid lines from each element in SOMETABLE to each element in the return type.
    Now, drag-and-drop MyUpperDs.MyUpper into the Query Mapper. Edit the source, find where it added the line "for $x in myd:MyUpper()" and delete that line.
    Change a line that simply returns a value to use your function, for example, change
    <FIRST_NAME>{fn:data($CUSTOMER/FIRST_NAME)}</FIRST_NAME>
    to
    <FIRST_NAME>{myd:MyUpper(fn:data($CUSTOMER/FIRST_NAME))}</FIRST_NAME>
    Click on the Plan tab and Show Query Plan. You will see that in the query plan, it is using the database UPPER function where you specified MyUpper.
    Go to the Test View and run it.
    I used the RTLCUSTOMER table in cgDataSource
    xquery version "1.0" encoding "UTF-8";
    (::pragma xds <x:xds xmlns:x="urn:annotations.ld.bea.com" targetType="t:CUSTOMER" xmlns:t="ld:physical/CUSTOMER">
    <creationDate>2010-10-14T13:09:54</creationDate>
    <relationalDB name="cgDataSource" providerId="Pointbase"/>
    <field xpath="CUSTOMER_ID" type="xs:string">
    <extension nativeXpath="CUSTOMER_ID" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0" nativeKey="true"/>
    <properties nullable="false"/>
    </field>
    <field xpath="FIRST_NAME" type="xs:string">
    <extension nativeXpath="FIRST_NAME" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="64" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="LAST_NAME" type="xs:string">
    <extension nativeXpath="LAST_NAME" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="64" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="CUSTOMER_SINCE" type="xs:date">
    <extension nativeXpath="CUSTOMER_SINCE" nativeTypeCode="91" nativeType="DATE" nativeSize="10" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="EMAIL_ADDRESS" type="xs:string">
    <extension nativeXpath="EMAIL_ADDRESS" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="TELEPHONE_NUMBER" type="xs:string">
    <extension nativeXpath="TELEPHONE_NUMBER" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="SSN" type="xs:string">
    <extension nativeXpath="SSN" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="16" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="BIRTH_DAY" type="xs:date">
    <extension nativeXpath="BIRTH_DAY" nativeTypeCode="91" nativeType="DATE" nativeSize="10" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="DEFAULT_SHIP_METHOD" type="xs:string">
    <extension nativeXpath="DEFAULT_SHIP_METHOD" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="16" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="EMAIL_NOTIFICATION" type="xs:short">
    <extension nativeXpath="EMAIL_NOTIFICATION" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="NEWS_LETTTER" type="xs:short">
    <extension nativeXpath="NEWS_LETTTER" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="ONLINE_STATEMENT" type="xs:short">
    <extension nativeXpath="ONLINE_STATEMENT" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="LOGIN_ID" type="xs:string">
    <extension nativeXpath="LOGIN_ID" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="50" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <key name="CUSTOMER_0_SYSTEMNAMEDCONSTRAINT__PRIMARYKEY" type="cus:CUSTOMER_KEY" inferredSchema="true" xmlns:cus="ld:physical/CUSTOMER"/>
    </x:xds>::)
    declare namespace myd= "ld:physical/MyDs";
    declare namespace f1 = "ld:physical/CUSTOMER";
    import schema namespace t1 = "ld:physical/CUSTOMER" at "ld:physical/schemas/CUSTOMER.xsd";
    import schema "ld:physical/CUSTOMER" at "ld:physical/schemas/CUSTOMER_KEY.xsd";
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="read" isPrimary="false" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare function f1:CUSTOMER() as schema-element(t1:CUSTOMER)* external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="create" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:createCUSTOMER($p as element(t1:CUSTOMER)*)as schema-element(t1:CUSTOMER_KEY)* external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="update" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:updateCUSTOMER($p as changed-element(t1:CUSTOMER)*) as empty() external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="delete" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:deleteCUSTOMER($p as element(t1:CUSTOMER)*) as empty() external;
    (::pragma function <f:function kind="read" visibility="public" isPrimary="false" xmlns:f="urn:annotations.ld.bea.com"/>::)
    declare function f1:CUSTOMER_UPPER() as element(f1:CUSTOMER)*{
    for $CUSTOMER in f1:CUSTOMER()
    return
    <t1:CUSTOMER>
    <CUSTOMER_ID>{fn:data($CUSTOMER/CUSTOMER_ID)}</CUSTOMER_ID>
    <FIRST_NAME>{myd:MyUpper(fn:data($CUSTOMER/FIRST_NAME))}</FIRST_NAME>
    <LAST_NAME>{fn:data($CUSTOMER/LAST_NAME)}</LAST_NAME>
    <CUSTOMER_SINCE>{fn:data($CUSTOMER/CUSTOMER_SINCE)}</CUSTOMER_SINCE>
    <EMAIL_ADDRESS>{fn:data($CUSTOMER/EMAIL_ADDRESS)}</EMAIL_ADDRESS>
    <TELEPHONE_NUMBER>{fn:data($CUSTOMER/TELEPHONE_NUMBER)}</TELEPHONE_NUMBER>
    <SSN?>{fn:data($CUSTOMER/SSN)}</SSN>
    <BIRTH_DAY?>{fn:data($CUSTOMER/BIRTH_DAY)}</BIRTH_DAY>
    <DEFAULT_SHIP_METHOD?>{fn:data($CUSTOMER/DEFAULT_SHIP_METHOD)}</DEFAULT_SHIP_METHOD>
    <EMAIL_NOTIFICATION?>{fn:data($CUSTOMER/EMAIL_NOTIFICATION)}</EMAIL_NOTIFICATION>
    <NEWS_LETTTER?>{fn:data($CUSTOMER/NEWS_LETTTER)}</NEWS_LETTTER>
    <ONLINE_STATEMENT?>{fn:data($CUSTOMER/ONLINE_STATEMENT)}</ONLINE_STATEMENT>
    <LOGIN_ID?>{fn:data($CUSTOMER/LOGIN_ID)}</LOGIN_ID>
    </t1:CUSTOMER>
    xquery version "1.0" encoding "UTF-8";
    (::pragma xfl <x:xfl xmlns:x="urn:annotations.ld.bea.com">
    <creationDate>2010-10-14T13:10:45</creationDate>
    <customNativeFunctions>
    <relational>
    <dataSource>cgDataSource</dataSource>
    </relational>
    </customNativeFunctions>
    </x:xfl>::)
    declare namespace f1 = "ld:physical/MyDs";
    (::pragma function <f:function visibility="protected" kind="library" isPrimary="false" nativeName="UPPER" xmlns:f="urn:annotations.ld.bea.com">
    <nonCacheable/>
    </f:function>::)
    declare function f1:MyUpper($arg0 as xs:string?) as xs:string? external;
    <cus:CUSTOMER xmlns:cus="ld:physical/CUSTOMER">
    <CUSTOMER_ID>CUSTOMER1</CUSTOMER_ID>
    <FIRST_NAME>JACK</FIRST_NAME>
    <LAST_NAME>Black</LAST_NAME>
    <CUSTOMER_SINCE>2001-10-01</CUSTOMER_SINCE>
    <EMAIL_ADDRESS>[email protected]</EMAIL_ADDRESS>
    <TELEPHONE_NUMBER>2145134119</TELEPHONE_NUMBER>
    <SSN>295-13-4119</SSN>
    <BIRTH_DAY>1970-01-01</BIRTH_DAY>
    <DEFAULT_SHIP_METHOD>AIR</DEFAULT_SHIP_METHOD>
    <EMAIL_NOTIFICATION>1</EMAIL_NOTIFICATION>
    <NEWS_LETTTER>0</NEWS_LETTTER>
    <ONLINE_STATEMENT>1</ONLINE_STATEMENT>
    </cus:CUSTOMER>
    .

  • How to use "Rank" function  in Oracle?

    I need to display Top 15 records by using rank function.
    Here is my query...I need to pull top 15 FAQ's using the below query.. How can I use RANK function to display the Top 15 FAQ"s in the list.
    Select  distinct SUb1.FAQ,Sub1.FAQ_Hits,GU.display_Name_FMLS as displayname,ev.ParentLinkrecordid,ev.userid from User GU
    Join Event ev
    ON LOWER (ev.userid) IN (LOWER (GU.lanid), LOWER (Gu.racfid))
    Join (Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID from Event ev
    Join SubjectMatter sm
    ON (TO_CHAR (sm.smrecordid) = ev.eventdetail1) AND ev.eventdetail1 IS NOT NULL AND sm.smtype = 1
    Where (Upper(ev.eventsubtype) in (Upper('FAQ'),Upper('OPENFAQ')))
    AND TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= TO_DATE ('20100601', 'yyyymmdd')
    and TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= TO_DATE ('20100831', 'yyyymmdd')
    Group by sm.stem,ev.Parentlinkrecordid
    order by FAQ )sub1
    ON Sub1.Topic_ID = ev.ParentLinkrecordid)

    A few bits that I noticed in the query ...
    in (Upper('FAQ'),Upper('OPENFAQ'))1) Do you really a upper for a string which is already in upper case.
    Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID2) Do you need a distinct when you are using a GROUP function viz. SUM ?
    You rank query is as follows, I am not very good at the ANSI style JOIN so changed it slightly ... :-)
    Also notice the usage rank function in the "sub1" query.
    select distinct sub1.faq,
                    sub1.faq_hits,
                    gu.display_name_fmls as displayname,
                    ev.parentlinkrecordid,
                    ev.userid
    from user gu, event ev,
      (select rank() over (order by sum(ev.eventresults) desc) rnk,
              sum(ev.eventresults) as faq_hits,
              sm.stem as faq,         
              ev.parentlinkrecordid as topic_id
         from event ev, subjectmatter sm
        where (to_char(sm.smrecordid) = ev.eventdetail1)
          and ev.eventdetail1 is not null
          and sm.smtype = 1
          AND upper(ev.eventsubtype) in ('FAQ', 'OPENFAQ')
          and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= to_date('20100601', 'yyyymmdd')
          and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= to_date('20100831', 'yyyymmdd')
        group by sm.stem, ev.parentlinkrecordid
        order by faq) sub1
    where lower(ev.userid) in (lower(gu.lanid), lower(gu.racfid))
      and sub1.topic_id = ev.parentlinkrecordid)
      and sub1.rnk <= 15;Like mentioned above, some sample data would have helped.

  • How to use decode function in oracle apex 3.2.1

    Hello Friends,
    how to use decode
    var_decode := 'decode'||'('|| var1 ||','|| -800000000000000||','||'.A'||','||
    appreciate your help.
    regards/kumar
    Edited by: kumar73 on Apr 23, 2010 12:25 PM
    Edited by: kumar73 on Apr 23, 2010 12:27 PM

    Hey just on this particular point, there's a handy PL/SQL method for escaping quotation characters which may reduce the complexity of the string.
    For example, if I had a string:
    I can't understand why quoting my 'quote' characters never seems to "work"!and I wanted to pass that into a variable, I could do this:
    vc_foo:= 'I can''t understand why my ''quote'' characters never seems to "work"!';or I could use the q function, whereby you enclose your string within a quote delimiter of your choice, like so:
    vc_foo:= q'^I can't understand why quoting my 'quote' characters never seems to "work"!^';
    note: I used the caret (^) character by convention but any valid character will do
    ...all of which leaves your original string more or less unadulterated.
    I find this particularly useful for generating dynamic SQL and dynamic PL/SQL, as it leave the query looking a tad more readable, although if you are chaining together multiple strings with double-pipes, it can make it a little muddier. I find it particularly useful if I'm going to deal with string data from, for example, a field with Irish-derived surnames such as "O'Reilly"...
    Give it a go!

  • DECODE Function in Oracle Froms 6.0

    I have discovered that in Oracle Forms 6.0 (Version 6.0.5.34.0) the DECODE Function performs an implicit TO_CHAR conversion that the DECODE Function in the Oracle 8 database does not.
    I discovered this when working with dates on the form. Dates prior to 2000 were not formatting correctly and all dates were not sorting correctly. By adding TO_DATE with the correct format mask outside of the DECODE statement the correct results were returned.
    When trouble shooting this through SQL Navigator connected directly to the database, the correct results were returned without having to use the TO_DATE function.

    Why don't you have any join conditions specified for your two inline views cr and de?
    If you want help with a query you should post DDL and inserts statements to create enough test data for someone to produce the set of results that you are looking for.
    HTH -- Mark D Powell --

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

  • How to use a stored procedure in oracle reports

    How to use a stored procedure in oracle reports

    Dear,
    In report triggers you can write your procedure/functions or call it like
    function AfterPForm return boolean is
    begin
    myprocedure(:mydate);
    return (TRUE);
    end;
    Thanks
    Jamil

Maybe you are looking for