Sybase Tech Tips / FAQ

Table of Contents

General

  1. sqsh spews out errors after I give my password
  2. I have seen you typing ';' at the end of command instead of 'go'. How do I enable it?
  3. How do I list the tables I created?
  4. I am not able to access sybase through perl+dbi
  5. How do I change my password?
  6. My project doesn't require sybase. Can I still use database and create table?
  7. What is pubs2 and pubs3?
  8. What is use?

Groups

  1. What are these groups?
  2. How do you find out my group?
  3. I am in the creators group, what should I do?
  4. I am in the creators team, I have created a table but my friends in the team are not able to access it
  5. I am in the users team, What should I do?

Advanced

  1. How do I specify wild cards in commands?
  2. How do I access sybase from C programs?
  3. I use bash as my default shell. Do you have a sybase.bashrc?

  1. sqsh spews out errors after I give password
  2. I have seen you typing ';' at the end of command instead of 'go'. How do I enable it?

    To enable the semicolon hack, you have to put the following line in .sqshrc. The file has to be created in your home directory
    	\set semicolon_hack=1
    
    The file doesn't exist by default. You have to create a file and put above line in it.
  3. How do I list the tables I created?

    The following command lists the tables in database
    	sp_tables
    	go
    
    It only lists the tables you created or have access to. The table names starting with sys are system tables which you generally do not have access.
  4. I am not able to access sybase through perl+dbi

    Make sure that in the call to DBI connect you have given your password. You should be able to access the database with a statement like the following
    $dbh = DBI->connect('DBI:Sybase:CISE_DATASERVER_0', 'username', 'password');
    
    Substitue your username and password in the above statement for proper results.
  5. How do I change my password?

    You can change your password with the following command
    sp_password "old password", "new password"
    
    The double quotes are required, if you have special characters in your password.
  6. My project doesn't require sybase. Can I still use database and create table?

    If you want to use it as a learning process, we welcome it. Register for the sybase account and mail me your CISE user id.

    Whenever you login, you will be logged in as a guest user. The tables you create will be with user name guest. If you want access to other teams tables, ask the creators team to grant permission. It's left to the creator team's discretion whether to grant permission or not.

  7. What is pubs2 and pubs3?

    These are two general purpose database which can be used by any one. These databases can be used for testing purposes. Use the command use (see next question) to change the database you are working on.
  8. What is use?

    When you login, you will be having to access to a database named defdb which for this year is cen3031_su01. The table you create gets created in this database. If you want to create tables in a different database, you need to change the present working database with use

    Say you want to work on pubs2 database. The you would issue the following command

    	use pubs2
    	go
    
    Now onwards, the tables you create will be created in pubs2 database.

  1. What are these groups?

    For easy management of users, every user in the section is put in one of the groups named
    	se<section number>c  	(or)
    	se<section number>u
    
    The group ending with 'c' contains students who will be creating tables. Students in the other group will be using the tables. If you don't know to which you group you should belong to, please see your recitation TA.
  2. How do I find out my group?

    You must have already been assigned a group. The following command at sqsh prompt shows your group
    	sp_helpuser <your user name>
    	go
    
    This prints your user name along with the group to which you belong to.
  3. I am in the creators team, what should I do?

  4. I am in the creators team, I have created a table but my friends in the team are not able to access it

    You should grant all permissions on the table to your friends in the team, so that they can administer the table. It's done with
    	grant all on <table name> to se<section number>c
    	go
    
    Say you are in section 6248 and created a table named demo then you give permission to do administrative tasks to your friends in the team with
    	grant all on demo to se6248c
    	go
    
  5. I am in the users team, What should I do?

    You should use the tables created by the creators team. You should talk with them to provide you with proper tables to work with. It's your responsibility to ask them to create tables. If you are not able to access tables, ask them to grant permissions to you.
  1. How do I specify wild cards in commands?

    Wild cards can be used in certain commands for selecting multiple things in a command. For example, if you want to find out all the tables starting with the suffix 'sys', you would write the command as follows
    	sp_tables 'sys%'
    	go
    
    The percentage(%) character denotes a string of length 0 or more. Other wild characters commonly used are

    Symbol

    Meaning

    %

    Any string of 0 or more characters

    _

    Any single character

    [ ]

    Any single character within the specified range ([a-f]) or set ([abcdef])

    [^]

    Any single character not within the specified range ([^a-f]) or set ([^abcdef])


    For more information follow this link
  2. How do I access sybase from C programs?

    There are variety of ways through which you can access sybase database through 'C'. Follow this link for more information.
  3. I use bash as my default shell. Do you have a sybase.bashrc?

    Yes !!! Follow this link for more information.

Prepared by Pradeep Padala, ppadala@cise.ufl.edu