Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:02:20+00:00 2026-06-17T07:02:20+00:00

I am trying to create an SQL report. This is the select statement: select

  • 0

I am trying to create an SQL report. This is the select statement:

  select
  -- ticket id
  '<tr align=left valign=top><td width=95>'||maspid||'</td>'||

  -- priority
  case when instr(masfld017, '<|lang' ) = 0 then
        '<td width=90>'||masfld017
  else
        '<td width=90>'||substr( masfld017, 1 , instrb(masfld017, '<|lang') - 1)
  end||'</td>'||

  -- customer
  '<td width=150>'||masfld007||'</td>'||

  -- status
    '<td width=100>'||decode(masfld104, '0', 'Collected',
          '1', 'Postponed',
          '2', 'Accepted',
          '3', 'in Progress',
          '5', 'Work Around',
          '7', 'Solved',
          '8', 'Closed')||'</td>'||

  -- subject
  '<td width=400>'||masfld001||'</td>'||

  -- full name
  '<td width=100>' || replace(replace(masfld037, '<||>'), '</||>')||'</td>'||

  -- creation date
  '<td width=150>'||to_char(to_date(masfld022, 'YYYYMMDDHH24MI'), 'DD.MM.YYYY HH24:MM')||'</td>'||

  -- target date
  '<td width=150>'||to_char(to_date(masfld023, 'YYYYMMDDHH24MI'), 'DD.MM.YYYY HH24:MM')||'</td>'||

  -- ticket type
  '<td width=180>'||decode(masfld040, '9', 'HUS',
        '8', 'Project',
        '7', 'Enhancement',
        '6', 'Complaint',
        '5', 'Change Request',
        '4', 'Bug (Do not use)',
        '3', 'Support',
        '2', 'Service Request',
        '1', 'Incident (Problem)',
        null, 'N/A')||'</td></tr>'
from
        k2h.tmaster01 tm inner join k2h.tprofile tp on replace(replace(tm.masfld035, '<||>'), '</||>') = tp.propid
where
        masfld024 is null and
        masfld082 = '&REGION' 

order by case masfld017
        when 'Emergency'         then 1 
        when 'Critical'          then 2
        when 'High'              then 3
        when 'Major Problem'     then 4
        when 'Major defect'      then 5
        when 'Semi-major defect' then 6
        when 'Medium'            then 7
        when 'Minor Problem'     then 8
        when 'Low'               then 9
        end;

If I run it directly with sqldeveloper, I get a result list. If the report is started by crontab, it fails with this error message:

SP2-0734: unknown command beginning "case when ..." - rest of line ignored. SP2-0734: unknown command beginning "'

Seems like the case command is not recognized, but why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:02:21+00:00Added an answer on June 17, 2026 at 7:02 am

    is it possible , in crontab, that you’re running the SQL direct in the shell
    eg

    sqlplus...<<ESQL
    select..
    ...
    order by case end;
    

    ?
    if so please remove the BLANK lines.

    otherwise you will get something like:

    SQL> select
      2    -- ticket id
      3    '<tr align=left valign=top><td width=95>'||maspid||'</td>'||
      4
    SQL>   -- priority
    SQL>   case when instr(masfld017, '<|lang' ) = 0 then
    SP2-0734: unknown command beginning "case when ..." - rest of line ignored.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an SQL statement that joins two tables and returns a
I am trying to create a report in crystal reports 11 based on this
I'm trying to create a Microsoft SQL Report in Visual Studio 2012. My data
I'm trying to create a SQL statement which will recreate the hierarchical container/folder/test structure
I'm trying to create a report that allows the user to select not only
i am trying to create sql procedure or function that need to find duplicate
I am trying to create an add-in by using the article below http://blogs.microsoft.co.il/blogs/shair/archive/2008/07/28/how-to-create-sql-server-management-studio-addin.aspx I
I'm trying to create an SQL script to automatize inserting of values into a
I'm trying to create an SQL query in PHP to update a table. Is
I'm trying to create an sql table called 'cartable'. I'm currently using phpmyadmin via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.