×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Do multiple "case" lines run against each line or is each run against the table ?

Do multiple "case" lines run against each line or is each run against the table ?

Do multiple "case" lines run against each line or is each run against the table ?

(OP)
I have informix 9.40.FC7. I have a 31 million line table that I extract information from. It takes up to 7 days now to finish. I don't know if it runs the 4 "case" lines against each row or if it is running 1 "case" against the 31 million rows and then moves to the next "case". Any ideas? I'd appreciate any assistance! Thanks!

CODE --> english

set isolation to dirty read;

select f.patkey,f.invno,f.orderno,f.dx_orderno
from findiag f
into temp temp1 with no log;

select t.patkey,t.invno,
    case
      when t.orderno = 1 then p.dxcode else " " end diag1,
    case
      when t.orderno = 2 then p.dxcode else " " end diag2,
    case
      when t.orderno = 3 then p.dxcode else " " end diag3,
    case
      when t.orderno = 4 then p.dxcode else " " end diag4
from temp1 t,patdiag p
where t.patkey = p.patkey
  and t.dx_orderno = p.order_no
  and p.active = 'Y'
into temp temp2 with no log;

unload to 'trandiag1.txt'
select * from temp2;    

unload to 'trandiag.txt'
select t.patkey,t.invno,MAX(diag1) as d1,
        MAX(diag2) as d2,
        MAX(diag3) as d3,
        MAX(diag4) as d4
from temp2 t
group by 1,2; 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close