How to return a string or a comment through ODI os command

Hi,
Is there any way so to return any string through odi os command.
I want to return that error back through odi operator.
Thanks

I dont think so. You can modify your script file so that in case of any error it will write a flag (your string values) to another temp file (temp.txt)
Then read the file via jython. If flag =1 (or your req values) then there is some error in your script. Now Raise error in odi which print the string in operator.
Thanks.
Bhabani
http://dwteam.in

Similar Messages

  • How to return a String in main() [IBM iSeries]

    Hei,
    gotta question:
    How do I return a String on the exit of a Java-Application?
    public static String main(String[] args) {
            return aString;
    }is "illegal" but I need to do something like that.
    What I want to do is to start a java app in a cl on the iSeries (no problem) and fill a variable with the result (the problem)
    Big Thx,
    LoCal

    System.out.println("This is my return String");
    then capture the output?

  • How to return a String

    i have a program that needs to return a String (or a variable that holds test). String is not a return type variable so how do i return a string-like variable (or object). I tried returning a Vector but it doesn'w work the same problem ocurs. Vector is not a reurn type variable (technicly it is not really a variable ata all). So how do is do it.
    Thank you for the help
    Also is there a book i can buy that can help me study for the Java core technology exam (CX-310-055). Is there any material i need to know that i could study from a book that i can buy or some other resource that is now so expensive as taking a java certification class?
    Thank you again

    -- well, you can try this book: Java 2 Programmer Exam Cram 2[b\                                                                                                                                                                                           

  • How to return a string in chronological order?

    I have a string called schedule, for example:
    schedule = "^14%Paul's house?Group Meeting\n^9%Nutty Professor's Office?Office Hours\n^12%MegaBits?Lunch"
    After breaking it up using StringTokenizer, how do I return it into chronological order?
    Return the schedule for each day of the week as a String with the appointments listed in chronological order, starting with those for the first day of the week and ending with those for the last day of the week.
    The String should have the following format
    Sunday:
    ^14%Paul's house?Group Meeting
    Monday:
    ^9%Nutty Professor's Office?Office Hours
    Tuesday:
    ^12%MegaBits?Lunch
    Wednesday:
    xxx
    Thursday:
    xxx
    Friday:
    xxx
    Saturday:
    xxx
    xxx is the String representation of the schedule for each day. There should be no newline after the last schedule.
    Note: if there are no appointments scheduled for a certain day, then that day should not be included in the String. (For example, if there are no appointments scheduled on Tuesday then:
    Tuesday:
    xxx
    should not be included.)

    Well, then,
    i would assume you need to keep 7 variables, that hold the 7 values of the days,
    then append the values together in the natural order using +

  • How to return a java object to VB through the activex bridge?

    Hello,
    I am trying to return more than just a primitive data type to VB from Java. To do this, I compile the two attached files and jar them into FastStatWrapper.jar which I then run through packager.exe and thus end up with an activex object. I then instantiate the FastStatWrapper object in VB and call execute in the following way:
    dim result as Object
    Dim wrapper as Object
    Set wrapper = CreateObject("FastStatWrapper.Bean.1")
    Set result = wrapper.execute("SOMETHING")However, I can't seem to access the result object. It doesn't have any methods. Do I have to package it as a separate bean?
    package test;
    public class FastStatWrapper
         public FastStatWrapper()
         public StatData execute(String _command)
              return new StatData("A", 3.0);
    }and here the data object...
    package test;
    public class StatData
         private String name = null;
         private double value;
         public StatData(String _name, double _value)
              name = _name;
              value = _value;
         public String getValueType()
              return name;
         public double getValue()
              return value;
    }                    

    The returned java object will be exposed as a dispatch object. You should be able to call methods on the returned java object. However, type information will not be available for that object and hence no support for code completion and syntax checking.

  • How to manipulate static string / text in HTML through Javascript

    Hi,
    Sorry I know this is not the perfect place to ask about HTML. But I need help somehow.
    In simple i am creating a website in JSP and using Javascripts.
    The problem is I have a HTML form where the user have to enter Login Id and Password. If user enters correct data then he is taken o relevant page.
    But if the user enters data (say some invalid character, where it can be handled by Javascript), then it should give feedback as Incorrect Id and Password in that page only but not by alert() statement i.e a statement with red font should get visible.
    Eg: In Yahoo the user taken to new page if he enters Wrong Id and Password
    In Gmail , the feedback is given on that page only.
    I hope u all understand.
    Thanks.

    If the action attribute of your login form say login.html is set to a servet, and say your servlet is responsible for the validation of Login Id and password, then you could use a RequestDispatcher object in your servlet.
    Use ServletContext.getRequestDispatcher(java.lang.String) to obtain the RequestDispatcher object and then invoke include() method on it.
    So, if Login ID and password do not match, then any message, will be included in the same login form, login.html
    Use google to find more information.

  • Returning the string from the SimpleDateFormat

    Hi guys,
    Can someone tell me how to return the string from the SimpleDateFormat?
    I've created the method to do this, but i don't know the exact code to use. Here's my code so far...
        public String convert (Calendar gc)
            String s = convert(gc);
            return // I need to return the s here, but don't know how to code it.
        }BTW, i've already wrote the code for the SimpleDateFormat (so if you want me post that, i will).

    DrLaszloJamf wrote:
    LevelSix wrote:
    DrLaszloJamf wrote:
    No.Can you tell me what it is, because i've went through the API and i don't know.
    Have you looked for a tutorial: [http://java.sun.com/docs/books/tutorial/i18n/format/dateintro.html]
    Thanks a lot DrLaszloJamf, this is useful.
    DrClap wrote:
    Nope. Suppose you were on a construction site and the foreman told you to move a pile of concrete blocks from a truck into the building. What do you suppose would happen if you asked the foreman what a concrete block was, and where the building was, and whether you should drive the truck into the street, and then you tried to pick up the whole pile all at once, and then you asked if you could kick the blocks like footballs? This is what you're doing here. You'd be fired from the construction site within half an hour.Sir...

  • How do I open a .nrl extension in firefox, currently it returns a string of text instead of opening the file with the default program.

    When I click on a .nrl file extension (belongs to Autonomy I-Manage Software) it returns a string of code (what is in the shortcut link) instead of following the link and returning the document. Is there a way to tell Forefox connect to the document that the shortcut is linked to? The .nrl file extension belongs to a piece of software called FileSite (document management system).

    '''Adding download actions''' is the relevant section of that article for your situation.
    Is the *.nrl file on a website or already saved to your PC?
    If it is on a website, the server may not be sending the appropriate Mime-Type telling Firefox how that file is to be handled - ''"Content-Disposition"''.
    Can you give us the URL of the webpage where you have this problem? <br />
    So we can see first hand what the issue is.

  • How to send a string to CVI .c and get string return through TestStand sequence?

    Hi, I am using TestStand 3.1 and I have the StringConverter.c with CVI 8.0 with the function:
    char * string_concat_2 (char* str1,char* str2)
     char * str_ret;
     str_ret = calloc(200, sizeof(char*));
     str_ret = strcat (str_ret, str1);
     str_ret = strcat (str_ret, str2);
     return str_ret;
    I would like to use it  through Teststand, so I add a sequence using 'StringValueTest'. I Spectify Module CVI &  link to StringConverter.c and type in Function Name: char * string_concat_2 (char* str1,char* str2)
    1. How I define to send the string1 ("Hello") & string2 ("World") to the Module?
    2. How I define to string return ("HelloWorld" from the Module?
    Thanks

    Hi plit string,
    You will need to have a parameter passed by reference to return the
    string.  To do this, use a "C String Buffer" instead of a "C String
    (const)" parameter type.  There is documentation on this in TestStand
    Help.  Here is a quote from there:
    "When using string parameters, use the C String Buffer or Unicode
    String Buffer type if you want the function to be able to change the contents of
    the argument in TestStand. Use the C String or Unicode String type if the DLL
    function does not modify the argument. You can pass a literal string, a
    TestStand string property, or an expression that evaluates to a string as the
    value of a string parameter."
    Gavin Fox
    Systems Software
    National Instruments

  • How to return more than one object from SwingWorker

    I am using a SwingWorker to call 3 different methods of another class (data fetch class). Each of these 3 methods returns a String array. I am able to get the first array outside the thread code using the get() method of the SwingWorker class,
    final String tmpOrdNum = OrderNum;
    SwingWorker worker = new SwingWorker() {
         DATA_FETCH_TO_ARRAY data_fetch = new DATA_FETCH_TO_ARRAY(tmpOrdNum);
         public Object construct(){
              String [] orderArr = data_fetch.getHeaderArray();
              //String [] detailArr = data_fetch.getDetailArray();
              //String [] storeArr = data_fetch.getStoreArray();                    
              return orderArr;
         //Runs on the event-dispatching thread.
         public void finished(){     }
    worker.start() ;
    String[] testArr = (String[])worker.get();      //gets the header array
    /* HOW DO I GET THE DETAIL AND STORE ARRAYS HERE?*/I want to be able to call the other 2 methods of the data fetch class - getDetailArray() and getStoreArray() shown commented in the above code one by one.
    Can someone please suggest a way of doing this? Thank you.

    Return String[][] from construct method.
    Here is an example (observe test method):
    import java.util.*;
    public class ArrayTest{
         public static void main(String[] args){
              String[][] result=(String[][])new ArrayTest().test();          
              System.out.println("result1: "+Arrays.toString(result[0]));
              System.out.println("result2: "+Arrays.toString(result[1]));
              System.out.println("result3: "+Arrays.toString(result[2]));
         public Object test(){
              String[] str1={"A","B","C"};
              String[] str2={"M","N","O"};
              String[] str3={"X","Y","Z"};          
              String[][] out=new String[3][];
              out[0]=str1;
              out[1]=str2;
              out[2]=str3;
              return out;
    }Thanks,
    Mrityunjoy

  • 2 Threads issues. How to return data from a thread located in other class

    I have 2 questions.
    This is the context. From main I start one thread that does a little job then starts another thread and waits for it to end to continue.
    1) The last started thread needs to return a string to the Thread started from main. How can I accomplish that, because I read that I cannot use
    synchronized methods outside different classes (and the threads belongs to different classes).
    2) From the main thread I start the Second Thread located in another class like this ClassName obj = new ClassName(arg); obj.start(); obj.join()
    Is that correct for waiting for the created thread to finish ?

    1) The last started thread needs to return a string to the Thread started from main. How can I accomplish that, because I read that I cannot use
    synchronized methods outside different classes (and the threads belongs to different classes).Threads do not "belong" to classes. Class code executes in a particular thread. The class instances exist as long as something, somewhere, holds a strong reference to them.
    So when you start a new thread, hold a strong reference to the object being executed by that thread. When the thread is done, retrieve your data from that object.
    Even better, don't subclass Thread to create your objects. Instead, implement Callable, and use a ThreadPoolExecutor to execute it.

  • How to convert a string value to date

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    In your post you ask how to convert a string value to a date.  The value returned from the Get-AdUser is already a date.  It does not need to be converted.
    Bill has sshown one way to convert a date to a string and there are other methods.  You need to clarify your question.
    If you are really trying ot convert strings to dates then you can start with this:
    [datetime]'01/21/1965 13:33:23'
    Most date strings aer autodetected by the class.
    ¯\_(ツ)_/¯

  • How to return xmlType from Webservice generated with JDev and PL/SQL

    Hi,
    I have generated an PL/SQL package that's returning a value as xmlType.
    With JDeveloper I'm deploying this package as a webservice. When invoking the webservice from a webbrowser the result looks like:
    <?xml version="1.0" encoding="UTF-8" ?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:testXmltypeResponse
    xmlns:ns1="http://app/webservice.wsdl"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:string">
    <ROWSET>
    <ROW>
    <TODAY>12-OCT-07</TODAY>
    </ROW>
    </ROWSET>
    </return>
    </ns1:testXmltypeResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    The problem is that the <return> tag contains 'xsi:type="xsd:string"'. And now the webservice response is not valid XML because the return value contains XML and not a string.
    The solution would be, when invoking the webservice if the xsi:type would be missing from the result tag or would contains xsd:any. I tried editing the WSDL in JDeveloper and changing the type to xsd:any. After deploying and calling the WSDL from the webbrowser it contains this type. But when invoking the method from the webbrowser it still returns xsd:string as type.
    How can I get rid of this type in the <return> or change it.
    My JDeveloper version is 10.1.3.3.0 The Oracle database and 9iAS are 10.2.
    Thanks in advance,
    Thijs

    What version are you on?
    Works fine for me on my 11g:
    SQL> create or replace procedure testxml (clob_out out clob)
      2  is
      3     l_clob   clob;
      4     l_ctx    dbms_xmlquery.ctxhandle;
      5  begin
      6     l_ctx := dbms_xmlquery.newcontext ('select * from dual');
      7     l_clob := dbms_xmlquery.getxml (l_ctx);
      8     clob_out := l_clob;
      9     dbms_xmlquery.closecontext (l_ctx);
    10  end testxml;
    11  /
    Procedure created.
    SQL>
    SQL> variable vout clob;
    SQL>
    SQL> exec testxml (:vout)
    PL/SQL procedure successfully completed.
    SQL>
    SQL> print vout
    VOUT
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <DUMMY>X</DUMMY>
       </ROW>
    </ROWSET>But definitely you can optimize your proc a bit: Try
    create or replace procedure testxml (clob_out in out nocopy clob)
    is
       l_ctx    dbms_xmlquery.ctxhandle;
    begin
       l_ctx := dbms_xmlquery.newcontext ('select * from dual');
       clob_out := dbms_xmlquery.getxml (l_ctx);
       dbms_xmlquery.closecontext (l_ctx);
    end testxml;
    /

  • How to convert a String("yyyy-mm-dd") to the same but in Date format ?

    Hi,
    can anyone plz tell me how to convert a String to a date format.I'm using MSACCESS database.I want to store this string in the database.So i need to convert it to a date format since the table is designed such a way with date/time type for date field.I used SimpleDateFormat ,but i can't able to convert.The code is given below:
    coding:
    public String dateconvertion(String strDate)
    try
    SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd");
    Date date = sdfSource.parse(strDate);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd ");
    strDate = sdfDestination.format(date);
    catch(ParseException pe)
    System.out.println("Parse Exception : " + pe);
    return(strDate);
    }

    i used prepared statement even now i am getting error like this.....
    i have included the prepared statement package also...
    my coding:
    ResultSet rsdatetemp = null;
    PreparedStatement ps = null;
    String query ="select distinct itemcode from sales where bill date between ? and ?";
    ps = precon.prepareStatement(query);
    ps.setDate(1,d1);//d1 and d2 are in date format
    ps.setDate(2,d2);
    rsdatetemp = ps.executeQuery();
    error :
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(1,d1);
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(2,d2);

  • How to convert xml String to xml file?

    Hi,
    I got a method that do the following:
    public static String convertXmlToString(String xmlFileName) throws Exception
            File file = new File(xmlFileName);
            FileInputStream insr = new FileInputStream(file);
            byte[] fileBuffer = new byte[(int)file.length()];
            insr.read(fileBuffer);
            insr.close();
            return new String(fileBuffer);
         }The return String is the contents of an existing xml file and one example is shown below:
    <object type="server.WOXReference" id="0"><field name="actualPathObj"><object type="java.lang.String" id="1">C:\restClient\actualXMLObjects\812856084.xml</object></field><field name="object"><object type="server.WOXConstructor" id="2"><field name="className"><object type="java.lang.String" id="3">rec.SimpleRecognizer</object></field><field name="types"><array type="java.lang.String" length="3" id="4"><object type="java.lang.String" id="5">double[].class</object><object type="java.lang.String" id="6">double.class</object><object idref="6" /></array></field><field name="args"><array type="java.lang.Object" length="3" id="7"><array type="double" length="5" id="8">22.33 33.22 33.33 22.0 11.0</array><object type="java.lang.Double" id="9">2.2</object><object type="java.lang.Double" id="10">3.3</object></array></field><field name="retType"><object type="java.lang.String" id="11">act</object></field></object></field></object>
    and I want to change the above string to xml file like below:
    <object type="server.WOXReference" id="0"><field name="actualPathObj"><object type="java.lang.String" id="1">C:\restClient\actualXMLObjects\812856084.xml</object></field><field name="object"><object type="server.WOXConstructor" id="2"><field name="className"><object type="java.lang.String" id="3">rec.SimpleRecognizer</object></field><field name="types"><array type="java.lang.String" length="3" id="4"><object type="java.lang.String" id="5">double[].class</object><object type="java.lang.String" id="6">double.class</object><object idref="6" /></array></field><field name="args"><array type="java.lang.Object" length="3" id="7"><array type="double" length="5" id="8">22.33 33.22 33.33 22.0 11.0</array><object type="java.lang.Double" id="9">2.2</object><object type="java.lang.Double" id="10">3.3</object></array></field><field name="retType"><object type="java.lang.String" id="11">act</object></field></object></field></object>How to I change the above xml String back to xml file again? The appropriate tags must be taken care of like > must be > and < must be <.
    Please advice and can give me some sample code.
    Thanks.

    By writing some code that runs through the file and adds a new line for a new element using these methods here...
    http://java.sun.com/j2se/1.4.2/docs/api/org/xml/sax/ContentHandler.html
    i.e.
    startDocument()
    startElement(String namespaceURI, String localName, String qName, Attributes atts)
    endDocument()

Maybe you are looking for

  • Low screen brightness on Satellite Pro A200 psae1 with XP

    I installed XP Pro with sp2 on this laptop and now when i power up the screen is really dull, so i have to put it into stand by and then turn on again and then the screen is fine. What could cause such a problem? All drivers are latest release. Pleas

  • Macbook Pro waking up

    Hi I have a 6 month old 13 inch MBP and have a question. I just closed my MBP, and the system slept as it usually does. Then my girlfriend (in the same room) said - some time later - hey, you've just signed in on Skype. I had a look at Console and sa

  • Issues after Tiger to SL Upgrade

    About 5 months ago I upgraded from Tiger to SL... although Tiger never gave me any issues I wanted to be on the latest version. I have an older MAC so needed to upgrade via the (expensive) Box Set. I did the change via the "upgrade" and not the compl

  • Dbms error log

    hi i am trying to create error log, but the results are not correct. i am inserting emp records in emp2, i have check constraints salary greater than 5000 in emp2 table SQL> insert into emp2 (id, name, sal) select id, name, sal from emp log errors in

  • Questions re: Bridge CS3

    I am new into using Bridge even though I have it for a while. I am trying to solve these problems: 1. How come some files do not have thumb nail previews, but when I play them in the monitor windows, they play fine. Just no thumb nail preview? 2. Is