Error using Extended SQL Function substr

I want to be able to look for the first three letters of a month in the XML and if found replace the 3 letter month (for example SEP-05 to September 05). I have tried the following which throw a namespace exception. Please let me know what I may be doing wrong?
1. <?if:(xdofx:substr(../fsg:ColContext[2]/fsg:ColHeadLine2,1,3)='SEP'?>September<?end if?> should give me September.
The above fails with: Font Dir: E:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
Run XDO Start
RTFProcessor setLocale: en-us
FOProcessor setData: E:\Work\Bacardi\Reports\XML\US GAAP BALSHEET\XML BL Dir Rpt BS YTD_0126.xml
FOProcessor setLocale: en-us
java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at oracle.apps.xdo.common.xml.XSLT10gR1.invokeNewXSLStylesheet(XSLT10gR1.java:514)
     at oracle.apps.xdo.common.xml.XSLT10gR1.transform(XSLT10gR1.java:192)
     at oracle.apps.xdo.common.xml.XSLTWrapper.transform(XSLTWrapper.java:156)
     at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:916)
     at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:869)
     at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(FOUtility.java:204)
     at oracle.apps.xdo.template.FOProcessor.createFO(FOProcessor.java:1535)
     at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:925)
     at RTF2PDF.runRTFto(RTF2PDF.java:590)
     at RTF2PDF.runXDO(RTF2PDF.java:443)
     at RTF2PDF.main(RTF2PDF.java:237)
Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.
     at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:782)
     at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:564)
     ... 15 more
2. For the year, I would use another form field and do something like this next to the month above: <?xdofx:substr(../fsg:ColContext[2]/fsg:ColHeadLine2,5,2)?> for a result of '05'

Hasan
XSL has many native string manipulation functions so you do not need to use our SQL functions when a native XSL one will do:
<?if:substring(normalize-space(../fsg:ColContext[2]/fsg:ColHeadLine2),1,3)='SEP'?>September<?end if?>
See that dang normalize space function again ... had to use it on my FSG sample.
Would it not be easier to either:
1. Have the FSG generate the September YYYY format or
2. Have FSG generate XSD date formats, 'YYYY-MM-DD', then you can just specify the date format in the form fields
Regards, Tim

Similar Messages

  • Error Using LISTAGG SQL Function

    Hello,
    I'm trying to use the new LISTAGG SQL function with the following expression in a report:
    select listagg(email, ';') within group (order by email) as email_list from sba_registration_entries where team=241
    and I get the following SQL error in Apex SQL Workshop:
    ORA-00923: FROM keyword not found where expected
    Is this function enabled on the apex.oracle.com site? Am I using the correct syntax?

    Hi,
    The current database on apex.oracle.com is "Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production"
    The LISTAGG function seems to be from version 11.2: [http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions087.htm] ?
    Andy

  • Using pl/sql functions for transformation

    How can I use pl/sql functions in the transformation mapping field for my interface?
    I have a name field where firstname and lastname are concatenated via a space-character and I would like to extract this 'name' field to 2 separate database attributes.
    This means that I need to use a function that uses SUBSTRING and INSTR to be able to get the firstname and lastname separatly out of the name-field.
    The INSTR-function isn't known inside the expression editor in ODI so I'm wondering how I can use my own function?

    Hi Romanna,
    Are you sure? Where did you do your transformation?
    -Source, Staging area or Target
    I try this on Oracle target...
    FIRST_NAME = substr(MYTABLE.FIRST_LASTNAME, 1, instr(MYTABLE.FIRST_LASTNAME, ' ')-1)
    LAST_NAME = substr(MYTABLE.FIRST_LASTNAME,instr(MYTABLE.FIRST_LASTNAME, ' ')+1)

  • How to process validations using PL/SQL function

    Hi.
    I created a page with a form to process DML operations against a database table. Also created a validation using PL/SQL function that returns a boolean value:
    declare
    v_dummy varchar2(1)
    begin
    select 'X'
    into v_dummy
    from s_customer
    where id = :p2_id;
    return (TRUE);
    exception
    when no_data_found then
    return (FALSE);
    when others
    return (TRUE);
    end;
    In this case i want to send a message to the user indicating that an certain row (the one with :p2_id value) already exists in the database. The piece of code above will do the job. If this function returns true, it means the row is in the DB already.
    The problem is that i don´t know what do to or how to tell htmldb that a TRUE value should issue a message or be processed as en error, whilst a FALSE means OK.
    How do i tell htmldb what to do?
    Suppose must do something with "expression 1" , "expression 2", etc.
    Any ideas???

    Hóla LuÃs,
    when you pick the PL/SQL function body returning a boolean, it implicitly means that TRUE means OK, while FALSE means error, always.
    In order to associate such error to a given form field, you have to go back to the page definiton / validations and specify the name of the item in the corresponding field.
    When you first create the validation rule, this value is not present even if you ask for the error message inline with the field.
    The error message text can be specified in the validation definition, if I am not wrong.
    When you need to return special error messages, including dynamic content for instance, you can use the Function Returning Error Message type, which reports an error when the string returned by the function is not null. This comes in handy when you want to display an item's code, for example, rather than generic text.
    Even in this case, you must go back to the validation and specify the name of the field if you want to see it inline.
    Hope it helps,
    Flavio

  • How do i use PL/SQL function in filter operator

    Hi,
    i want to use one pl/sql function in filter operator. how do i use it in filter condition.
    error i am getting is
    " error occured during expression validatation.
    my filter condition is
    INOUTGRP1.LAST_UPDATE_DATE > "GET_LAST_UPDATE_DATE"()
    can any one suggest me what is the problem for this error.
    Regards,
    Jyothy

    I tried and getting the same error. don't know why!!
    However, There is another way of accomplishing it.
    You can add a "Mapping Input Parameter" to your mapping and in the default value field call the function "Get_Last_Update_date". Then add the output field from this operator to the filter operator. Then edit the filter condition to replace the function call with output value from the Input parameter operator.
    This should work...

  • Using HANA SQL Functions in select list of CDS Views

    Dear Expert,
    Kindly please let me know if we can use the HANA SQL Function (Ex: ADD_DAYS, SECONDS_BETWEEN) in the select list of CDS Views?
    If I create a CDS like below I get error that timestamp is not supported.
    For Example:
    @AbapCatalog.sqlViewName: 'ZMR_H_CA'
    @EndUserText.label: 'CAG A'
    define view viewname
    with parameters start_ts:abap.dec( 15, 0 ) , end_ts:abap.dec( 15, 0 )
    as select from table {
    key resource_key,
    TO_TIMESTAMP(begtstmp) as start_tmp,
    TO_TIMESTAMP(begtstmp) as end_tmp
    where
    (begtstmp > $parameters.start_ts or endtstmp > $parameters.start_ts )
    and
    (begtstmp < $parameters.end_ts or endtstmp < $parameters.end_ts )
    Thanks,
    Giri

    Hi Giri,
    the list of provided features can be found in the ABAP Language Documentation (F1 in the CDS View).
    As CDS in ABAP is abstracted from the database layer, the database features are not directly accessible. That means, you cannot use any HANA or MaxDB feature available. So the answer to your question is no. The reason for this is, that ABAP CDS views can be created on all SAP-supported databases, hence, we can only provide those features, supported by all databases.
    Having said this, there are some exception, e.g. the CDS views with input parameters, which are not supported by all databases. In these cases, you'd have to additionally use the utility class CL_ABAP_DBFEATURES (see http://scn.sap.com/community/abap/blog/2014/10/10/abap-news-for-740-sp08--abap-core-data-services-cds) for more details.
    Best,
      Jasmin

  • Error calling pl/sql function in target column

    Hi guys,
    I get this error when calling my function in ODI:
    Caused By: java.sql.SQLSyntaxErrorException: ORA-00904: "mySchema"."GET_ODI_DEFAULT_VALUE(1)": ongeldige ID --> 1 is an IN parameter
    while in sql developer I get a good result with following query:
    select mySchema.get_odi_default_value(1) from dual;
    In my target table for the primary key I call a sequence from mySchema and this works fine.
    I've tried the following synxtax in the mapping of my target column:
    - <%=odiRef.getObjectName( "L","GET_ODI_DEFAULT_VALUE(1)", "D" )%>
    - <%=odiRef.getObjectName( "L","GET_ODI_DEFAULT_VALUE", "D" )(1)%>
    Thanks for you advice

    iadgroe wrote:
    how to bring oracle function into ODI
    I thought for objects like sequences and functions you had to use 'odiRef.getObjectName' to get access to them.
    Am I wrong because now I'm a little confused???Hi,
    Best practices would be to use getobjectname method as this way your not hardcoding anything into the interface and you are referencing the logical object only, which means you can change the logical object later and not have to worry about changing the interfaces.

  • Parameter passing to custom SQL query using PL/SQL FUNCTION

    Hi
    In order to pass a parameter to the query in custom folder of a business area I created a function and mapped it to the Custome query using Discoverer Desktop. There is no error in mapping as the system does not throw any error. When I am inputting the Parameter for the input values everytime the query doesnot return any rows.
    Can anybody help in this regard

    Hi,
    I need to take the request Id as input from the user and then fetch only the data pertaining to that requet Id. As a lot of complex joins are involved I need to pass request id as parameter to the custome folder.
    The package i greated:
    CREATE OR REPLACE PACKAGE SETPARAM
    AS
    param1 varchar2(25);
    param2 varchar2(25);
    FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER ;
    FUNCTION GET_PARAM1 RETURN varchar2;
    END SETPARAM;
    CREATE OR REPLACE PACKAGE BODY SETPARAM AS
    FUNCTION SET_PARAM1(p1 IN varchar2) RETURN NUMBER IS
    BEGIN
    fnd_client_info.set_org_context('138');
    param1 := p1;
    dbms_output.put_line(param1);
    RETURN 1;
    END;
    FUNCTION GET_PARAM1 RETURN varchar2 AS
    BEGIN
    RETURN param1;
    END;
    END SETPARAM;
    I registered the set_param1 function as a pl/sql function in discoverer admin.
    This function is called on the condition associated with the parameter in Discoverer Desktop when i run the report.
    In the custom folder query i have this piece in the where clause
    WHERE tnfo.request_id = NVL(APPS.SETPARAM.GET_PARAM1,7383588)
    And everytime i get the data pertaining to request id =7383588,
    Please suggest where i went wrong
    thanks
    Ashwini

  • Using PL/SQL Function with CLOB types and a Java Source

    Hi people.
    I have some problems trying to use a function in pl/sql with a CLOB parameter to a java source function.
    Here is the problem: I have to read a TXT file and return a CLOB with the data of the file. The reading is done with a java source function.
    The problem is how to read the file without messing the content and return it to the pl/sql function?
    Another problem: If I pass a CLOB as a parameter to a pl/sql function and have to write the content to a file, how to do it without screwing the EOL chars and so?
    My code is:
    /******** PLSQL FUNCTIONS ********/
    function fn_gravaconteudoarquivo( pv_caminho in varchar2
    , pv_nomearquivo in varchar2
    , pc_conteudo in clob ) return varchar2 as language java
    name 'Importacao.gravaConteudoArquivo(java.lang.String, java.lang.String, oracle.sql.CLOB) return varchar2';
    function fn_lerconteudoarquivoclob( pv_caminho in varchar2
    , pv_nomearquivo in varchar2 ) return clob as language java
    name 'Importacao.lerArquivoClob(java.lang.String, java.lang.String) return clob';
    /******** JAVA SOURCE FUNCTIONS *********/
    public static String gravaConteudoArquivo(String caminho, String nomeArquivo, CLOB conteudo) {
    File file = new File(caminho, nomeArquivo);
    PrintWriter pwFile;
    String mensagem = "";
    StringBuffer sb = new StringBuffer();
    try {
    pwFile = new PrintWriter(new BufferedWriter(new FileWriter(file,true)));
    for (int i=0;i<=(conteudo.length()/32000);i++) {
    sb.append(conteudo.getSubString(conteudo.getLength()+1,32000));
    pwFile.println(sb.substring(0));
    pwFile.close();
    } catch (Exception ex) {
    mensagem = "Erro: "+ex;
    return mensagem;
    public static CLOB lerArquivoClob(String caminho, String nomeArquivo) throws SQLException {
    File file = new File(caminho, nomeArquivo);
    Connection conn;
    CLOB clob = null;
    String lineSep = System.getProperty("line.separator");
    StringBuffer sb = new StringBuffer();
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:csdesv", "csestoque", "liberada");
    clob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
    BufferedReader brFile = new BufferedReader(new FileReader(file.getPath()));
    while (brFile.ready()) {
    sb.append(brFile.readLine());
    sb.append(lineSep);
    clob.open(CLOB.MODE_READWRITE);
    clob.setString(clob.getLength()+1, sb.toString());
    clob.close();
    } catch (Exception ex) {
    ex.printStackTrace();
    return clob;
    Ah, just remembered... This will work as a JOB.... >.< ... So the connection aparently is at localhost.
    Thanks.

    No one? I really need this....

  • Error using SYS.XMLAGG function

    Error occurs while using SYS.XMLAGG function.What could be the cause ?
    I tried the below given SQL statement, it throws ORA-29913
    error.
    SELECT SYS_XMLAGG(SYS_XMLGEN(e.a)).getClobval() e FROM try_xmltype e
    ERROR:
    ORA-29913: error in executing ODCIAGGREGATEINITIALIZE callout

    What is the database version? You can post this in XMLDB forum for further support.

  • Schedule a Workbook using PL/SQL Function.

    Hi,
    Trying to schedule a workbook which uses a PL/SQL function(the function inserts some values to a custom table).
    Workbook when run in desktop works fine and am able to see the results. but when run as a scheduled workbook it results with an error: Single query returns multiple rows.
    Any Ideas to get around this problem...
    Thanks!
    Nani.

    There could be a multitude of problems. Somewhere, the PL/SQL is selecting data using a SELECT ... INTO ... FROM type construct. Problem is that multiple records are being returned, and the code wants a cursor or some other mechanism.
    Look at the places where the PL/SQL is selecting data, and make sure that only 1 row is being returned. The PL/SQL code may need to be modified to purge data before or after to ensure subsequent runs will not be a problem. There could also be a commit statement out of place that isn't committing a deletion, or is preventing a rollback.
    With the way the workbook is scheduled, the PL/SQL could get called multiple times, but this seems unlikely as it works fine in desktop.

  • How to use Pl/Sql function in Discoverer report

    Hi Everybody,
    Would you be able to provide a workflow/guidance how to use sql function in Discoverer right from creating the function using PLSQL Developer.
    (I am new to Oracle environment... prev. worked as analyst with Microsoft Access... took PL/Sql class in school a few years ago)
    We are using Discoverer Desktop.
    a) Just emailed dba for permission to create pl/sql function.
    b) Recently got Discoverer Administrator installed on my pc.
    can you pls add to the list:
    c)....
    d)....
    etc.?
    tx for your help, sandra

    Hi Kranthi,
    Thx for your warm words....
    The links you provided are great! Thx soooo much!
    Thanks to you and the rest of forum members, am able to use what you've all taught me
    with other Discoverer reports.... so i was able to do more on my own....
    About a month ago, I got access to Discoverer Admin, and was able to paste SQL to create a custom folder.
    Then i joined the custom folder to an existing baseline folder.
    I have found that sometimes when I use calc within a calc when the calcs use analytic functions, that Discoverer
    just displays null in the column. I thought that maybe instead I could create my own function as a work-around.
    I wrote IT for permissions to create views, functions etc. Hopefully, they'll approve and can move toward learning
    pl/sql functions for Discoverer.
    tx again, sandra

  • Error using custom xpath function with XSL transformations in BPM

    Hi,
    We have created a custom xpath function for use with SOA Suite and BPM. This has been built as per specified within the http://docs.oracle.com/cd/E29597_01/dev.1111/e10224/bp_appx_functs.htm#SOASE11100. We have also reviewed the Oracle Sample for mapper-107-ExtensionFunctions (sample demonstrates the use of user-defined extension functions). This has been registered with jDeveloper and SOA within the oracle.soa.ext_11.1.1 (run ant to include in oracle.soa.ext.jar)
    We ideally want to use this is BPM within an xsl. However when consuming this function is either BPEL or BPM using an xsl, the xsl fails with an error such as:
    XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/gwCustomXpathUtil_rev1.0/xsl/Transformation_1.xsl<Line 9, Column 113>: XML-22043: (Error) Extension function error: Method not found 'getWeekDayDate'. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
    In an Assign it operates fine and returns the expected result. We have included a combination of both of the Config files (ext-mapper-xpath-functions-config.xml and ext-soa-xpath-functions-config.xml) in the META-INF folder, however neither allow the use of this function in the XSL.
    I believe there may be an issue getting the custom xpath functions within XSL files. Hence I have also raised an SR. Has anyone experiences of this?
    Our SOA / BPM suite environment is using 11.1.1.6.4 and has the following patches applied:
    13801175
    14406487 (11.1.1.6.4 SOA Bundle)
    13896993
    13088538
    Regards Dave
    Edited by: DavidGaskell on Mar 14, 2013 10:08 PM

    Hi All,
    I am also facing the same issue...Experts can you please help us.
    hi DavidGaskell, did you find any resolution, if so can you share it with me.....
    Thanks,
    RR

  • How to use PL/SQL Function after registering

    Hi,
    I have successfully registered a PL/SQL Function within Discw Admin. But i don't know how to use it further??? Please let me know the steps to use it in folders (admin) or in plus.
    Actually i have a stored procedure which fetches the records from the base tables and i have to develop a report based on that data.
    Please reply ASAP.
    Thanks,
    Jay

    Hi Jay,
    If this function is a stored procedure in the right schema, you can access this function in your custom SQL like any other database functions (e.g. SUM, AVG, MAX, etc).
    If you are not using a custom folder (ie. your own SQL), you can access this function in the workbook (Tools --> Calculations --> New Button --> Select Function Radio Button --> All Functions or Database Folders.). This calculation wil become a new column in the workbook.
    Regards,
    John

  • Error while creating sql function

    I am getting the following error when i execute the below query for creatin sql function. Please let me know waht is the problem
    Major Error 0x80040E14, Minor Error 25501
    > create FUNCTION fantastic ( @deal_id , @as_of_date)
    returns @funtab table
    (issue_id int not null,
    par_amount money not null)
    as
    begin
    insert @funtab
    select a.issue_id,a.par_amount 
    from asserts as a, issue as i, issuer_rating_history h, deal d
    where h.as_of_date = @as_of_date and
     d.deal_id = @deal_id and 
    d.deal_id = a.deal_id
    a.issue_id=i.issue_id 
    return
    end
    There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = FUNCTION ]
    create FUNCTION fantastic ( @deal_id , @as_of_date)
    returns @funtab table
    (issue_id int not null,
    par_amount money not null)
    as
    begin
    insert @funtab
    select a.issue_id,a.par_amount 
    from asserts as a, issue as i, issuer_rating_history h, deal d
    where h.as_of_date = @as_of_date and
     d.deal_id = @deal_id and 
    d.deal_id = a.deal_id
    a.issue_id=i.issue_id 
    return
    end

    Hello,
    See MSDN
    Differences Between SQL Server Compact and SQL Server => "User-defined functions and full text:
    Not supported" in SQL CE, so you can not create a function as in SQL Server.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • How to insert text in existing file.?????

    how to insert text in existing file.????? my file contains simple text with numbers of lines having more then 10 MB size and it might be increase up to 100MB. i required to seek to spec. position and insert chunk of characters to file without overwri

  • Does not copy correctly

    Printer prints fine off PC...but when I copy, it prints black lines down the page

  • How to set the deployment folder for the server

    Hello All, I'm a new bee to this SJWS. I'm using SJWS 7.U4. When i build my web application, it is creating the war file in some location; lets say xxx. I dont want to deploy every time (manually update the war file and then click on deployment pendi

  • Printer will only print 280 X 202 and not full A4

    When I print or copy from my Deskjet 3050A J611 series, it will on print or copy 280 x 202, not the full A4 (297 x 210). The scanner however does scan the full A4. Printing problem is happening with both Word and Photoshop programmes. Any ideas?

  • Speaker turns off everytime I answer phone

    I have a bluetooth earpiece with A2DP capability (Jabra BT8040). I like to have the sound set to speaker as a default (otherwise you can't hear the phone ring or get notifications) but whenever I use the bluetooth earpiece it automatically sets ALL s