---
name: "Parse::Dia::SQL::Output::DB2"
section: "3pm"
platform: "linux"
package: "libparse-dia-sql-perl"
version: "0.31-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Parse::Dia::SQL::Output::DB2"
---

# Parse::Dia::SQL::Output::DB2(3pm)

Create SQL for DB2.

## NAME

Parse::Dia::SQL::Output::DB2 - Create SQL for DB2.

## SYNOPSIS

```
    use Parse::Dia::SQL;
    my $dia = Parse::Dia::SQL->new(...);
    print $dia->get_sql();
```

## DESCRIPTION

This class creates SQL for the IBM DB2 database.

### new

The constructor.  Arguments:

###

Create primary key clause, e.g.

constraint pk\_\<tablename\> primary key (\<column1\>,..,\<columnN\>)

For DB2 the PK must be 18 characters or less

Returns undefined if list of primary key is empty (i.e. if there are no primary keys on given table).

###

For DB2 a constraint name must be 18 characters or less.

Returns shortened tablename.

### \_get\_drop\_schema\_sql

DB2 do not support keyword 'if exists' in 'drop table' statement

Subclass for outputting SQL for the DB2 database
