Assign string into variable

Hi All!
I''ve created global and lоcal variable with type - string
How can I assign the value into variable in BR?
I tried [Var_1] = "qwe"; or [Var_1] = @CONCATENATE (String_1, String_2) it doesn't work
Regards
Sasha

You should be able to take global/local variables from HBR into the code and use concatenate within the HBR.
Something like
@CONCATENATE([varName1], [varName2]) shouldn't be a problem, so long as the values are good.
Regards,
Cameron Lackpour

Similar Messages

  • Concatinating Strings into Variable Names

    Hi
    I'm not sure if this is even possible but here goes.
    Is there anyway of concatinating (sp? Join together!) two strings and then use the new string as a variable name.
    The reason I ask is that, depending upon what character I read into my program I will want to modify an array of data associated with that character.
    For example if the character read in was @ I would want to modify the array data@. So my question is, is it possible to read in a character such as @, join it with the string "data" and then use the resulting string as a variable name?
    Apologies if this has a simple solution but I'm struggling to come up with it by myself.
    Many thanks.

    Hey
    Thanks for the advice. The problem is that I'm storing the arrays in a hash map already. This is because each character has more than one piece of data associated with it , and as far as I can tell each key entry in a hash table has one and only one piece of data associated with it. But if there is a way of storing multiple pieces of information with a particular key, then that could be a possible solution....
    Any suggestions?

  • Process variable string into filename at Save service

    Hello,
    Does anyone know how to put a string into the Pathname Pattern (Template) property of a Save service (FileUtilsService - Write Document) ?
    What I'm trying to do is strip the /'s out of a date string and put that date into a filename. For example, 042208_Greg.pdf
    Instead I get d:\WMS\C0419\04\22\08\_Greg.pdf
    I want: d:\WMS\C0419\042208_Greg.pdf
    I have a Set Value service putting a form submit date (MM/DD/YY format) into a process variable called @stringDate. I am stripping /'s out of the date and setting @stringDate like so: /process_data/@stringDate <--- concat(substring(/process_data/xfaform/object/data/xdp/datasets/data/C0419/Approvers/Init iator/Date,1,2),substring(/process_data/xfaform/object/data/xdp/datasets/data/C0419/Approv ers/Initiator/Date,4,5),substring(/process_data/xfaform/object/data/xdp/datasets/data/C041 9/Approvers/Initiator/Date,7,8))
    At the Save file service, I am using @stringDate in my Pathname Pattern (Template) to create the filename: d:\WMS\C0419\{/process_data/@stringDate}_{$/process_data/xfaform/object/data/xdp/datasets /data/C0419/Approvers/Initiator/CompletedBy/Name$}.pdf
    Thanks,
    Greg
    Needham, MA

    Hi Greg
    You've done a great job getting this done with xpath.
    It looks to me like you've done everything right - what's not working - are you getting an exception, or is the file being saved with the wrong name?
    There is a nice little DateFormatter component here, that might make things a little easier/flexible.
    http://avoka.dnsalias.com/confluence/display/Public/Formatter+DSC
    Howard

  • How to add space before a string a variable.

    Hi,
    If i have a string variable  ' 80 '.I want it as '    80 ' ie some space appended before it.
    I used  concatenate '   '    variable into variable..Its not working.How to do it??
    Thanks.

    check below code
    Concatenate ' ' string into string respecting blanks.
    <b>
    ... RESPECTING BLANKS</b>
    Effect
    The addition RESPECTING BLANKS is only allowed during string processing and causes the closing spaces for data objects dobj1 dobj2 ... or rows in the internal table itab to be taken into account. Without the addon, this is only the case with string.
    Note
    With addition RESPECTING BLANKS, statement CONCATENATE can be used in order to assign any character strings EX>text - taking into account the closing empty character - to target str of type string: CLEAR str. CONCATENATE str text INTO str RESPECTING BLANKS.
    Example
    After the first CONCATENATE statement, result contains "When_the_music_is_over", after the second statement it contains "When______the_______music_____is________ over______" . The underscores here represent blank characters.
    TYPES text   TYPE c LENGTH 10.
    DATA  itab   TYPE TABLE OF text.
    DATA  result TYPE string.
    APPEND 'When'  TO itab.
    APPEND 'the'   TO itab.
    APPEND 'music' TO itab.
    APPEND 'is'    TO itab.
    APPEND 'over'  TO itab.
    CONCATENATE LINES OF itab INTO result SEPARATED BY space.
    CONCATENATE LINES OF itab INTO result RESPECTING BLANKS.
    Rewards if useful.........
    Minal

  • Convert string into XML inside BPEL

    Hello ,
    How to convert string into xml format ? And make element and define attribute inside it ??

    There are several problems with your input:
    1. Your xml is not well-formed because the attribute values should be enclosed withing double " quotes and not single ' quotes;
    2. You use a prefix (sml) for the folowing part but you dont define the namespace:
    <ids>
    <VID ID="new"/>
    <data>
    <*sml:*attr name="std">
    <sml:value></sml:value>
    </sml:attr>
    <sml:attr name="xde">
    <sml:value></sml:value>
    </sml:attr>
    </data>
    </ids>
    Complete message should be:
    <ids xmlns:sml="somenamespace">
    <VID ID="new"/>
    <data>
    <sml:attr name="std">
    <sml:value></sml:value>
    </sml:attr>
    <sml:attr name="xde">
    <sml:value></sml:value>
    </sml:attr>
    </data>
    </ids>
    3. Do you assign this expression to a variable that is based on the schema of your message you want to parse
    Regards,
    Melvin
    * TIP Answer the question as helpful or correct if it helps you , so that someone else will be knowing that this solution helped you or worked for you and also it gives points to the person who answers the question. *

  • Read a file content into Variable

    Hi There,
    I've a file in Unix and the content of it need to be assigned to an ODI variable. How can I do it?
    Regards.
    -Bhavani

    Step 1. ODI procedure .
    Command on Target - Java bean shell.
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    BufferedReader br = new BufferedReader(new FileReader("C:\\test.txt" ));
    String strLine = br.readLine();Step 2
    Create variable and add
    SELECT '<@=strLine@>' from dual This particular code will read only first line and pass into variable.

  • Inputing into variables.

    I'm a C++ programmer, but my teacher wants me to program a herkle game in Java. I could easily do it in C++, and I know that the two languages are similar, but I dont know alot of the keywords, like in C++, you'd use cout <<. In java, you'd use system.out.println(". What i'm trying to get to is I need to learn how to input into variables. Like let the user assign a value to a variable or string. Thaks for any help

    Gui = Graphical User Interface; Command Line = DOS
    also, just use this file, save it as PrimitiveInput.java and compile it with the javac tool that comes with the Java Development Kit:
    import java.io.*;
    * This class provides a collection of basic methods to perform
    * primitive type console input.
    public class PrimitiveInput
    static BufferedReader in = new BufferedReader(
    new InputStreamReader(System.in));
    * read the next line from the keyboard as a String
    * @return the line as a String
    * @throws IOException
    public static String readString() throws IOException
    return in.readLine() ;
    * read the first character on the line
    * @return the first character on the line
    * @throws IOException
    public static char readCharacter() throws IOException
    String s = in.readLine();
    if (s.length() == 0)
    return '\0';
    else
    return s.charAt(0);
    * read the next line as an integer
    * @return the line as an integer
    * @throws IOException
    public static int readInteger() throws IOException
    try
    String line = in.readLine();
    int i = Integer.valueOf(line.trim()).intValue();
    return i;
    catch (Exception e)
    throw new IOException("invalid integer format");
    * read the next line as a float
    * @return the line as a float
    * @throws IOException
    public static float readFloat() throws IOException
    try
    String line = in.readLine();
    return Float.valueOf(line.trim()).floatValue();
    catch (Exception e)
    throw new IOException("invalid float format");
    * read the next line as a double
    * @return the line as a double
    * @throws IOException
    public static double readDouble() throws IOException
    try
    String line = in.readLine();
    return Double.valueOf(line.trim()).doubleValue();
    catch (Exception e)
    throw new IOException("invalid double format");
    } // End PrimitiveInput.java

  • How can i assign a Javascript variable to JSP variable

    Hi guys
    how i can assign a javascript variable to jsp expression.,
    e.g.,
    <input type = "button" value = "Add more" onclick = "return submitform1('<%=s%>')">
    function submitform1(String s)
          var s1 = s
    document.form1.action = "../intimation.do";    /* Here i want to pass the value s1 to jsp or servlets without using hidden fields and Query string*/
           document.form1.submit();
          return false;
    /*  i want to pass the values thru session whether it is possible */
    pls give sample code
    Reply
    Marimuthu

    You don't have the session.
    All you have is HTTP.
    The only way to communicate from the client to the server is via an HTTP request. The only way to send a value like that is with a parameter.
    Using a form with method="submit" as mentioned will pass the parameters without displaying them in the url bar (is that what you wanted?)

  • Passing a string into an SQL query IN statement

    Hello,
    I need to connect to a database to pull some data to dynamically create a form based on the data I pull back. My SQL query works fine when I manually run it through a SQL client tool, but when I try to pass it through my workflow I'm having trouble with passing my string into the IN part of the statement. So if for example my SQL query is:
    SELECT Field1, Field2, Field3 FROM Table1 WHERE Field4 IN (?)
    I have a process variable that has the string I'm trying to pass into the ?, but I don't seem to be able to get the query to run. I have tried setting up my query to run as a Parameterized Query (passing my string process variable into the ?), and by setting the query up through xPath (where I am calling my process variable with an xPath declaration), but am not having any luck.
    The process variable I am trying to pass is formatted such that I'm passing 'Value1','Value2','Value3' but I can reformat this string if need be. Even with using test data I can't get the query to return anything. For test data I have tried: 'Value1','Value2','Value3' ; Value1','Value2','Value3 ; Value1,Value2,Value3 but the query never returns any data. I can't seem to see how to format the string to pass into the query. The Query will work with a single Value in the test data, but as soon as I try to pass multiple values within the string it fails. Any suggestions?

    The problem looks to be a limit on what I can pass into the SQL query component. My string is coming from data returned from another database. I take the xml output from that database call, pass it through a set variable component to remove my xml tags from the string, and then format the string in a script component (I have to do it this way because of the way the data coming out of my first database call). I've put in loggers, and can see that the string I'm passing into my query that is giving me problems, is formatted the same way as if I were to use the concat function Scott listed above. It looks like there is a limitation on what can be passed in my variable. I have tried creating my entire SQL query statement in a set variable component, and then just calling the process variable that holds that statement, but there is a character limit of 128 character for what can be passed in a variable through xpath in the SQL query component.
    The next thing I tried was changing my SQL where clause. Instead of passing my variable directly into the IN statement I set up a PATINDEX('%:'+countyname+ ':%', ?) > 0 call to check for the values in my database call. As you can see I took out the "," that I was passing as part of my string, thinking that the SQL component was getting confused by them, and placed ":" characters around my values being passed in my string variable. No matter what I try to do though I'm not able to get the query to run. The component looks like it is taking my string, and is seeing the whole thing as a string instead of passing it as individual values within a string.
    I think I'm getting close, but I keep getting a Content not allowed in prolog exception in the server logs.

  • How to Parse a string into an XML DOM ?

    Hi,
    I want to parse a String into an XML DOM. Not able to locate any parser which supports that. Any pointers to this?

    Download Xerces from xml.apache.org. Place the relevant JAR's on your classpath. Here is sample code to get a DOM document reference.
    - Saish
    public final class DomParser extends Object {
         // Class Variables //
         private static final DocumentBuilder builder;
         private static final String JAXP_SCHEMA_LANGUAGE =
             "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
         /** W3C schema definitions */
         private static final String W3C_XML_SCHEMA =
             "http://www.w3.org/2001/XMLSchema";
         // Constructors //
         static {
              try {
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setNamespaceAware(true);
                   factory.setValidating(true);
                   factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
                   builder = factory.newDocumentBuilder();
                   builder.setErrorHandler(new ErrorHandler() {
                       public void warning(SAXParseException e) throws SAXException {
                           System.err.println("[warning] "+e.getMessage());
                       public void error(SAXParseException e) throws SAXException {
                           System.err.println("[error] "+e.getMessage());
                       public void fatalError(SAXParseException e) throws SAXException {
                           System.err.println("[fatal error] "+e.getMessage());
                           throw new XmlParsingError("Fatal validation error", e);
              catch (ParserConfigurationException fatal) {
                   throw new ConfigurationError("Unable to create XML DOM document parser", fatal);
              catch (FactoryConfigurationError fatal) {
                   throw new ConfigurationError("Unable to create XML DOM document factory", fatal);
         private DomParser() {
              super();
         // Public Methods //
         public static final Document newDocument() {
              return builder.newDocument();
         public static final Document parseDocument(final InputStream in) {
              try {
                   return builder.parse(in);
              catch (SAXException e) {
                   throw new XmlParsingError("SAX exception during parsing.  Document is not well-formed or contains " +
                        "illegal characters", e);
              catch (IOException e) {
                   throw new XmlParsingError("Encountered I/O exception during parsing", e);
    }- Saish

  • How to assign a Substitution variable dynamically?

    Hi All,
    I was trying to assign a substitution variable which should get data from the time period and should directly load into the substitution variable automatically.
    The process should be automated. so as to refrsh the substitution variable daily.
    Any comments are highly appreciated
    With Regrads
    Prads

    Sorry for the double-post, I didn't quite get that you wanted to read the Time Period dimension.
    Is that what you are trying to do? Get a list of the periods (usually these are pretty well known) and then find the latest one for a given member combination that has data and then set a substitution variable off of that?
    You can run reports (or DATAEXPORT calc command) to get data from MaxL.
    Or are you trying to do something else?
    Regards,
    Cameron Lackpour

  • How can I convert a String into boolean?

    I am facing difficulty in converting String into boolean.
    For example, I have a few variable which i need user to input yes or no as the answer. But I uses string instead. Is there a way which i can ask them to input boolean directly?
    Please advise...
    credit = JOptionPane.showInputDialog("Enter Yes or No for Credit Satisfactory : ");
    System.out.println("The answer for Credit Satisfactory : "+credit);
    e_invtry=JOptionPane.showInputDialog("Enter Yes or No for inventry level");
    System.out.println("The answer for Quantity Order : "+e_invtry);
    Message was edited by:
    SummerCool

    Thanks...but I don't get it....I tried to use your
    suggestion but i got the message that " cannot find
    symbol method
    showConfirmDialog(java.lang.String,int)" ???
    Please advise.
    The code I use was :
    int credit = JOptionPane.showConfirmDialog("Enter Yes
    or No for credit satisfactory",
    JOptionPane.YES_NO_OPTION);Well that was not the example I gave you.
    JOptionPane has no method showConfirmDialog that receives a String and an int (exactly what the error message is telling you).
    What was wrong with the version I showed you?

  • String into date format

    Hi
    I was wondering if anyone knew how to convert a string into different formats,
    to enable it to be stored in a mysql db.
    I was wondering anyone you knew how to convert:
    - String into the date format yyyy-mm--dd
    - String into time format 00:00:00
    - string to double
    Ive tried:
    c_date = java.sql.Date.valueOf(f_date);
    System.out.println("conversion data: " +c_date);
    c_time = java.sql.Time.valueOf(f_time);
    System.out.println(" time converted data: "+c_time);
    // string to double conversion
    c_change = java.lang.Double.valueOf(f_change);
    System.out.println(c_change);
    My class doesnt execute this at all?
    Also,
    SimpleDateFormat sdft = new SimpleDateFormat("yyyy-MM-dd");
    c_date = sdft.format(f_date);
    System.out.println(c_date);
    .. but this method returns the error incompatible types?
    Any suggestions would be helpful.. thanks in advance..

    Friends i've got similar kind of problem...can you help me
    here is my code. When i try to print the user entered date (dd/MM/yyyy)(which i am storing in a string) the program dispalys nothing. and everey time i enter a valid date it displas "invalid From date entered ". I need to store the user entered date into a string because i need that for further use. All my intesion is to get two dates from user in dd/MM/yyyy. Strore them in certain variable. Check if they are valid or not. and make sure todate is either equal or greater than fromdate. Please help me to solve this problem.
    public class EDTDateValidation extends JFrame implements ActionListener{
    private JLabel fromlabel;
    private JLabel tolabel;
    private JTextField fromtxt;
    private JTextField totxt;
    private String fmt ="dd/MM/yyyy";
    private java.lang.String fromdate;
    private java.lang.String todate;
    private JButton buttonOK;
    private JButton buttonCancel;
    private Date theDate;
    private Date date1;
    private Date date2;
    private JPanel mainPanel;
    SimpleDateFormat dtformat = new SimpleDateFormat(fmt);
    public EDTDateValidation(){
    super("Date Validation");
    dtformat.setLenient(false);
    mainPanel=new JPanel();
    mainPanel.setLayout(null);
    fromlabel = new JLabel("From Date");
    tolabel = new JLabel("To Date");
    buttonOK = new JButton("OK");
    buttonCancel = new JButton("Cancel");
    fromdate = new String();
    todate = new String();
    fromtxt = new JTextField(10);
    totxt = new JTextField(10);
    fromdate = fromtxt.getText();
    todate = totxt.getText();
    mainPanel.add(fromlabel);
    fromlabel.setBounds(20,20,50,15);
    mainPanel.add(tolabel);
    tolabel.setBounds(20,50,50,15);
    mainPanel.add(fromtxt);
    fromtxt.setBounds(90,20,130,20);
    mainPanel.add(totxt);
    totxt. setBounds(90,50,130,20);
    mainPanel.add(buttonOK);
    buttonOK.setBounds(70,80,71,23);
    mainPanel.add(buttonCancel);
    buttonCancel.setBounds(150,80,71,23);
    buttonOK.addActionListener(this);
    buttonCancel.addActionListener(this);
    setContentPane(mainPanel);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setSize(247,140);
    setResizable(false);
    //pack();
    public static void main(String args[]) {
    try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    catch(Exception e) {
    System.err.println("Could not load Look and Feel" + e);
    EDTDateValidation edtDateVal = new EDTDateValidation();
    edtDateVal.setVisible(true);
    public void actionPerformed(ActionEvent e) {
    if(e.getSource() == buttonOK){
    System.out.println(fromtxt.getText());
    System.out.println(fromdate); //THIS PRINTS BLANK
    System.out.println(todate); //THIS ASWELL
    try {
    Date date = null;
    date = dtformat.parse(fromdate);
    System.out.println("valid From date entered!");
    catch(Exception f) {
    System.out.println("Invalid From date entered!");
    // textField1.setText("");
    return;
    try {
    Date date = null;
    date = dtformat.parse(todate);
    System.out.println("valid TO date entered!");
    catch(Exception f) {
    System.out.println("Invalid To date entered!");
    // textField1.setText("");
    return;
    }

  • Error in assigning string literal.......

    Hi,
    Below is a normal stub that i am executing
    DECLARE
    PI_PACKAGE_CLOB CLOB;
    BEGIN
      PI_PACKAGE_CLOB := '<ROWSET><ROW><SITE_NO Key="Yes">1</SITE_NO><PACKAGE_NO Key="Yes">832</PACKAGE_NO><PARENT_PACKAGE_NO>0</PARENT_PACKAGE_NO><NAME>Testing - 1</NAME><USER_ID Key="Yes">A427907</USER_ID><PACKAGE_TYPE_NO>47</PACKAGE_TYPE_NO><PACKAGE_UI_TYPE_NO>2</PACKAGE_UI_TYPE_NO><STATUS>PRIVATE</STATUS><CONTENT_HEADER><HEAD><LINK </TABLE_CONTENT><DEFAULT_PACKAGE>1</DEFAULT_PACKAGE><LAYOUT_TYPE>CELL</LAYOUT_TYPE><CREATED_ON>2007-11-29T01:08:18</CREATED_ON><MODIFIED_ON>2007-11-29T02:06:14</MODIFIED_ON></ROW></ROWSET>'; 
    PKS_PACKAGE.PRC_UPDATE_PACKAGE ( PI_PACKAGE_CLOB );
    COMMIT;
    END; In the above shown procedure i am running it through TOAD as shown above.
    But it says string literal too long... The size of the PI_PACKAGE_CLOB is more than 32767............Is there any way that i can assign data to variable which are more than the size 32767...
    Help needed plz................
    Thanks,
    The database version is 10.2
    Message was edited by:
    SHILPFID
    Message was edited by:
    SHILPFID

    a) Turn off your CAPS LOCK as it's considered rude to shout.
    b) format your code using [code][/code] or [pre][/pre] tags so that people can actually read it.
    I assume this relates to your other query: I am struggling...........plzzzzz help
    You can assign data larger than 32767 bytes by using CLOBs, so what exactly is the problem?

  • How to Store Encrypted String into OracleDatabase Column(vacrchar2)

    Hi..
    I encountered an error while inserting a Encryted String into oracle column.. Error "Quoted String Doesn't terminated properly"
    But i wrote Query string correctly and using Datatypes as String and vacharchar2(2000) in java and oracle respectively..
    what i need to do?

    Hi,
    if your code compose the sql programmatically without bind variables i.e.:
    String sqlInsert="insert into table A(encrypted_column) values ('" + encryptedValue+ ')");
    then if the string encryptedValue contains a ' character you end up with a wrong sql statement
    if you encryped values is something like AAABB#??£££'AAA the corresponding sql is
    insert into table A(encrypted_column) values ('AAABB#??£££'AAA')
    which is not correct becaus of the ' in the middle of the string.
    Giovanni

Maybe you are looking for