Control Scripts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    Control Scripts

    I've been struggling on how to get an SQL statement into a variable and
    use that variable in another statement. IE. in MS SQL, I can do
    something like this:

    Select @Thisvar = table.column from othertable.colu mn
    where otherColumn = someuniquerow

    Select othertable.colu mn from othertable2.col umn
    where anotherColumn = @Thisvar

    How do I do this in DB2? Please help point me in the right direction (or
    mdoc). Either I've read it and misinterpreted the results or looking in
    all the wrong places. I'm running iSeries V5.r2.

    Thanks

    Chris
Working...