Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

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

  • Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

    Glad to hear it, Araman. Shows the power of open source, too. rd

  • #2
    Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

    ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
    ** This thread discusses the Content article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
    0

    Comment


    • #3
      Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

      ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
      I have been using FROG for the iSeries for the past year and love it. Check it out at http://www.innovativesys.net/. No web server required. No SQL required on your AS/400 and more. It is a GREAT tool and it's free.

      Comment


      • #4
        Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

        ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
        Hi Steven, Great program .... All the best - Jan

        Comment


        • #5
          Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

          ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
          Yes, I have tried Frog, WinSQL and Toad. They are all great products, but I think you still need IBM Client Access (ODBC) to connect. STRCGISQL does not.

          Comment


          • #6
            Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

            ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
            Love it - only issue I cannot resolve - if I have a record with a date value '0001-01-01' - nothing gets returned. Anyone any ideas?

            Comment


            • #7
              Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

              ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
              The problem is that IBM’s SQL can not display dates out of the range of 1940 – 2039. You can see this when you run the same select statement under the STRSQL command and the dates are displayed as “++++++”. The fix involves changing the FixTheNulls subroutine (new subroutine is posted below) to update the 0001-01-01 dates to 1940-01-01. Unfortunately, your output will display 1940-01-01. Good Luck, Steve
              Code

              Comment


              • #8
                Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                By default when I create a directory on the IFS, it is created under the directory structure: /home/PEC1234/MFGPECCGI/HTML. Programs are in library MFGPECCGI. How does this affect the HTTP config. Currently when I run STRCGISQL it displays the prompt screen. When I type a 'select * from F4101' and press Enter, I get 'Page Cannot be Displayed'. The HTTP config: 12 ScriptAlias /cgi-bin/ /QSYS.LIB/MFGPECCGI.LIB/ 13 Alias /html/ /home/PEC1234/MFGPECCGI/html/ Any help would be appreciated.

                Comment


                • #9
                  Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                  ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                  Since you are getting the prompt, the HTTP configuration is probably correct. But, the executing program should return the same URL with the result. Take a look at the URL on the 'Page Cannot be Displayed' browser and see if it matches the initial URL. If not, look at the GetURL function in the program it is not rebuilding your URL correctly. A work around is to hardcode your URL (http://yourserver/cgi-bin/strcgisql.pgm) instead of using the function and recompile. Also, Make sure that the authority to the PSCSPARM file is *PUBLIC *ALL Good Luck.

                  Comment


                  • #10
                    Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                    ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                    Hi Steve I've typed "select * from library/file" It comes out "* * * SQL SYNTAX ERROR * * *" And the "/" comes out as a box character How to settle this? thanks[file name=6b3cfc2b_core.GIF size=24]http://www.mcpressonline.com/images/fbfiles/files/6b3cfc2b_core.GIF[/file]

                    Comment


                    • #11
                      Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                      ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                      Araman wrote: > I've typed "select * from library/file" > It comes out "* * * SQL SYNTAX ERROR * * *" > And the "/" comes out as a box character > How to settle this? Araman, Try using the SQL syntax instead of the System syntax: Select * from library.file Bill

                      Comment


                      • #12
                        Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                        ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                        Hi Bill Thanks for the reply I've tried that also, "SELECT * FROM LIBRARY.FILE" Still => * * * SQL SYNTAX ERROR * * * But this time the "." doesn't get changed to the box character. How? Regards Araman[file name=6b3cfddd_Domino.GIF size=24]http://www.mcpressonline.com/images/fbfiles/files/6b3cfddd_Domino.GIF[/file]

                        Comment


                        • #13
                          Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                          ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                          Hi Araman, Well, RPG-CGI was on my agenda to learn, and this got me started. I downloaded Steven's source to my PC and took a look. Thanks Steven. It appears to me Araman that there is a mismatch somewhere in CCSID, among the interactive job CCSID, compiled program CCSID, and batch job CCSID, where one of them is not 65535 or 037. I'm guessing the interactive job CCSID is set to an international set which has different hex values for special characters than 037. It looks like you can determine the exact hex value being sent in for the slash by doing a DSPPFM on file PSCSPARM and changing to hex mode. The SQL statement as entered is stored in field SQLSTM. I would also make a slight modification to the program and insert into '* * * SQL SYNTAX ERROR ' + %char(SQLCOD) + ' * * *' the character format of SQLCOD. For example, it may be returning 331 Character cannot be converted error, or when you tried dot notation, perhaps a syntax error code. From the SQL manual, it doesn't look like SET OPTION NAMING = *SQL can be done with prepared statements to temporarily try the dot naming. But even then that just gets around one special character. Others would not convert either if the problem is conversion for special characters between different EBCDIC CCSID code sets. At least that should narrow the problem down. rd

                          Comment


                          • #14
                            Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                            ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                            Hi RD Thanks for the reply. I agree. It is something to do with the CCSID. I've experience it before. But never become familiar with it. Yes, you are right!, I've checked the PSCSPARM. The "/" was changed into other invalid character. I've checked the iSeries system value, it is already 65535. Not sure about the other CCSID (compiled, batch). Do I need to do some modification on the STRCGISQL program? (Steve?) Is it possible that the IE or the Windows settings has to do with this? I tried on many PC, still have the same result. (eg: Keyboard) Regards Araman

                            Comment


                            • #15
                              Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL)

                              ** This thread discusses the article: Make DB2 Data Downloads Easy with Start CGI SQL Session (STRCGISQL) **
                              It's an environment situation, Araman, not particular to this program, so any similar exercise will have the same problem with this setup. I ran across this problem several years ago, which in that situation required physical files to be CCSID 037, but it was not acceptable to recompile them. That was before IBM provided for changing CCSID attribute of an object, but they had it planned at the time, and now you can. But looking at the current situation, I did some Googling. The system CCSID value of 65535 is do not convert, so it's sort of agnostic about the whole thing, but under some conditions when a CCSID is determined to be used it defaults to 037, US English EBCDIC. Each job and object has a CCSID. Basically we are dealing with string literals from two environments being converted incorrectly, or more probably, not being converted, before being compared. The slash is not being changed to something wrong, it's not being changed at all. Get the hex value of the slash with DSPPFM and that will allow you to identify or narrow down the CCSID of the characters being presented to the program to process. If a DSPPGM and DSPFD were done on your new objects, I would expect they have the system value of 65535. Normally, I would suggest recompiling the program with CCSID 037, and if that doesn't work, the CCSID of the incoming character set once you determined it from the slash hex value. The physical file CCSID of 65535 of do not convert should be fine in that it just stores whatever bits are given to it. But I also see (thanks Google, you make IBM doc almost usable) that IBM has a page on the HTTP Server for i5/OS. They say: As of V5R4 the IBM HTTP server for iSeries is now compiled in UTF-8 (CCSID 1208). You can leverage this in your CGI programs by compiling and working with UTF-8 data. So perhaps trying a program CCSID 1208 would be better in that it is inline with the web server providing the data. The IBM page on HTTP Server for i5/OS goes on to talk about leveraging *LOCALEUTF and new CCSID conversion API's with a compile parm of LOCALETYPE(*LOCALEUTF), but I'm not sure if applicable here. rd

                              Comment

                              Working...
                              X