Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2010
    Posts
    3

    Cool Unanswered: Ora 904 Invalid Identifier

    Hi,

    I am using COBOL program with call to Oracle. I want to convert Seconds to
    HH:MIS and this is the SQL I have in my cobol program.

    Oracle abends with the above errror code during runtime.
    ORA-00904: "SECS": invalid identifier

    SELECT TO_CHAR(TO_DATE(TRIM(SQL-I-TIME-SECS),'SSSSS'),'HH24MISS') FROM DUAL

    SQL-I-TIME-SECS is the input value which is computed before this SQL is called. This variable has a value which is in seconds.

    Tried in Toad/SQL PLus and it works fine. There is something that Oracle does not like when I use it as a variable.

    Your help and suggestions are much appreciated.

    Eg:-
    select to_char(to_date(213,'sssss'),'hh24:mi:ss') from dual

    gives me 00:03:33 ---- 3 mins and 33 seconds

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >SQL-I-TIME-SECS
    Not a valid variable name in Oracle above.
    In the top line are those dash characters or minus signs
    You should use underscore "_" instead.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2010
    Posts
    3
    Ok, The variable SQL-I-TIME-SECS is a bind variable defined in the DECLARE section of the program. It's defined as PIC X(5). It's NOT a column name. It's a computed value
    in seconds.

    Thanks
    Kumar

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Doesn't matter.
    Quote Originally Posted by Anacedent
    You should use underscore "_" instead.

  5. #5
    Join Date
    Apr 2010
    Posts
    3
    Well, I just compiled my COBOL program after changing it to SQL_I_TIME_SECS and I am getting a bunch of compilation errors.

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    As a test I suggest trying below instead

    SQLITIMESECS
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Tags for this Thread

Posting Permissions

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