Bonjour

un peu comme dans mon meassage precedant message, j'ai une application qui se connecte a une base de données par ODBC. Je suis en train de tester avec un base ORACLE expresse. Je suis sous linux.
J'ai cette erreur quand je veux ecrire dans une table (j'ai la meme erreur sur certaines autres tables, mais pas toutes) :
Error binding parameter: [Easysoft][Oracle]Restricted data type attribute violation
Voici le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
UnicodeString name, dateStart, dateFinish;
    jint channelType, channelFolderID, businessHourFrom, businessHourTo, nbObjLimit, totalSizeLimit, dateFrequence;
    jbyte businessHourTimeZoneOffset;
    jboolean nature, active;
 
    data_in >> channelType >> nature >> name >> channelFolderID >> businessHourTimeZoneOffset >> businessHourFrom
        >> businessHourTo >> active >> nbObjLimit >> totalSizeLimit >> dateStart >> dateFinish >> dateFrequence;
    int result = 0;
    try {
        begin_transaction();
 
        // CREDENTIAL INSERTION
        int idCredential = new_channelCredential(channelType, data_in);
        if (idCredential == -1)
        {
            rollback_transaction();
            return -1;
        }
        // CHANNEL INSERTION
        auto_ptr<odbc::PreparedStatement> cipstmt(con->prepareStatement(("INSERT INTO Channel (name, idCredential, idChannelFolder, type_, nature, businessHourTimeZoneOffset, businessHourFrom, businessHourTo, active, nbObjLimit, totalSizeLimit, dateStart, dateFinish, dateFrequence) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")));
 
        cipstmt->setString(1, strToUTF8(name));
        cipstmt->setInt(2, idCredential);
        cipstmt->setInt(3, channelFolderID);
        cipstmt->setInt(4, channelType);
        cipstmt->setBoolean(5, nature);
        cipstmt->setByte(6, businessHourTimeZoneOffset);
        cipstmt->setInt(7, businessHourFrom);
        cipstmt->setInt(8, businessHourTo);
        cipstmt->setBoolean(9, active);
        cipstmt->setInt(10, nbObjLimit);
        cipstmt->setInt(11, totalSizeLimit);
        cipstmt->setString(12, strToUTF8(dateStart));
        cipstmt->setString(13, strToUTF8(dateFinish));
        cipstmt->setInt(14, dateFrequence);
 
        cipstmt->executeUpdate();
 
        { // last inserted id
            auto_ptr<odbc::PreparedStatement> ps(con->prepareStatement("SELECT idChannel FROM Channel ORDER BY idChannel DESC"));
            auto_ptr<odbc::ResultSet> rs(ps->executeQuery());
            if (rs->next()) {
                result = rs->getInt(1);
            }
        }
        cipstmt->close();
 
        commit_transaction();
    } catch (const odbc::SQLException& e) {
        rollback_transaction();
        ACE_ERROR_RETURN((LM_ERROR, ACE_TEXT("-%D Monitor: DataSource exception: %s\n"), ODBCXX_STRING_CSTR(e.getMessage())), -1);
    }
L'erreur se fait au
cipstmt->executeUpdate();
Je ne comprends pas trop ce qui ce passe. Le code a été testé sous ORACLE et mysql sous windows, et mysql sous linux.

Voici la le scripte de la table :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
--
-- Table: Channel
--
CREATE TABLE Channel (
  idChannel number(11) NOT NULL,
  deleted number(5) DEFAULT '0' NOT NULL,
  idUser number(10) DEFAULT '0' NOT NULL,
  permissions number(5) DEFAULT '480' NOT NULL,
  idCredential number(10) DEFAULT '0' NOT NULL,
  idChannelFolder number(10) DEFAULT '0' NOT NULL,
  name varchar2(255) DEFAULT '',
  type_ number(5) DEFAULT '0' NOT NULL,
  nature number(5) DEFAULT '0' NOT NULL,
  businessHourTimeZoneOffset number(5) DEFAULT '0' NOT NULL,
  businessHourFrom number(10) DEFAULT '0' NOT NULL,
  businessHourTo number(10) DEFAULT '86399' NOT NULL,
  active number(5) DEFAULT '0' NOT NULL,
  nbObjLimit number(10) DEFAULT '0' NOT NULL,
  totalSizeLimit number(10) DEFAULT '0' NOT NULL,
  dateStart varchar2(30) DEFAULT '1970-01-01 00:00:00',
  dateFinish varchar2(30) DEFAULT '2038-01-01 00:00:00',
  dateFrequence number(10) DEFAULT '0' NOT NULL,
  CONSTRAINT pk_Channel PRIMARY KEY (idChannel)
);
 
CREATE SEQUENCE sq_Channel_idChannel;
CREATE OR REPLACE TRIGGER ai_Channel_idChannel
BEFORE INSERT ON Channel
FOR EACH ROW WHEN (
 new.idChannel IS NULL OR new.idChannel = 0
)
BEGIN
 SELECT sq_Channel_idChannel.nextval
 INTO :new.idChannel
 FROM dual;
 
END;
/
Est ce que qq un a une idée, ou une piste pour m'aider?

Merci
a bientot

@+