Results 1 to 5 of 5
  1. #1
    Join Date
    May 2002
    Posts
    47

    Question Unanswered: enter sql statements in unix

    Dumb question,
    I am telnetted into my server.
    From the unix command prompt how do I execute sql statements.

    I tried:
    db2 connect to my_database

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: enter sql statements in unix

    Good start ... You have done it right

    db2 "select * from table1"


    Originally posted by ksexton
    Dumb question,
    I am telnetted into my server.
    From the unix command prompt how do I execute sql statements.

    I tried:
    db2 connect to my_database
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    May 2002
    Posts
    47

    db2 not installed

    My apologies for not stating this.
    These are the errors I get:

    $ db2 connect to my_db
    ksh: db2: not found.

    $ db2 "create table test (col1 integer)"
    ksh: db2: not found.

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: db2 not installed

    Originally posted by ksexton
    My apologies for not stating this.
    These are the errors I get:

    $ db2 connect to my_db
    ksh: db2: not found.

    $ db2 "create table test (col1 integer)"
    ksh: db2: not found.
    Execute

    /home/<instance_owner_id>/sqllib/db2profile

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: db2 not installed

    ..... in the current shell

    Or better add it to your .profile (or eqivalent)
    Cheers
    Sathyaram

    Originally posted by n_i
    Execute

    /home/<instance_owner_id>/sqllib/db2profile
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •