Is it possible to define a function in the MathScript Node

Is it possible to define a function in the MathScript Node

You can not define a function inside of a MathScript Node, but only because it isn't necessary. The way custom functions work in MathScript is that they are saved in .m files located in paths in the MathScript path list. When the MathScript compiler receives a function that it doesn't recognize, then it searches for it in the path list, and upon finding it, compiles and loads the function. You can specify these search paths manually by going to File>>MathScript Preferences from the MathScript Window or dynamically by using the path() command within a script.
To answer your original question, if you would like to create custom functions dynamically within a VI, then you can simply build your custom functions using strings and then save them to an ASCII file with the extension .m. You could either save the file to a path already in the MathScript path list or you could dynamically specify the path by passing the path into a MathScript Node as a string and by using the path() command at the beginning of your script to set it.
Kind Regards,
E. Sulzer
Applications Engineer
National Instruments

Similar Messages

  • Is It Possible To define a size of the Procedure Parametere?

    In Oracle Is It Possible To define a size of the Procedure Parametere?
    If i have the procedure like
    Test_sp(no int,name varchar2)
    Is it possible to define a size
    Test_sp(no int(5),name varchar2(255))
    Thanks
    Rangan S

    As Anthony said - no, not in the parameter signature of a procedure or a function. Which could have unexpected run-time errors as one could wrongly assume that using a "derived" type will allow this.
    The following example illustrates:
    SQL> create table datatype(
    2 varchar2_5 varchar2(5),
    3 number1 number(1)
    4 );
    Table created.
    SQL>
    SQL>
    SQL> create or replace procedure fooProc( s datatype.varchar2_5%TYPE, n datatype.number1%TYPE ) is
    2 s1 datatype.varchar2_5%TYPE;
    3 n1 datatype.number1%TYPE;
    4 begin
    5 begin
    6 DBMS_OUTPUT.put_line( 'len='||length(s)||' value='||s );
    7 DBMS_OUTPUT.put_line( 'value='||to_char(n) );
    8 exception when OTHERS then
    9 DBMS_OUTPUT.put_line( 'parameter display failed with error '||SQLERRM(SQLCODE) );
    10 end;
    11
    12 begin
    13 s1 := s;
    14 DBMS_OUTPUT.put_line( 'string parameter assignment succeeded' );
    15 exception when OTHERS then
    16 DBMS_OUTPUT.put_line( 'string assignment failed with error '||SQLERRM(SQLCODE) );
    17 end;
    18
    19 begin
    20 n1 := n;
    21 DBMS_OUTPUT.put_line( 'number parameter assignment succeeded' );
    22 exception when OTHERS then
    23 DBMS_OUTPUT.put_line( 'number assighment failed with error '||SQLERRM(SQLCODE) );
    24 end;
    25 end;
    26 /
    Procedure created.
    SQL>
    SQL> exec fooProc( 'test1', 1 );
    len=5 value=test1
    value=1
    string parameter assignment succeeded
    number parameter assignment succeeded
    PL/SQL procedure successfully completed.
    SQL>
    SQL> exec fooProc( 'this should fail', 1 );
    len=16 value=this should fail
    value=1
    string assignment failed with error ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    number parameter assignment succeeded
    PL/SQL procedure successfully completed.
    SQL>
    SQL> exec fooProc( 'test', 1234 );
    len=4 value=test
    value=1234
    string parameter assignment succeeded
    number parameter assignment succeeded
    PL/SQL procedure successfully completed.
    SQL>
    Note that only the string assignment fails. The string parameter works fine. And there is no impact at all on the number side, despite seemingly constraining it to a single digit.

  • Report Builder: can i define a function in  the rdf file ?

    Hi All,
    About the report builder, can i define a function in the rdf file ? and then i want invoke it in the report SQL, just like :
    function Get_Ap_Prepay_Balance(p_Invoice_Id IN NUMBER, p_End_Date IN DATE) RETURN NUMBER IS
    l_Amount number;
    begin
    RETURN l_Amount;
    end;
    thanks.

    You can create functions in reports, but slightly different from doing it in PL/SQL
    function Get_Ap_Prepay_Balance return number is
    l_Amount number;
    begin
    assuming that you have invoice_id in your select statement and p_End_Date is a report parameter, you can refer to them in your function as :p_End_Date and :invoice_id
    for example select prepay_amount_remaining into l_Amount from ap_invoice_distributions where invoice_id = :invoice_id and accounting_date = :p_End_Date
    return(l_Amount);
    hope this helps

  • How to implement a user-defined function in a mathscript node

    I am trying to use a mathscript node that includes self-defined functions, but I always get an error. I tried to run an NI-example: MathScript using Riemann Zeta.vi ,and I got the same error I get when I run my own programmes:MathScript Node'MathScript Node' (zeta): User-defined function contains an error. I didn't change anything in that example, so what could be wrong?

    Try the Mathscript forum instead. Good luck.
    (Maybe start reading this, for example)
    Message Edited by altenbach on 11-18-2009 01:48 PM
    LabVIEW Champion . Do more with less code and in less time .

  • Getting -90031 (can't find function) error from Mathscript node when running executable, but works when I run the pre-compiled VI

    I have set the Mathscript preferences 'Path' and 'Working Directory' parameters to the folder containing my scripts, and it works when
    I run the VI, but I get a -90031 error when I run the executable.
    What am I doing wrong?

    Hi Umars,
    I had the same problem. In my case it turned out that it was caused the surrounding code. Plus the error
    message was missleading. I got the error message -90031 (unknown symbol CalcWelchCorr2) for the
    following piece of code:
    ecorr= 1;
    if setup & src== 1
       for lag= 1:50
       rho=  CalcWelchCorr2( lag, win );
       if rho > 0.001, ecorr= [ecorr; rho]; else, break; end
    end
    CalcWelchCorr2 is a user defined function located in the MS search path. The problem was caused by the
    "break" in line 5. Actually this line was marked by some little warning symbol. Eventualle I modified the code
    to get rid of the break
    ecorr= 1;
    if setup & src== 1
       lag= 1; rho=  CalcWelchCorr2( lag, win );
       while rho > 0.001 && lag <= 50
          ecorr= [ecorr; rho];
          lag= lag+ 1; rho= CalcWelchCorr2( lag, win );
       end
    end
    and voila, the executable worked fine.
    However, I had to check all my VIs ( > 200 !) for similar errors which gave me headaches.
    Why does the application builder doesn't produce some appropriate error message ?
    E.g. "Line xxx in MathScript node in VI xxx cannot be executed"? Currently you get the
    impression that the application was build successfully but eventually you get strange errors
    or even erroneous results. Keep in mind that tracking down bugs in the final application is
    much more difficult that in LV. Also the error message produced by the executable was not
    helpfull at all.

  • Is it possible to call a function with the same name from 2 different dll's at the same time.

    I'm trying to call a function ( F ) form 2 different libraries ( A.dll and B.dll ) at the same time. The first lib loaded determines the function F. A->F and B->F have same interface and name but different implementation.

    Hi,
    I tried it with two dll's, both with the same interface, and at the same
    time, in the same VI. The popups even appear at the same time.
    But now I understand the problem... Both dll's are created by LabVIEW! If
    they are not (or one is not, and the other is), this is no problem.
    And VI's in memory cannot have the same name. LabVIEW doesn't care if VI's
    are in a dll or not.
    This might not help, but if you want to make some sort of "plug in" system,
    you might consider using llb's. By loading VI's dynamically, you can select
    the path from which they are loaded. You must unload (close all references)
    one before the loading the other, or the same problem will occur. If you go
    this way, I consider a different approach. Make on
    e library (or even a dll)
    that has the interface you like, this is the "loader". Now make several
    "plug in"'s, with the same interfaces. The name of each function in a plug
    in is a concatenation of the library name and the function name. The loader
    has one extra function, that loads (and unloads, when done) references to
    all desired libraries to use (the names of the functions can be figured out
    easily). All that the loader functions do is dynamically call the library
    functions. You can use a call by reference node for this (you can use the
    connector pane or the loader vi, since the interface must be the same!).
    If you go this way, I guess the loader library can be converted to a dll...
    Hope this helps.
    Wiebe.
    "rsam" wrote in message
    news:[email protected]..
    > Thx Wiebe,
    >
    > did you load both dll at the same time? For example in 1 vi. Somehow
    > the first loaded function keeps to overrule the second. Notice that
    > the interface is
    exactly the same.
    >
    > I loaded 2 dll created in Labview with results described above.
    >
    > Regards Ruud

  • ** Is it possible to move back and generate the target node in Message Map

    Hi,
    We are doing EDI to IDoc scenario. In our scenario the source XML comes like
    XML Instance
    G_SPOC       (Node) 0..unbounded
       D_670       (Field)
       S_SDQ      (Node)
         D_67
         D_380
         D_67_2
         D_380_2
    G_SPOC
       D_670
       S_CTP
         D_212
    G_SPOC
       D_670
       S_SDQ
         D_67
         D_380
         D_67_2
         D_380_2
    Target Strcutre
    E1EDP01    0..unbounded
      For this instance we have to create E1EDP01 node for how much times D_67,D_67_2..... will come.
    By using 'CreateIf' function we check the existance of D_67,D_67_2 ... and create the target structure E1EDP01. This is working fine if S_SDQ node will come in source XML. Basically D_67,D_67_2 represents Store Nos and D_380,D_380_2 represents Qty.
    In the customer given EDI file, Price change also comes for Line items. It may comes in the file middle also. When Price Change come, the node S_SDQ will not come in G_SPOC but where as S_CTP will come. This contains Price Change in the field D_212.
    The indicator whether QD (Qty Discount), QI (Qty Increase), PC (Price change), AI (Additonal Increase) is stored in the fild D_670.
    In our logic in mapping, we create E1EDP01 based on the existance of D_67,D_67_2... . But, for PC (Price Change) we created special node E1EDP01 at the end (after all D_67,D_67_2 ) by checking the condition whether D_670 = 'PC'. This is also working fine when 'PC' comes in last G_POC of source XML. But, when it will come in middle of G_SPOC, mapping is only executed  for first 3 GPOC (for Example, QD,QI,PC) and it ignored the last one AI. (Because this is generated based on D_67 under S_SDQ again).
    The problem is we think that the system does not go back and execute the mapping for AI based on D_67.
    It executes mapping only in order.
    So, How will we solve this problem, friends? The requirements is  we have to do this thru Graphical Mapping only.
    We tried sever possibilites, but not worked out.
    Kindly help me friends to solve this issue.
    Thanking you.
    Kind Regards,
    Jeg P

    Friends,
    Any help to solve the above issue ?

  • Wanted: only attributes .extract() - function returns the complete node

    Hi I have xml documents stored as XMLType, I would like to extract only the attributes of a node which I point to using a xPath expression. As a matter of fact the funcion .extract( some XPath) returns the corresponding node inclusive all children. This is very costly since I have large XML documents having a deep structure.
    Thanks

    Your XPATH is incorrect
    The XPATH you provided identifies the node with the attribute name = blah
    The XPATH you want would end with /@*
    See
    http://www.w3c.org/TR/xpath#section-Location-Steps
    eg
    SQL> select extract(xml,'/Root/Element[@A1="FOO"]/@*')
    2 from
    3 (select xmltype(
    4 '
    5 <Root>
    6 <Element A1="FOO" A2="BAA"/>
    7 <Element A1="BAA" A2="FOO"/>
    8 </Root>
    9 ') xml
    10 from dual
    11 );
    EXTRACT(XML,'/ROOT/ELEMENT[@A1="FOO"]/@*')
    FOOBAA
    Unfortunately, extract will return a concatenation of the value of the selected attributes

  • Define a function at runtime...

    is it possible to define a function at runtime and call it...?
    i.e i have a program thats makes a call to some function xxx() in a class Abc
    but there is no definition for xxx() yet..hence during runtime the user types in the code and compiles it and then can he call the function xxx() from my program....? if so how..
    Thank you

    georgemc wrote:
    corlettk wrote:
    Both languages can be used from within a Java application.But you can't call-back Groovy methods from your java-app, can you?Sure you can! It compiles down to bytecode. Even code-weaving tools like AspectJ work with Groovy. If the OP really does need what he's asking for, Groovy or BeanShell are pretty much exactly what he's looking for. If it's what he really wants
    Have a butcher's hook at [this wackiness|http://groovy.codehaus.org/ExpandoMetaClass+-+Dynamic+Method+Names]
    My goodness me, what will they think of next.
    I do like Groovy, and Jython, and BeanScript already... but I've barely scratched the surface of any of them. Maybe I should... Hmmm...
    Thank you George.
    Slange. Keith.

  • User defined xquery function with index enabled

    If I use user defined xquery function, can the index be applied within the function?
    trados.xsd
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by () -->
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:tns="http://ecoit.hp.com/ecg/repository/trados" targetNamespace="http://ecoit.hp.com/ecg/repository/trados" elementFormDefault="qualified">
         <complexType name="entry">
              <sequence>
                   <element name="base" type="string"/>
                   <element name="translation" maxOccurs="unbounded">
                        <complexType>
                             <simpleContent>
                                  <extension base="string">
                                       <attribute name="lang"/>
                                  </extension>
                             </simpleContent>
                        </complexType>
                   </element>
              </sequence>
              <attribute name="xpath" type="string" use="required" xdb:SQLName="XPATH"/>
              <attribute name="locator" type="string" use="required"/>
         </complexType>
         <simpleType name="languages">
              <list itemType="string"/>
         </simpleType>
         <element name="trados" xdb:defaultTable="ECG_REP_TRADOS_TAB" xdb:tableProps="VARRAY XMLDATA.ENTRY STORE AS TABLE ECG_REP_TRADOS_ENTRY_TAB ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)) ORGANIZATION INDEX OVERFLOW)">
              <complexType>
                   <sequence>
                        <element name="entry" type="tns:entry" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="ENTRY"/>
                   </sequence>
                   <attribute name="cid" type="string"/>
                   <attribute name="path" type="string"/>
                   <attribute name="lang" type="string"/>
                   <attribute name="langs" type="tns:languages"/>
                   <attribute name="oldversion" type="string"/>
              </complexType>
         </element>
    </schema>
    CREATE INDEX ECG_REP_ENTRY_XPATH_IDX ON ECG_REP_TRADOS_ENTRY_TAB ("XPATH", "NESTED_TABLE_ID")
    eco_category.xsd
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSpy v2008 (http://www.altova.com) by Jan-Erik Pedersen (HEWLETT PACKARD) -->
    <!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com) by Scott Dismukes (Hewlett Packard)-->
    <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:tns="http://ecoit.hp.com/ecg/repository/eco/category" xmlns:cns="http://ecoit.hp.com/ecg/repository/types" targetNamespace="http://ecoit.hp.com/ecg/repository/eco/category" elementFormDefault="qualified">
         <import namespace="http://ecoit.hp.com/ecg/repository/types" schemaLocation="../types.xsd"/>
         <complexType name="productFamilies">
              <sequence>
                   <element name="productFamily" type="tns:productFamily" minOccurs="0" maxOccurs="unbounded"/>
                   <element name="product" type="tns:product" minOccurs="0" maxOccurs="unbounded"/>
              </sequence>
              <attribute name="lang" use="required" xdb:SQLName="LANG">
                   <simpleType>
                        <restriction base="string">
                             <length value="5"/>
                        </restriction>
                   </simpleType>
              </attribute>
              <attribute name="version" use="required" xdb:SQLName="VERSION">
                   <simpleType>
                        <restriction base="string">
                             <maxLength value="100"/>
                        </restriction>
                   </simpleType>
              </attribute>
         </complexType>
         <complexType name="productCategory">
              <sequence>
                   <element name="label" type="cns:label"/>
                   <element name="productCategory" type="tns:productCategory" minOccurs="0" maxOccurs="unbounded" xdb:defaultTable="ECG_REP_ECO_CATALOG_PC_TAB"/>
                   <element name="product" type="tns:product" minOccurs="0" maxOccurs="unbounded"/>
              </sequence>
              <attribute name="id" type="cns:id" use="required"/>
         </complexType>
         <complexType name="productCategories">
              <sequence>
                   <element name="productCategory" type="tns:productCategory" minOccurs="0" maxOccurs="unbounded"/>
              </sequence>
         </complexType>
         <complexType name="column">
              <sequence>
                   <element name="label" type="cns:label"/>
              </sequence>
              <attribute name="id" type="cns:id" use="required"/>
         </complexType>
         <complexType name="product">
              <sequence>
                   <element name="label" type="cns:label"/>
                   <element name="column" type="tns:column" minOccurs="0" maxOccurs="unbounded"/>
              </sequence>
              <attribute name="id" type="cns:id" use="required"/>
         </complexType>
         <complexType name="productFamily">
              <sequence>
                   <element name="label" type="cns:label"/>
                   <element name="image" type="cns:image" minOccurs="0" maxOccurs="unbounded"/>
                   <element name="link" type="cns:link" minOccurs="0" maxOccurs="unbounded"/>
                   <element name="column" type="tns:column" minOccurs="0" maxOccurs="unbounded"/>
                   <element name="productCategories" type="tns:productCategories" minOccurs="0" maxOccurs="unbounded"/>
              </sequence>
              <attribute name="id" type="cns:id" use="required"/>
         </complexType>
         <element name="productFamilies" type="tns:productFamilies" xdb:defaultTable="ECG_REP_ECO_CATALOG_TAB"/>
    </schema>
    xquery
    xquery version "1.0";
    declare namespace typ = "http://ecoit.hp.com/ecg/repository/types";
    declare namespace c = "http://ecoit.hp.com/ecg/repository/eco/category";
    declare namespace t = "http://ecoit.hp.com/ecg/repository/trados";
    declare variable $c := $res/c:productFamilies;
    declare function local:pc($pc as element(c:productCategory), $x as xs:string) as element()
         <c:productCategory id="{$pc/@id}">
              <c:label>{data($es/t:entry[@xpath eq concat($x, "/label")]/t:translation)}</c:label>
              for $p in $pc/c:product
              return local:p($p, concat($x, "/product/[@id=", $p/@id, "]"))
              for $pcc in $pc/c:productCategory
              return local:pc($pcc, concat($x, "/productCategory[@id=", $pcc/@id, "]"))
         </c:productCategory>
    declare function local:p($p as element(c:product), $x as xs:string) as element()
         <c:product id="{$p/@id}">
              <c:label>{string($es/t:entry[@xpath eq concat($x, "/label")]/t:translation)}</c:label>
              for $col in $p/c:column
              return
              <c:column id="{$col/@id}">
                   <c:label>
                        let $e := $es/t:entry[@xpath eq concat($x, "/column[@id=", $col/@id, "]/label")]
                        return
                        if(exists($e)) then string($e/t:translation)
                        else $col/c:label/text()
                   </c:label>
              </c:column>
         </c:product>
    <c:productFamiles xsi:schemaLocation="http://ecoit.hp.com/ecg/repository/eco/category http://ecoit.hp.com/ecg/repository/eco/category.xsd http://ecoit.hp.com/ecg/repository/types http://ecoit.hp.com/ecg/repository/types.xsd" lang="{$lang/lang/text()}" version="{$c/@version}">
         for $pf in $c/c:productFamily
         let $x := concat("/productFamily[@id=", $pf/@id, "]")
         return
         <c:productFamily id="{$pf/@id}">
    (:xpath index can not be applied within function:)
              <c:label>{data($es/t:entry[@xpath eq concat($x, "/label")]/t:translation)}</c:label>
              for $img in $pf/c:image
              return $img
              for $link in $pf/c:link
              return $link
              for $col in $pf/c:column
              return
              <c:column id="{$col/@id}">
                   <c:label>{data($es/t:entry[@xpath eq concat($x, "/column[@id=", $col/@id, "]/label")]/t:translation)}</c:label>
              </c:column>
              for $pcs in $pf/c:productCategories
              return
              <c:productCategories>
                   for $pc in $pcs/c:productCategory
                   return local:pc($pc, concat($x, "/productCategories/productCategory[@id=", $pc/@id, "]"))
              </c:productCategories>
         </c:productFamily>
         for $p in $c/c:product
         return local:p($p, concat("/product[@id=", $p/@id, "]"))
    </c:productFamiles>
    Message was edited by:
    John Lee

    John
    Am i missing a bit of the Xquery
    In 11.1,0.6.0 I get
    Elapsed: 00:00:00.04
    SQL> set echo on
    SQL> spool testcase.log
    SQL> --
    SQL> connect sys/ as sysdba
    Enter password:
    Connected.
    SQL> set define on
    SQL> set timing on
    SQL> --
    SQL> define USERNAME = HPECO
    SQL> --
    SQL> def PASSWORD = HPECO
    SQL> --
    SQL> def USER_TABLESPACE = USERS
    SQL> --
    SQL> def TEMP_TABLESPACE = TEMP
    SQL> --
    SQL> drop user &USERNAME cascade
      2  /
    old   1: drop user &USERNAME cascade
    new   1: drop user HPECO cascade
    User dropped.
    Elapsed: 00:00:18.12
    SQL> grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSW
    ORD
      2  /
    old   1: grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &P
    ASSWORD
    new   1: grant create any directory, drop any directory, connect, resource, alter session, create view to HPECO identified by HPECO
    Grant succeeded.
    Elapsed: 00:00:00.03
    SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
      2  /
    old   1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
    new   1: alter user HPECO default tablespace USERS temporary tablespace TEMP
    User altered.
    Elapsed: 00:00:00.00
    SQL> connect &USERNAME/&PASSWORD
    Connected.
    SQL> --
    SQL> alter session set events ='19027 trace name context forever, level 0x800'
      2  /
    Session altered.
    Elapsed: 00:00:00.00
    SQL> --
    SQL> declare
      2    xmlschema xmltype := XMLTYPE(
      3  '<?xml version="1.0" encoding="UTF-8"?>
      4  <!-- edited with XMLSpy v2008 (http://www.altova.com) by Jan-Erik Pedersen (HEWLETT PACKARD) -->
      5  <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:tns="http://ecoit.hp.com/ecg/rep
    ository/types" targetNamespace="http://ecoit.hp.com/ecg/repository/types" elementFormDefault="qualified">
      6     <complexType name="item">
      7             <simpleContent>
      8                     <extension base="tns:content">
      9                             <attribute name="id" type="tns:id" use="required"/>
    10                     </extension>
    11             </simpleContent>
    12     </complexType>
    13     <complexType name="items">
    14             <sequence>
    15                     <element name="item" type="tns:item" maxOccurs="unbounded"/>
    16             </sequence>
    17             <attribute name="id" type="tns:id" use="required"/>
    18     </complexType>
    19     <complexType name="mappings">
    20             <sequence>
    21                     <element name="item" type="tns:item" minOccurs="0" maxOccurs="unbounded"/>
    22                     <element name="items" type="tns:items" minOccurs="0" maxOccurs="unbounded"/>
    23             </sequence>
    24     </complexType>
    25     <complexType name="local">
    26             <sequence>
    27                     <element name="common">
    28                             <complexType>
    29                                     <sequence>
    30                                             <element name="texts" type="tns:mappings"/>
    31                                             <element name="images" type="tns:mappings" minOccurs="0"/>
    32                                     </sequence>
    33                             </complexType>
    34                     </element>
    35                     <element name="section" minOccurs="0" maxOccurs="unbounded">
    36                             <complexType>
    37                                     <sequence>
    38                                             <element name="texts" type="tns:mappings"/>
    39                                             <element name="images" type="tns:mappings" minOccurs="0"/>
    40                                     </sequence>
    41                                     <attribute name="id" use="required">
    42                                             <simpleType>
    43                                                     <restriction base="string">
    44                                                             <maxLength value="32"/>
    45                                                     </restriction>
    46                                             </simpleType>
    47                                     </attribute>
    48                             </complexType>
    49                     </element>
    50             </sequence>
    51             <attribute name="lang" use="required" xdb:SQLName="LANG">
    52                     <simpleType>
    53                             <restriction base="string">
    54                                     <length value="5"/>
    55                             </restriction>
    56                     </simpleType>
    57             </attribute>
    58     </complexType>
    59     <complexType name="link">
    60             <sequence>
    61                     <element name="url" type="tns:url"/>
    62                     <element name="label" type="tns:label"/>
    63                     <element name="image" type="tns:image" minOccurs="0"/>
    64             </sequence>
    65             <attribute name="id" type="tns:id"/>
    66     </complexType>
    67     <complexType name="image">
    68             <sequence>
    69                     <element name="url" type="string"/>
    70                     <element name="label" type="tns:label" minOccurs="0"/>
    71             </sequence>
    72             <attribute name="id" type="tns:id" use="optional"/>
    73     </complexType>
    74     <simpleType name="id">
    75             <restriction base="string">
    76                     <maxLength value="100"/>
    77             </restriction>
    78     </simpleType>
    79     <simpleType name="label">
    80             <restriction base="string">
    81                     <maxLength value="200"/>
    82             </restriction>
    83     </simpleType>
    84     <simpleType name="content">
    85             <restriction base="string">
    86                     <maxLength value="4000"/>
    87             </restriction>
    88     </simpleType>
    89     <simpleType name="url">
    90             <restriction base="string">
    91                     <maxLength value="256"/>
    92             </restriction>
    93     </simpleType>
    94  </schema>');
    95  begin
    96    dbms_xmlschema.registerSchema
    97    (
    98        schemaurl => 'http://ecoit.hp.com/ecg/repository/types.xsd'
    99       ,schemadoc => xmlschema
    100       ,local     => TRUE
    101       ,genBean   => false
    102       ,genTypes  => TRUE
    103       ,genTables => TRUE
    104       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    105    );
    106  end;
    107  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.35
    SQL>
    SQL> declare
      2    xmlschema xmltype := XMLTYPE(
      3  '<?xml version="1.0" encoding="UTF-8"?>
      4  <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by  () -->
      5  <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:tns="http://ecoit.hp.com/ecg/rep
    ository/trados" targetNamespace="http://ecoit.hp.com/ecg/repository/trados" elementFormDefault="qualified">
      6     <complexType name="entry">
      7             <sequence>
      8                     <element name="base" type="string"/>
      9                     <element name="translation" maxOccurs="unbounded">
    10                             <complexType>
    11                                     <simpleContent>
    12                                             <extension base="string">
    13                                                     <attribute name="lang"/>
    14                                             </extension>
    15                                     </simpleContent>
    16                             </complexType>
    17                     </element>
    18             </sequence>
    19             <attribute name="xpath" type="string" use="required" xdb:SQLName="XPATH"/>
    20             <attribute name="locator" type="string" use="required"/>
    21     </complexType>
    22     <simpleType name="languages">
    23             <list itemType="string"/>
    24     </simpleType>
    25     <element name="trados" xdb:defaultTable="ECG_REP_TRADOS_TAB" xdb:tableProps="VARRAY XMLDATA.ENTRY STORE AS TABLE ECG_REP_TRA
    DOS_ENTRY_TAB ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)) ORGANIZATION INDEX OVERFLOW)">
    26             <complexType>
    27                     <sequence>
    28                             <element name="entry" type="tns:entry" minOccurs="0" maxOccurs="unbounded" xdb:SQLName="ENTRY"/>
    29                     </sequence>
    30                     <attribute name="cid" type="string"/>
    31                     <attribute name="path" type="string"/>
    32                     <attribute name="lang" type="string"/>
    33                     <attribute name="langs" type="tns:languages"/>
    34                     <attribute name="oldversion" type="string"/>
    35             </complexType>
    36     </element>
    37  </schema>');
    38  begin
    39    dbms_xmlschema.registerSchema
    40    (
    41        schemaurl => 'http://ecoit.hp.com/ecg/repository/trados.xsd'
    42       ,schemadoc => xmlschema
    43       ,local     => TRUE
    44       ,genBean   => false
    45       ,genTypes  => TRUE
    46       ,genTables => TRUE
    47       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    48    );
    49  end;
    50  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.68
    SQL> declare
      2    xmlschema xmltype := XMLTYPE(
      3  '<?xml version="1.0" encoding="UTF-8"?>
      4  <!-- edited with XMLSpy v2008 (http://www.altova.com) by Jan-Erik Pedersen (HEWLETT PACKARD) -->
      5  <!--W3C Schema generated by XMLSpy v2007 (http://www.altova.com) by Scott Dismukes (Hewlett Packard)-->
      6  <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:tns="http://ecoit.hp.com/ecg/rep
    ository/eco/category" xmlns:cns="http://ecoit.hp.com/ecg/repository/types" targetNamespace="http://ecoit.hp.com/ecg/repository/eco/c
    ategory" elementFormDefault="qualified">
      7     <import namespace="http://ecoit.hp.com/ecg/repository/types" schemaLocation="http://ecoit.hp.com/ecg/repository/types.xsd"/>
      8     <complexType name="productFamilies">
      9             <sequence>
    10                     <element name="productFamily" type="tns:productFamily" minOccurs="0" maxOccurs="unbounded"/>
    11                     <element name="product" type="tns:product" minOccurs="0" maxOccurs="unbounded"/>
    12             </sequence>
    13             <attribute name="lang" use="required" xdb:SQLName="LANG">
    14                     <simpleType>
    15                             <restriction base="string">
    16                                     <length value="5"/>
    17                             </restriction>
    18                     </simpleType>
    19             </attribute>
    20             <attribute name="version" use="required" xdb:SQLName="VERSION">
    21                     <simpleType>
    22                             <restriction base="string">
    23                                     <maxLength value="100"/>
    24                             </restriction>
    25                     </simpleType>
    26             </attribute>
    27     </complexType>
    28     <complexType name="productCategory">
    29             <sequence>
    30                     <element name="label" type="cns:label"/>
    31                     <element name="productCategory" type="tns:productCategory" minOccurs="0" maxOccurs="unbounded" xdb:defaultTa
    ble="ECG_REP_ECO_CATALOG_PC_TAB"/>
    32                     <element name="product" type="tns:product" minOccurs="0" maxOccurs="unbounded"/>
    33             </sequence>
    34             <attribute name="id" type="cns:id" use="required"/>
    35     </complexType>
    36     <complexType name="productCategories">
    37             <sequence>
    38                     <element name="productCategory" type="tns:productCategory" minOccurs="0" maxOccurs="unbounded"/>
    39             </sequence>
    40     </complexType>
    41     <complexType name="column">
    42             <sequence>
    43                     <element name="label" type="cns:label"/>
    44             </sequence>
    45             <attribute name="id" type="cns:id" use="required"/>
    46     </complexType>
    47     <complexType name="product">
    48             <sequence>
    49                     <element name="label" type="cns:label"/>
    50                     <element name="column" type="tns:column" minOccurs="0" maxOccurs="unbounded"/>
    51             </sequence>
    52             <attribute name="id" type="cns:id" use="required"/>
    53     </complexType>
    54     <complexType name="productFamily">
    55             <sequence>
    56                     <element name="label" type="cns:label"/>
    57                     <element name="image" type="cns:image" minOccurs="0" maxOccurs="unbounded"/>
    58                     <element name="link" type="cns:link" minOccurs="0" maxOccurs="unbounded"/>
    59                     <element name="column" type="tns:column" minOccurs="0" maxOccurs="unbounded"/>
    60                     <element name="productCategories" type="tns:productCategories" minOccurs="0" maxOccurs="unbounded"/>
    61             </sequence>
    62             <attribute name="id" type="cns:id" use="required"/>
    63     </complexType>
    64     <element name="productFamilies" type="tns:productFamilies" xdb:defaultTable="ECG_REP_ECO_CATALOG_TAB"/>
    65  </schema>
    66  ');
    67  begin
    68    dbms_xmlschema.registerSchema
    69    (
    70        schemaurl => 'http://ecoit.hp.com/ecg/repository/eco/category.xsd'
    71       ,schemadoc => xmlschema
    72       ,local     => TRUE
    73       ,genBean   => false
    74       ,genTypes  => TRUE
    75       ,genTables => TRUE
    76       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    77    );
    78  end;
    79  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.65
    SQL> CREATE INDEX ECG_REP_ENTRY_XPATH_IDX ON ECG_REP_TRADOS_ENTRY_TAB ("XPATH", "NESTED_TABLE_ID")
      2  /
    Index created.
    Elapsed: 00:00:00.01
    SQL> set pages 0 lines 160
    SQL> set long 10000
    SQL> --
    SQL> set autotrace on explain
    SQL> --
    SQL> xquery
      2  xquery version "1.0";
      3
      4  declare namespace typ = "http://ecoit.hp.com/ecg/repository/types";
      5  declare namespace c = "http://ecoit.hp.com/ecg/repository/eco/category";
      6  declare namespace t = "http://ecoit.hp.com/ecg/repository/trados";
      7
      8  declare variable $c := $res/c:productFamilies;
      9
    10  declare function local:pc($pc as element(c:productCategory), $x as xs:string) as element() {
    11     <c:productCategory id="{$pc/@id}">
    12     {
    13             <c:label>{data($es/t:entry[@xpath eq concat($x, "/label")]/t:translation)}</c:label>
    14             ,
    15             for $p in $pc/c:product
    16             return local:p($p, concat($x, "/product/[@id=", $p/@id, "]"))
    17             ,
    18             for $pcc in $pc/c:productCategory
    19             return local:pc($pcc, concat($x, "/productCategory[@id=", $pcc/@id, "]"))
    20     }
    21     </c:productCategory>
    22  };
    23
    24  declare function local:p($p as element(c:product), $x as xs:string) as element() {
    25     <c:product id="{$p/@id}">
    26     {
    27             <c:label>{string($es/t:entry[@xpath eq concat($x, "/label")]/t:translation)}</c:label>
    28             ,
    29             for $col in $p/c:column
    30             return
    31             <c:column id="{$col/@id}">
    32                     <c:label>
    33                     {
    34                             let $e := $es/t:entry[@xpath eq concat($x, "/column[@id=", $col/@id, "]/label")]
    35                             return
    36                             if(exists($e)) then string($e/t:translation)
    37                             else $col/c:label/text()
    38                     }
    39                     </c:label>
    40             </c:column>
    41     }
    42     </c:product>
    43  };
    44
    45  <c:productFamiles xsi:schemaLocation="http://ecoit.hp.com/ecg/repository/eco/category http://ecoit.hp.com/ecg/repository/eco/ca
    tegory.xsd  http://ecoit.hp.com/ecg/repository/types  http://ecoit.hp.com/ecg/repository/types.xsd" lang="{$lang/lang/text()}" versi
    on="{$c/@version}"> {
    46     for $pf in $c/c:productFamily
    47     let $x := concat("/productFamily[@id=", $pf/@id, "]")
    48     return
    49     <c:productFamily id="{$pf/@id}">
    50     {
    51             (:xpath index can not be applied within function:)
    52             <c:label>{data($es/t:entry[@xpath eq concat($x, "/label")]/t:translation)}</c:label>
    53             ,
    54             for $img in $pf/c:image
    55             return $img
    56             ,
    57             for $link in $pf/c:link
    58             return $link
    59             ,
    60             for $col in $pf/c:column
    61             return
    62             <c:column id="{$col/@id}">
    63                     <c:label>{data($es/t:entry[@xpath eq concat($x, "/column[@id=", $col/@id, "]/label")]/t:translation)}</c:lab
    el>
    64             </c:column>
    65             ,
    66             for $pcs in $pf/c:productCategories
    67             return
    68             <c:productCategories>
    69             {
    70                     for $pc in $pcs/c:productCategory
    71                     return local:pc($pc, concat($x, "/productCategories/productCategory[@id=", $pc/@id, "]"))
    72             }
    73             </c:productCategories>
    74     }
    75     </c:productFamily>
    76     ,
    77     for $p in $c/c:product
    78     return local:p($p, concat("/product[@id=", $p/@id, "]")) } </c:productFamiles>
    79  /
    ERROR:
    ORA-19228: XPST0008 - undeclared identifier: prefix 'res' local-name ''
    Elapsed: 00:00:00.01
    SQL>

  • N82: Is it possible to assign another function to ...

    Hi all!
    Is it possible to assign another function to the top right key of the N82? Currently this one starts the GPS (Nokia Maps), but I would like to make it a shortcut-key to, for example, my calendar.
    Is this possible?
    Regards,
    Evert

    Yes you can change it.
    Menu > Tools > Settings > General > Personalisation > Standby Mode > Shortcuts > Right Selection Key

  • Execution of a planning function with the used dimension values in a crosstab

    Hello,
    would like to execute planning functions within Design Studio but I don't really know how I combine this execution with the used dimension values in a crosstab for the .
    Here the requirement:
    3 Planning functions which should use the same filter (all values of all dimensions in the crosstab) and which should run one after another:
    // open data slice
    PF_1.execute();
    // generate combinitions
    PF_2.execute();
    // close data slice
    PF_3.execute();
    Many thanks in advance.
    Kind regards,
    Tobias

    Hi Arun,
    in general it is not possible to nest planning functions. The inner function would update the data in the plan buffer without the outer function knowing about it. Also the inner function might be on a different aggregation level which would make things very tricky.
    Alternatively you can include ABAP logic into a FOX formula:
    http://help.sap.com/saphelp_nw70/helpdata/en/47/94eb78b6394befe10000000a42189d/frameset.htm
    Or just create the complete logic in one ABAP planning function type.
    Regards,
    Marc
    SAP NetWeaver RIG

  • Calling a function in the HTML window the course sits inside - Captivate 8

    Hi,
    I've scoured the forums for an answer to this but as yet have come up blank.
    Our LMS launches a course in a popup window and inside of this the .htm Captivate output file sits.
    Currently this pop up window has a button in it which executes a function.  The problem is this button is rather unsightly sitting above the course in the HTML window and I'd like to be able to call this function from inside the Captivate course itself.
    The function is called closeSCOContent() and it closes the course window but crucially forwards the user to a feedback page.
    So essentially is it possible to call this function using the Javascript function in Captivate 8?
    I hope I've explained that sufficiently
    Many thanks!

    Hi,
    This gave me the nudge in the right direction I needed, after a bit of basic frameset research I've got the desired functionality.
    Huge thanks!

  • Is it possible to use a file refnum as an input of mathscript node

    Hi everybody,
    I just began to use LV and mathscript recently. One problem confused me a lot.  That is,
    Is it possible to use a file refnum as the input or output of mathscript node? A picture is attached for your reference.
    Thanks a lot!
    Gary
    Solved!
    Go to Solution.
    Attachments:
    Q-001.jpg ‏45 KB

    What would you hope to do with the reference?  The Mathscript node doesn't have a file reading capability.  You need to read the file and pass the data into the Mathscript node.
    EDIT: I stand corrected.  You need to use the fopen and fclose functions inside of the MathScript node to be able to read a file inside of it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Changing the function of the Media Player Hot Key on the Laptop itself

    Hey everyone,
    I was wondering if anyone knew of a way to change what the Media Player Hot Key on the Laptop itself does? I've got the Power Button, Internet, Media Player, Play/Pause, Stop, Rewind & Fast Forward, but the Media Player Hot Key is pretty useless to me, and I'd like to change its function, to open Outlook instead, but does anyone know if that's even possible?
    I'm almost positive that there's a way, but I just can't seem to find it, if anyone can help me, then I would really appreciate it,
    Cheers.

    Hi
    I remember it was possible to assign different functions to the control buttons on several units.
    I dont know what unit your use but you should check the Toshiba control button application which could be installed on your notebook.
    You should find it in the control panel
    This application could allow you to configure the control buttons.
    But if this software will not provide this option you will be not able to change the functionality

Maybe you are looking for