Informix

 View Only
Expand all | Collapse all

utils2_ak question

  • 1.  utils2_ak question

    Posted Fri March 20, 2020 09:42 AM

    I recently downloaded the utils2_ak package and was trying to build it, but I hit an error.  When compiling dbscript.ec, I got the following:

    esqlc: "dbscript.ec", line 454: Error -33051: Syntax error on identifier or symbol 'SIBLINGS'.
    1 error(s) found


    Looking in the source file at line 454:

    EXEC SQL INSERT INTO hierarchy1
    SELECT ctabid, ptabid, tabtype, LEVEL as hlevel
    FROM hierarchy
    START WITH ptabid IS NULL
    CONNECT BY PRIOR ctabid = ptabid
    ORDER SIBLINGS BY ctabid;
    if (sqlca.sqlcode != 0) {
    fprintf( stderr,
    "Error organizing hierarchy map! Error: %d.\n",
    sqlca.sqlcode );
    exit(1);
    }


    So it's the ORDER SIBLINGS BY that is causing the problem.  

    We're running 11.50.FC6 on HP-UX 11.31 (PA-RISC).  Our CSDK is 3.50.FC6.  According to the online docs, the ORDER SIBLINGS BY was added in 11.50.FC5, so everything should be good, but ...  Actually, I tried this in Server Studio and it worked.  I tried it in dbaccess and it worked.  It's just when I try to compile that it doesn't work.

    Any thoughts on where to look?  Or how to work around this?  Can I just comment out the ORDER SIBLINGS BY and compile?  FWIW, we have very few constraints in our databases, and this section of logic appears to deal primarily with constraints.



    ------------------------------
    Mark Collins
    ------------------------------

    #Informix


  • 2.  RE: utils2_ak question

    IBM Champion
    Posted Fri March 20, 2020 09:54 AM

    Mark:

    The problem is likely in the CSDK you are using. Yes, the CSDK v3.50.FC6 should support the SIBLINGS clause, either it really doesn't, or perhaps your compile is actually seeing an older install? What does:

    esql -V

    return versus:

    INFORMIXDIR/lib/esql/esqlc -V

    Should be the same. Also look at:

    which esql

    to make sure that you are executing the version you think you are.



    ------------------------------
    Art Kagel
    ------------------------------



  • 3.  RE: utils2_ak question

    Posted Fri March 20, 2020 10:33 AM
    Art,

    I get the following results:

    > esql -V
    IBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC6


    > $INFORMIXDIR/lib/esql/esqlc -V
    IBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC6


    > which esql
    /informix/IDS11.50.fc6/bin/esql




    ------------------------------
    Mark Collins
    ------------------------------



  • 4.  RE: utils2_ak question

    IBM Champion
    Posted Fri March 20, 2020 12:44 PM
    Then it looks like the CSDK wasn't updated to recognize the clause until later. I have modified the code to use a PREPARED statement which should work for you. Sending directly to your email. Let me know how that goes and I will update utils2_ak with that version for others.

    Art

    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.








  • 5.  RE: utils2_ak question

    Posted Fri March 20, 2020 01:00 PM

    Art,


    Thank you very much!  I was going to try implementing Paul's suggestion of using the PREPARE sometime this afternoon, but you have saved me the trouble.  I was able to compile it successfully.

     

     

     

    Mark



    ------------------------------
    Mark Collins
    ------------------------------



  • 6.  RE: utils2_ak question

    IBM Champion
    Posted Fri March 20, 2020 01:28 PM
    Great! I will update the utils2_ak package with this source version and upload it to my web site so this works for everyone that can compile it. Maybe I'll put a bit of time into making the -D code conditional on the ESQL version as well.

    Art

    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.








  • 7.  RE: utils2_ak question

    Posted Wed March 25, 2020 10:40 AM
    Follow-up questions, as I move through the other utilities.  When I tried to make the dbcopy utility, I got a warning that I'm not sure whether it's important or not:


    > gmake dbcopy -f Makefile.SMI

    INFORMIXC=cc                        esql  -O -Ae +DD64    -DHAVE_GNU_GETOPT=1 -DHAVE_GETOPT_H=1   -o dbcopy dbcopy.ec -Wno-implicit-function-declaration

    cc: warning 422: Unknown option "-Wno-implicit-function-declaration" ignored.


    I looked through the man page for cc, and it seems that the '-W' option is supposed to be in the form '-Wx,arg_list', where 'arg_list' is a comma-separated list of arguments that are to be passed to a specific subprocess, and 'x' identifies the subprocess.  Valid values of 'x' are:

    d - driver
    p - preprocessor
    c - compiler
    a - assembler
    l - linker


    I modified the makefile to try each of these in order, and when I used '-Wa,no-implicit-function-declaration', the error went away.  None of the other subprocess identifiers suppressed the message.

    Has anyone else encountered this?  Does this sound like the correct solution?

    Thanks.



    Mark

    ------------------------------
    Mark Collins
    ------------------------------



  • 8.  RE: utils2_ak question

    Posted Wed March 25, 2020 10:53 AM
    Edited by System Fri January 20, 2023 04:33 PM

    Another follow-up for a different utility.  When trying to make ul, I get:

    > gmake ul -f Makefile.SMI

    INFORMIXC=cc                        esql  -O -Ae +DD64    -DHAVE_GNU_GETOPT=1 -DHAVE_GETOPT_H=1   -o ul ul.ec -L/usr/lib -lgen

    ld: Unsatisfied symbol "__freopen64" in file ul.o

    ld: Unsatisfied symbol "__fgetpos64" in file ul.o

    ld: Unsatisfied symbol "__fsetpos64" in file ul.o

    ld: Unsatisfied symbol "__ftruncate64" in file ul.o

    ld: Unsatisfied symbol "__prealloc64" in file ul.o

    ld: Unsatisfied symbol "__ftello64" in file ul.o

    ld: Unsatisfied symbol "__truncate64" in file ul.o

    ld: Unsatisfied symbol "__fseeko64" in file ul.o

    ld: Unsatisfied symbol "__lockf64" in file ul.o

    ld: Unsatisfied symbol "__fopen64" in file ul.o

    ld: Unsatisfied symbol "__pwrite64" in file ul.o

    ld: Unsatisfied symbol "__pread64" in file ul.o

    ld: Unsatisfied symbol "__tmpfile64" in file ul.o

    ld: Unsatisfied symbol "__setrlimit64" in file ul.o

    ld: Unsatisfied symbol "__getrlimit64" in file ul.o

    ld: Unsatisfied symbol "__lseek64" in file ul.o

    ld: Unsatisfied symbol "__creat64" in file ul.o

    17 errors.

    Makefile.SMI:86: recipe for target 'ul' failed

    gmake: *** [ul] Error 1



    I'm sure these functions must be defined in some library, and that library needs to be added to the makefile target for ul.

    Any suggestions?  This is on HP-UX 11.31 (PA-RISC), if that matters for identifying the libraries that contain these functions.

    Thanks.



    Mark



    ------------------------------
    Mark Collins
    ------------------------------



  • 9.  RE: utils2_ak question

    IBM Champion
    Posted Fri March 20, 2020 10:25 AM
    Try a later CSDK ??? If that is not possible try changing to
    prepare/execute statement, that should let the engine prep the SQL and not
    the client layer

    Cheers
    Paul

    > I recently downloaded the utils2_ak package and was trying to build it,
    > but I hit an error. When compiling dbscript.ec, I got the following:
    >
    > esqlc: "dbscript.ec", line 454: Error -33051: Syntax error on identifier
    > or symbol 'SIBLINGS'.
    > 1 error(s) found
    >
    >
    > Looking in the source file at line 454:
    >
    > EXEC SQL INSERT INTO hierarchy1
    > SELECT ctabid, ptabid, tabtype, LEVEL as hlevel
    > FROM hierarchy
    > START WITH ptabid IS NULL
    > CONNECT BY PRIOR ctabid = ptabid
    > ORDER SIBLINGS BY ctabid;
    > if (sqlca.sqlcode != 0) {
    > fprintf( stderr,
    > "Error organizing hierarchy map! Error: %d.\n",
    > sqlca.sqlcode );
    > exit(1);
    > }
    >
    >
    > So it's the ORDER SIBLINGS BY that is causing the problem.
    >
    > We're running 11.50.FC6 on HP-UX 11.31 (PA-RISC). Our CSDK is 3.50.FC6.
    > According to the online docs, the ORDER SIBLINGS BY was added in
    > 11.50.FC5, so everything should be good, but ... Actually, I tried this
    > in Server Studio and it worked. I tried it in dbaccess and it worked.
    > It's just when I try to compile that it doesn't work.
    >
    > Any thoughts on where to look? Or how to work around this? Can I just
    > comment out the ORDER SIBLINGS BY and compile? FWIW, we have very few
    > constraints in our databases, and this section of logic appears to deal
    > primarily with constraints.
    >
    >
    >
    >
    >
    >
    >
    > ------------------------------
    > Mark Collins
    > ------------------------------
    >
    >
    > Reply to Sender :
    > https://community.ibm.com/eGroups/PostReply/?GroupId=4147&SenderKey=85dbcc59-d33e-4333-9dbf-481fe76bf230&MID=47302&MDATE=7575458475&UserKey=29a6c229-a98c-46da-9248-4df042a4a263&sKey=KeyRemoved
    >
    > Reply to Discussion :
    > https://community.ibm.com/eGroups/PostReply/?GroupId=4147&MID=47302&MDATE=7575458475&UserKey=29a6c229-a98c-46da-9248-4df042a4a263&sKey=KeyRemoved
    >
    >
    >
    > You are subscribed to "Informix" as paul@oninit.com. To change your
    > subscriptions, go to
    > http://community.ibm.com/community/user/preferences?section=Subscriptions&MDATE=7575458475&UserKey=29a6c229-a98c-46da-9248-4df042a4a263&sKey=KeyRemoved.
    > To unsubscribe from this community discussion, go to
    > http://community.ibm.com/HigherLogic/eGroups/Unsubscribe.aspx?UserKey=29a6c229-a98c-46da-9248-4df042a4a263&sKey=KeyRemoved&GroupKey=60eb97a2-57c0-4130-9b6d-57174f97d5a8.


    --
    Paul Watson
    Tel: +1 913-674-0360
    Mob: +1 913-387-7529
    Web: www.oninit.com

    Oninit? is a registered trademark of Oninit LLC

    Failure is not as frightening as regret.
    If you want to improve, be content to be thought foolish and stupid.
    What this country needs are more unemployed politicians




  • 10.  RE: utils2_ak question

    Posted Fri March 20, 2020 10:35 AM
    Hi Paul,

    Good idea.  If Art doesn't see anything in the output I just sent, I may try that PREPARE option.

    Thanks.


    Mark

    ------------------------------
    Mark Collins
    ------------------------------



  • 11.  RE: utils2_ak question

    IBM Champion
    Posted Fri March 20, 2020 10:37 AM
    you can always install another CSDK in a separate directory and statically
    compile, that should work along side the installed versions

    Cheers
    Paul

    > Hi Paul,
    >
    > Good idea. If Art doesn't see anything in the output I just sent, I may
    > try that PREPARE option.
    >
    > Thanks.
    >
    >
    > Mark
    >
    > ------------------------------
    > Mark Collins
    > ------------------------------
    > -------------------------------------------
    > Original Message:
    > Sent: Fri March 20, 2020 10:24 AM
    > From: Paul Watson
    > Subject: utils2_ak question
    >
    > Try a later CSDK ??? If that is not possible try changing to
    > prepare/execute statement, that should let the engine prep the SQL and not
    > the client layer
    >
    > Cheers
    > Paul
    >
    >> I recently downloaded the utils2_ak package and was trying to build it,
    >> but I hit an error. When compiling dbscript.ec, I got the following:
    >>
    >> esqlc: "dbscript.ec", line 454: Error -33051: Syntax error on identifier
    >> or symbol 'SIBLINGS'.
    >> 1 error(s) found
    >>
    >>
    >> Looking in the source file at line 454:
    >>
    >> EXEC SQL INSERT INTO hierarchy1
    >> SELECT ctabid, ptabid, tabtype, LEVEL as hlevel
    >> FROM hierarchy
    >> START WITH ptabid IS NULL
    >> CONNECT BY PRIOR ctabid = ptabid
    >> ORDER SIBLINGS BY ctabid;
    >> if (sqlca.sqlcode != 0) {
    >> fprintf( stderr,
    >> "Error organizing hierarchy map! Error: %d.\n",
    >> sqlca.sqlcode );
    >> exit(1);
    >> }
    >>
    >>
    >> So it's the ORDER SIBLINGS BY that is causing the problem.
    >>
    >> We're running 11.50.FC6 on HP-UX 11.31 (PA-RISC). Our CSDK is 3.50.FC6.
    >> According to the online docs, the ORDER SIBLINGS BY was added in
    >> 11.50.FC5, so everything should be good, but ... Actually, I tried this
    >> in Server Studio and it worked. I tried it in dbaccess and it worked.
    >> It's just when I try to compile that it doesn't work.
    >>
    >> Any thoughts on where to look? Or how to work around this? Can I just
    >> comment out the ORDER SIBLINGS BY and compile? FWIW, we have very few
    >> constraints in our databases, and this section of logic appears to deal
    >> primarily with constraints.
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >> ------------------------------
    >> Mark Collins
    >> ------------------------------
    >>
    >>
    >> Reply to Sender :
    >> https://community.ibm.com/eGroups/PostReply/?GroupId=4147&SenderKey=85dbcc59-d33e-4333-9dbf-481fe76bf230&MID=47302&MDATE=7575458475&UserKey=29a6c229-a98c-46da-9248-4df042a4a263&sKey=KeyRemoved
    >>
    #Informix