# man > Apache::Session::Store::Sybase

---
type: CommandReference
command: Apache::Session::Store::Sybase
mode: perldoc
section: 3pm
source: perldoc
---

## Quick Reference

- `tie %hash, 'Apache::Session::Sybase', $id, { DataSource => ..., UserName => ..., Password => ... }` — tie session hash to Sybase database
- `tie %hash, 'Apache::Session::Sybase', $id, { Handle => $dbh }` — tie using existing DBI handle
- `my $store = Apache::Session::Store::Sybase->new; $store->insert($ref);` — direct store usage

## Name

Apache::Session::Store::Sybase — Store persistent data in a Sybase database

## Synopsis

perl
use Apache::Session::Store::Sybase;

my $store = Apache::Session::Store::Sybase->new;
$store->insert($ref);
$store->update($ref);
$store->materialize($ref);
$store->remove($ref);
## Options

- `DataSource` — DBI datasource string (e.g., 'dbi:Sybase:database=db;server=server')
- `UserName` — database username
- `Password` — database password
- `Handle` — an already-opened DBI handle (alternative to DataSource/UserName/Password)
- `Commit` — boolean; whether to commit changes. Must be true if module creates the handle; optional if using AutoCommit handle.
- `textsize` — value for 'set textsize' command; defaults to 32K.

## Examples

- Schema creation:

sql
CREATE TABLE sessions (
   id CHAR(32) not null primary key,
   a_session TEXT
);
- Tie with connection options:

perl
tie %hash, 'Apache::Session::Sybase', $id, {
    DataSource => 'dbi:Sybase:database=db;server=server',
    UserName   => 'database_user',
    Password   => 'K00l',
    Commit     => 1,
};
- Tie with existing handle:

perl
tie %hash, 'Apache::Session::Sybase', $id, {
    Handle => $dbh
};
## See Also

- [Apache::Session](http://localhost/phpMan.php/perldoc/Apache%3A%3ASession/markdown) — the main session management module