Informix Order by in Stored Procedure Update Cursor

Posted on 2004-11-11
Last Modified: 2012-06-21
   Does anyone know if I can order rows that are placed in an update cursor from a select statement.  My code is
in a stored procedure. Example is below.

FOREACH upd_curs FOR SELECT column1,column2 INTO var1,var2 FROM myTable Order by 1;

Question by:Arundel_Castle
    LVL 4

    Accepted Solution

    Yes, you should be able to:
          FOREACH SELECT c1 INTO i FROM tab order by 1
                INSERT INTO tab2 VALUES (i);
          END FOREACH
    LVL 3

    Author Comment

    Sorry I took so long. Thanks for the answer.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
    This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now