LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  DB Execute - Can't Extract Field Called "Comment"

    Employee
    Posted 09-25-2017 09:03

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: peterr

    Hi,

    I have a table that include a field called "Comment". If I use a "Select *" all the columns of the table are returned no problem. If I use "Select Comment" I get the following error message:

    WARN: Output never initialized because metadata was never retrieved from database and therefore output '1' is invalid
    Error Code: brain.node.SqlSelect_ExprStmt.cpp.110

    Extracting all the fields of the table takes 39 min. Extracting just the fields I need takes 3 minutes, so I am keen to find an answer on how to specifically extract this field.

    I have tried using "Comment", 'Comment', [Comment] but no joy .

    Any help on this would be gratefully received!

    Thanks

    Peter


  • 2.  RE: DB Execute - Can't Extract Field Called "Comment"

    Employee
    Posted 09-25-2017 09:10

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    This is most likely a question you'll have to take up with the database vendor.

    1) What type of database is it?
    2) try using the AS keyword just as a test:
    Select Comment as MyText


  • 3.  RE: DB Execute - Can't Extract Field Called "Comment"

    Employee
    Posted 09-25-2017 10:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: peterr

    Hi,

    The "as" doesn't work. It's an Oracle DB.

    Cheers

    Peter


  • 4.  RE: DB Execute - Can't Extract Field Called "Comment"

    Employee
    Posted 09-25-2017 12:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: gmullin

    How about doing this?

    select to_char(Comment) as Comment from TABLENAME


  • 5.  RE: DB Execute - Can't Extract Field Called "Comment"

    Employee
    Posted 09-25-2017 13:27

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: peterr

    Hi,

    Still no joy:

    WARN: Error executing statement: select to_char(Comment) as Comment

    from RAFLATAC_CDW.REEL_EVENT

    where SOURCE_SYSTEM = 'RAFLOW.SC' and TRANS_PERIOD = '201701'. On connection: RAF_LAVASTORM_CDW@DEVDW
    Line: 12; BrainScript: sqlSelect(1,_sqlQuery1)
    Operator: 'sql-select'
    Error Code: brain.node.OdbcSession.cpp.169


  • 6.  RE: DB Execute - Can't Extract Field Called "Comment"

    Employee
    Posted 09-25-2017 13:35

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    One more random thing to try:

    select SUBSTR(Comment, 1, 20) as Comment
    from RAFLATAC_CDW.REEL_EVENT


  • 7.  RE: DB Execute - Can't Extract Field Called "Comment"

    Employee
    Posted 10-21-2017 03:36

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: online

    Works fine for me:
    select to_char(Comment) as Comment from TABLENAME