Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2012
    Posts
    1

    Unanswered: meaning of {0} in update query?

    Hi
    I am new to DB2.
    Please could you help me to understand what it means:

    --- In an xml file, first there is a select clause

    < aa text = " select abc, def from xyz" />

    ---- then following this statement there is an update statement which says :

    < updateaa text = " update pqr
    set abc = {0}
    where def = {1}
    " />

    Please could you advise if it means , first column from first query?

    Best Regards
    Sujata Singh.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'm hazarding a gues here, but my first thought is that this is text that will be pre-processed into executable code by an application. The application will read the XML file to obtain some text based on a tag provided by the application, then the app will pre-process the text according to how the app was written. The app may also read connection information from the XML file too. The app will then connect to the server, execute the processed text, and may or may not report the results of the execution.

    If you know what the application is or if you at least know its processing rules, you can infer a lot more about what can or might happen. Right now, you really can't tell.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jan 2012
    Posts
    20
    The update statement will be processed with an array containing values to bind the variables. So variable {0} will be bound with array[0], {1} with array[1] etc. See your XML parser documentation for more info of how to do this.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by cauliflower View Post
    The update statement will be processed with an array containing values to bind the variables. So variable {0} will be bound with array[0], {1} with array[1] etc. See your XML parser documentation for more info of how to do this.
    Just curious, but what made you assume an array as opposed to another XML file that contains lvalue and rvalue pairs?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Jan 2012
    Posts
    20
    The values can come from any source, such as an array or another XML file. What's important is the concept of variable binding.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •