Open Source RDBMS - Seamless, Scalable, Stable and Free

English | Login |Register


2
(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.

링크 댓글 쓰기 (2) 선택된 답변
질문시간 10달 전
stefans
20
I've reported this issue at http://jira.cubrid.org/browse/APIS-561. We will work on adding support for SEQUENCE data type when binding values. - [레벨:3]Esen Sagynov 10달 전
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. - [레벨:3]Esen Sagynov 10달 전
190 답변들
1

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.

링크 댓글 쓰기 (0)
답변시간 10달 전
ginarrbrik
516
tagged




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



Internet Explorer: Mozilla Firefox: Google Chrome: