Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362684 - SQL - CNTL_1 Open validation error and inconsistent behavior.
Summary: SQL - CNTL_1 Open validation error and inconsistent behavior.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Zhi Zhu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-02 10:54 EDT by Paul Hoffman CLA
Modified: 2017-02-23 14:19 EST (History)
3 users (show)

See Also:


Attachments
Test case. (1.32 KB, application/octet-stream)
2011-11-02 10:54 EDT, Paul Hoffman CLA
no flags Details
library for loading database for test program (5.51 KB, application/octet-stream)
2011-11-02 10:54 EDT, Paul Hoffman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Hoffman CLA 2011-11-02 10:54:13 EDT
Created attachment 206338 [details]
Test case.

1.  CNTL-1 SQL statement for open rs from ds for row gets validation error when SQL statement is saved because "for row" not allowed with "with #sql".

Recommend leaving the for row in as a comment in case developer needs to bebuild statement.

open rs from ds /* for row */ with #sql .....

2.  CNTL-1 SQL statement for open rs behavior is different from the default open behavior.   Default sql statement has no using, where, or order by.

Behavior should be consistent.

I would prefer CNTL-1 behavior (less thinking required to modify), but consistency is most important.

See attached test.   Download both test case and library load program since both are new.

Test results:

Start test for defect:  CNTL-1 open validation error and inconsistent behavior
Default open
Read row 10
Read row 9
Read row 8
Read row 7
Read row 6
Read row 5
Read row 4
Read row 3
Read row 2
Read row 1
CNTL-1 open
Read row 5
Comment 1 Paul Hoffman CLA 2011-11-02 10:54:35 EDT
Created attachment 206339 [details]
library for loading database for test program
Comment 2 Zhi Zhu CLA 2011-11-03 01:35:50 EDT
Paul:
  For consistency, do you mean SQL statements generated by Ctl+1 and generators should be consistent? If so, Joe, which one do you consider is better for current phase, if need modification for Ctr+1 part, I can modify it.

  As for your first question, I have opened a bug for it: bug 362546

   open rs from ds for basicRec using(basicRec.rid) with
            #sql{
                select
                    rid, rtrim(orderItem), price
                from Basic
                where
                    rid =  ?
                order by
                    rid asc
            };


  for the above statement, we cannot delete 'for basicRec' part because using phase is referring it; if we remove for and with clause, then we can only have OPEN statement operated on all table rows, not a subset of it.
Comment 3 Zhi Zhu CLA 2011-11-08 00:55:41 EST
fix the problem raised by Paul.

But does not provide 'Remove SQL statement' for OPEN statement since the For Cluase is removed
Comment 4 Paul Hoffman CLA 2011-11-09 16:23:39 EST
verified and closed