Menu

isql -n option different behavior between Red Hat and SuSE

Help
2019-02-05
2019-12-04
  • Chris Capitolo

    Chris Capitolo - 2019-02-05

    I have two servers, one Red Hat and one SuSE. Both have the ODBC for SAP Hana client installed, and both have an ODBC DSN configured to connect into the same Hana database. I'm able to use unixODBC isql on either system to connect into the database and run queries.

    However, I notice a difference in behavior when I use the -n option in isql. On Red Hat, when I end a line with a semicolon, it executes the statement. On SuSE, a "GO" command is still needed after the semicolon. I'm running the same version of UnixODBC on both systems. Does anyone know why the behavior is different? Is there documentation explaining this difference somewhere?

    Red Hat test:

    /home/shadtest> isql --version
    unixODBC 2.3.1
    /home/shadtest> isql HANA <user> <pass> -n
    +---------------------------------------+
    | Connected! |
    | |
    | sql-statement(s)[;] |
    | go |
    | \noac |
    | \ac |
    | \commit |
    | \rollback |
    | \tables |
    | \columns <table-name> |
    | \quit |
    | |
    +---------------------------------------+
    1 SQL> select count(*) from oinftabl1;
    +----------------------+
    | COUNT(*) |
    +----------------------+
    | 0 |
    +----------------------+
    SQLRowCount returns 1
    1 rows fetched
    1 SQL>
    

    SuSE test:

    /home/shadtest> isql --version
    unixODBC 2.3.1
    /home/shadtest> isql HANA <user> <pass> -n
    +---------------------------------------+
    | Connected! |
    | |
    | sql-statement(s)[;] |
    | go |
    | \noac |
    | \ac |
    | \commit |
    | \rollback |
    | \tables |
    | \columns <table-name> |
    | \quit |
    | |
    +---------------------------------------+
    1 SQL> select count(*) from oinftabl1;
    2 SQL> go
    +----------------------+
    | COUNT(*) |
    +----------------------+
    | 0 |
    +----------------------+
    SQLRowCount returns 1
    1 rows fetched
    1 SQL>
    
     
  • Chris Capitolo

    Chris Capitolo - 2019-11-25

    I'm still looking for a response to this one. I asked the same question in an SAP Hana forum and they directed me to unixODBC for an answer. Does anyone have any ideas?

     
  • Nick Gorham

    Nick Gorham - 2019-11-26

    Hi, Sorry, missed this. I will have to guess. It is clearly to do with how the two distrobutions build their isql, and I suspect it may be related to the use or not of the readline lib. My copy built from source will take the prescense of ";"in the last char of the line as the direction to execute the staement. So, with that in mind, I think the SuSE version is possibly returning a space after the ";" so it requires a explicit "go" to execute. But assuming they both used the same code it has to be down to how they built their versions.

     
    👍
    1
    • Chris Capitolo

      Chris Capitolo - 2019-12-04

      Thanks very much, I rebuilt isql keeping the readline lib in mind. It seems to be working as expected now.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.