Forum Stats

  • 3,734,396 Users
  • 2,246,961 Discussions
  • 7,857,255 Comments

Discussions

Set SQLcl Path on linux

Eric.Sacramento
Eric.Sacramento Member Posts: 212 Blue Ribbon
edited Mar 19, 2020 8:19AM in SQLcl

HI,

I am trying to connect SQLcl on linux terminal, but all the time that I go to the terminal I need to execute this code

alias sql="sqlcl/bin/sql"

Is there a way to set this variable permanently ?

Thank you,

Eric

Tagged:
Eric.Sacramento

Answers

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,776 Bronze Crown
    edited Mar 18, 2020 2:37AM
    $ export PATH=$PATH:/home/user/sqlcl/bin

    ...and to set it on login, add it to .bash_profile:

    export PATH=$PATH:/home/user/sqlcl/bin
    Eric.Sacramento
  • Eric.Sacramento
    Eric.Sacramento Member Posts: 212 Blue Ribbon
    edited Mar 18, 2020 9:12AM

    Thank you for the answer, but it didn't work.

    In reality, I am trying to run a GitLab-Runner on docker and on .gitlab-ci.yml I call a shell script file and then I try to connect sqlcl.

    I am getting this error when I push a file into repository.

    build/export_apex.sh: line 4: sql: not foundERROR: Job failed: exit code 127
  • Gaz in Oz
    Gaz in Oz Member Posts: 3,776 Bronze Crown
    edited Mar 18, 2020 9:25AM

    Set your path in the shell script you are calling.

  • Eric.Sacramento
    Eric.Sacramento Member Posts: 212 Blue Ribbon
    edited Mar 18, 2020 1:41PM

    thank you again, here's my code.

    export_apex.png

    yml_file.png

    Am doing something wrong ?

  • Gaz in Oz
    Gaz in Oz Member Posts: 3,776 Bronze Crown
    edited Mar 18, 2020 10:32PM

    If it doesn't work then yes, you are doing something wrong...

    If it is the same error where the executable "sql" cannot be found then you are not setting the PATH correctly.

    Where is the sql executable exactly, i.e. the FULL path to the sql executable?

    For example cd to the location sql  executable is :

    $ cd sqlcl-19.1.0.094.1619/sqlcl/bin$ pwd/home/gaz/sqlcl-19.1.0.094.1619/sqlcl/bin$

    ...and assign that FULLpath to $PATH.

    Or where your picture shows "6. sql"... assign the full path in front of "sql" akin to:

    6. /home/gaz/sqlcl-19.1.0.094.1619/sqlcl/bin/sql ...

    Basically stop using relative paths, instead use full paths.

    Eric.Sacramento
  • Eric.Sacramento
    Eric.Sacramento Member Posts: 212 Blue Ribbon
    edited Mar 19, 2020 8:19AM

    here's where I extracted the SQLcl.zip file.

    path_sqlcl.png

    Thank you

Sign In or Register to comment.