ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RUNSQL in CLP REQUEST too long

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

  • RUNSQL in CLP REQUEST too long

    I'm trying to run some SQL commands from within a CLP using RUNSQL REQUEST('.....'), but am running into a problem that this method seems to allow a maximum of 550 characters in a REQUEST call. Does anyone have any suggestions on other ways I might be able to do this where the length of the query won't matter?

  • #2
    Re: RUNSQL in CLP REQUEST too long

    You could try using RUNSQLSTM instead to run your statements from a source file.

    By the way, maybe you know this but the RUNSQL command that has keywork REQUEST is actually not an IBM command. It came out a long time ago to fill that need and has worked well for people. However, be aware that IBM has now come out with its own RUNSQL command that will conflict with your RUNSQL command as soon as you get to a certain PTF level in i6.1 or i7.1. You can read about this issue here: http://www.itjungle.com/fhg/fhg053012-story01.html

    Comment


    • #3
      Re: RUNSQL in CLP REQUEST too long

      And by the way, IBM's RUNSQL command allows SQL statements up to 5000 characters. You can read about it here: http://publib.boulder.ibm.com/infoce...bafyrunsql.htm

      Comment


      • #4
        Re: RUNSQL in CLP REQUEST too long

        I was able to get around this size limitation by putting the queries that were too long in a different SQLRPGLE program and calling that from the CL.

        Comment


        • #5
          Re: RUNSQL in CLP REQUEST too long

          Thanks for the info, I was not aware of those things. I'm basing this off some older code I found at the company I work at. But since I already got it to work by calling it through an RPG program, I'll probably just leave it at that. This was just a one off thing to help out with running a bunch of SQL for an install instead of having someone with command line access do it. But I will definitely keep that in mind in the future.

          Comment


          • #6
            Re: RUNSQL in CLP REQUEST too long

            RUNSQL will work on statements longer than 550 however the max parameter display size on a prompted command is the limitation...just an FYI
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: RUNSQL in CLP REQUEST too long

              I'm am confused. You have a SQLRPGLE and you call a CL to issue a RUNSQL? Why? Me thinks that SQLRPGLE can run SQL. No?
              Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

              Comment


              • #8
                Re: RUNSQL in CLP REQUEST too long

                Originally posted by DeadManWalks View Post
                I'm am confused. You have a SQLRPGLE and you call a CL to issue a RUNSQL? Why? Me thinks that SQLRPGLE can run SQL. No?
                yep you're confused lol. Warren said he wrote SQLRPGLE to execute the queries that were too long for RUNSQL. RUNSQL was his original method...a little too early & not enough caffeine yet i suppose
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment


                • #9
                  Re: RUNSQL in CLP REQUEST too long

                  Happy Friday and always remember:
                  "CL is a language for small children & farm animals"
                  Even with subroutines!
                  All my answers were extracted from the "Big Dummy's Guide to the As400"
                  and I take no responsibility for any of them.

                  www.code400.com

                  Comment


                  • #10
                    Re: RUNSQL in CLP REQUEST too long

                    I have tested that theory, and although I was able to teach my kids CL, the farm animals never quite got the hang of it...

                    Comment


                    • #11
                      Re: RUNSQL in CLP REQUEST too long

                      Get better Livestock
                      All my answers were extracted from the "Big Dummy's Guide to the As400"
                      and I take no responsibility for any of them.

                      www.code400.com

                      Comment


                      • #12
                        Re: RUNSQL in CLP REQUEST too long

                        Originally posted by jamief View Post
                        Happy Friday and always remember:
                        "CL is a language for small children & farm animals"
                        Even with subroutines!



                        That's why we still don't have native GUI on this platform; IBM blew the development budget when they added subroutine capabilities to CL.
                        Michael Catalani
                        IS Director, eCommerce & Web Development
                        Acceptance Insurance Corporation
                        www.AcceptanceInsurance.com
                        www.ProvatoSys.com

                        Comment

                        Working...
                        X