Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

(click on this box to dismiss)

Input values in column type SEQUENCE using the DBD::cubrid Perl module

I was trying to insert a value into a table column within a Perl script and using the DBD::cubrid module (v9.1.0.0001, server v9.1.0) with type SEQUENCE and it failed with:

"CUBRID DBMS Error : (-494) Semantic: Cannot coerce host var to type sequence.  at ... line ..."

This was my first attempt and the script was using parameters. My workaround for the moment is to NOT use parameters, like in the second attempt.

#!/bin/env perl
# CREATE TABLE test_seq (
#     tags   SEQUENCE (VARCHAR(512))
# );

use strict;
use warnings;
use DBI;

my $dbname = 'test_sequence';
my $host   = 'localhost';
my $port   = '33000';
my $user   = 'user';
my $pass   = 'pass',

my $dsn = qq{dbi:cubrid:database=$dbname;host=$host;port=$port};
my $dbh = DBI->connect(
    $dsn, $user, $pass,
    {   AutoCommit => 1,
        RaiseError => 1,
        PrintError => 1,
) or die $DBI::errstr;

my $tag = q({'tag1','tag2'}); # also tried "{'tag1'}" and '{"tag1"}' ...

$dbh->do( qq{ INSERT INTO test_seq ( tags ) VALUES (?) }, undef, $tag )
    or die $DBI::errstr;                # CUBRID DBMS Error : (-494)

$dbh->do( qq{ INSERT INTO test_seq ( tags ) VALUES ($tag) } )
    or die $DBI::errstr;                 # This is OK

My question is: have I done something wrong or this feature is not yet implemented for type SEQUENCE?

P.S.: I think a Perl tag sould be available.

link comment (2) accepted answer
asked 4 years ago
I've reported this issue at We will work on adding support for SEQUENCE data type when binding values. - [Level:3]Esen Sagynov 4 years ago
If you'd like, you can subscribe to that issue by clicking on 'Watch" button on that issue page. You would receive notifications on discussions and issue resolution. - [Level:3]Esen Sagynov 4 years ago
190 Answers

Looking over the perl driver source  (dbd_bind_ph function), it seems binding sequences is not supported. It is supported at the server level so it might be at some time in the future in the perl driver also.

link comment (0)
answered 4 years ago

You are either using a very old browser or a browser that is not supported.
In order to browse you need to have one of the following browsers:

Internet Explorer: Mozilla Firefox: Google Chrome: