Public Member Functions | |
| __construct ($sequence, $objMax, $connection) | |
| Constructor. | |
| getSequence () | |
| Return named sequence property. | |
| setSequence () | |
| Create sequence object. | |
Definition at line 15 of file ingresSequence.php.
| __construct | ( | $ | sequence, | |
| $ | objMax, | |||
| $ | connection | |||
| ) |
Constructor.
public
| str | $sequence | |
| int | $objMax | |
| mixed | $connection |
Definition at line 57 of file ingresSequence.php.
{
$this->objConnection = $connection;
$this->objMax = $objMax;
$this->objSequence = $sequence;
}
| getSequence | ( | ) |
Return named sequence property.
public
Definition at line 70 of file ingresSequence.php.
{
return $this->objSequence . '.NEXTVAL';
}
| setSequence | ( | ) |
Create sequence object.
public
Definition at line 81 of file ingresSequence.php.
{
//make sure $this->objMax is an unsigned int > 0
$objMax = ( is_numeric( $this->objMax ) && $this->objMax > 0 ) ? 'MAXVALUE ' . ( int )$this->objMax : 'NOMAXVALUE';
$objSeq = 'CREATE SEQUENCE ' . $this->objSequence . ' AS INTEGER START WITH 1 INCREMENT BY 1 ' . $objMax . ' MINVALUE 1';
return ingres_query( $objSeq, $this->objConnection )
or trigger_error( ingres_error( $this->objConnection ), E_USER_WARNING );
}
1.7.1