Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

SETLL for SQL???

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    SETLL for SQL???

    Its kind of like visiting relatives. If you want to visit your first cousins 10 records from where you are, then Fetch Relative 10 will work great. But, if you are trying to visit your long lost aunt on the other side of the database, Fetch Relative 10,000 will be a long and painful experience. Fetch Before and Fetch After, are quick ways to jump to either the beginning or the end of the result set, but unfortunately jumping any where else in the result set requires a painfuly slow search. So go ahead and use Fetch Relative to support Page Up and Page Down, but don't rely on it to perform "position to" type logic.

    Comment


    • #17
      SETLL for SQL???

      solpssi said "DDS indexes are apparently some sort of view" DDS indexes combine an SQL index and an SQL view in one object. You seem very familiar with SQL, but I get the feeling you aren't as familiar with how SETLL and subsequent READs work. Like READ, REDPE, etc. It's much more versatile for certain types of access than SQL. If you don't understand how these work, try looking at the online IBM manuals, or ask questions in here. Just to clarify one point, earlier in this thread I stated that I use SQL almost exclusively. But that comment was in comparison to OPNQRYF. I seldom use SQL by itself. It's almost always SQL embedded in an RPG program.

      Comment


      • #18
        SETLL for SQL???

        I would like to use SQL within an RPG IV green-screen inquiry program, but I am stumped on one point. There does not appear to be an SQL equivalent to RPG's SETLL op code. I would like to be able to open a cursor, as I would open a physical or logial file if I were using native I/O, then be able to position to any point within that cursor, as I would use SETLL. The only thing I can come up with is to close and reopen the cursor every time I need to reposition the subfile, but this seems excessive to me. It also prevents me from reading backward thru the cursor. Any ideas? DB

        Comment


        • #19
          SETLL for SQL???

          Dont get me wrong folks. SQL does have its purposes, its not entirely useless. I use it with store procedures and embed it in RPGLE programs all the time. I just dont process data with it.Is just my preference. I am simply suggesting that If you know RPG, SQL is suddenly not the greatest tool to extract data.If you dont know RPG then SQL is the best thing since slice bread. Its a matter of what background do you have. Its a matter of preference.I have PL/SQL developers and SQL server developers come to me and specifically ask me to take some of their tables and put em on the AS/400 and process the data with RPG. These are windows programmers who are dealing with SQL all day and actually prefer RPG over their native sql. It makes a difference because of performance.Web services perform a lot faster when the datasets are being generated using RPG. They learned that real quick. Now they ask for it by name. These windows guys dont even know what RPG means but they know it comes back awfully quick. That's all what matters to them. I guess the trick is to use the best of both worlds and the toolset that is available to you. I use RPG for data extraction and ASP.NET for Web presentation layer. It just works fine for me. Plus by using RPG I can use existing logic and business rules in our environmnet. Our rule of thumb here is if your web page is taking more than 5 seconds to load come talk to me and I will get it to load in less than 5 seconds, no matter how many records you have in the back.You know how I can do that? eliminate the sql statements entirely. Use Rpg and it will work within 5 seconds. Our users dont react well to "please wait query is running" messages. I use what works for our environment, I dont care much what IBM says or microsoft says. I tend to lean on what works in production environment not what is suggested by people, and folks, let me tell you combination of ASP.NET and RPG backend works wonders for us. For the SQL die hard fans,please I dont mean any disrespect, I wish you best of luck... do let us old RPG guys know when SQL can position a file by key and is capable of doing read equals. I swear I will switch then.

          Comment

          Working...
          X