Firebird throwing exceptions at simple queries

313 views Asked by At

I'm making kind of an external plugin for my friend which, for the first time in my life, involves dealing with Interbase/Firebird engine.

I've got this table:

CREATE TABLE T_KLIENT (
ID_KLIENTA INTEGER NOT NULL,
NAZWA PL_VARCHAR250 NOT NULL,
WOJEWODZTWO PL_VARCHAR50 NOT NULL,
MIASTO PL_VARCHAR50 NOT NULL,
POCZTA POCZTA NOT NULL,
ADRES PL_VARCHAR50,
OS_KONTAKT PL_VARCHAR100,
TELEFON PL_VARCHAR30,
FAX PL_VARCHAR30,
NIP PL_VARCHAR30,
EMAIL PL_VARCHAR100,
ID_SCENARIUSZA LICZBA,
RAPORTOWANIE LICZBA,
UWAGI PL_VARCHAR250,
KRS PL_VARCHAR30,
FAKTUROWANIE LICZBA,
KONTO PL_VARCHAR50,
AC KOD_OZNACZENIA_NULL,
STATUS LICZBA,
KOD_KLIENTA PL_VARCHAR30 NOT NULL,
NR_KLIENTA PL_VARCHAR30 NOT NULL,
ID_KATEGORII LICZBA DEFAULT -1,
ID_ODDZIALU INTEGER default 0,
RYCZALT_KWOTA KWOTA,
GODZ_RYCZALT LICZBA DEFAULT 0,
KWOTA_GODZ_POZARYCZALT KWOTA,
ONLINE_LOGIN PL_VARCHAR10,
ONLINE_PASSWORD PL_VARCHAR30,
PRZEDSTAWICIEL_KOD KOD_OZNACZENIA_NULL,
F_PROWIZJA_KAPITAL "DProcenty" DEFAULT 0,
F_PROWIZJA_ODSETKI "DProcenty" DEFAULT 0,
ORGANREJESTROWY PL_VARCHAR250,
REGON PL_VARCHAR100,
STRONA_WWW PL_VARCHAR100,
TELEFON_GSM PL_VARCHAR30,
BRANZA PL_VARCHAR100,
RODZAJ_PODMIOTU PL_VARCHAR100,
NR_DOMU PL_VARCHAR10);

this function

 function FDB_addClient($client_name, $client_address, $client_postal, $client_city, $client_country, $client_vat) {
    $get_total_client_count = ($this->FDB_getTotalClientCount()+1);
    $set_query = ibase_query($this->fb_db, "INSERT INTO T_KLIENT VALUES (".$get_total_client_count.", '".$client_name."', '---', '".$client_city."', '".$client_postal."', '".$client_address."', 'Brak', 'Brak', 'Brak', '".$client_vat."', 'Brak', NULL, NULL, 'Brak', NULL, NULL, 'Brak', NULL, NULL, '".$client_vat."', '".$client_vat."', -1, 0, 0, 0, 0, 'Brak', 'Brak', NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL)") or die(ibase_errcode().'-'.ibase_errmsg());
    if ($set_query) { return true; } else { return false; }
}

and this very error I can't get rid of

Warning: ibase_query(): exception @1 @1 @1 @1 in C:\WebServ\httpd\core.php on line 37
-836-exception @1 @1 @1 @1

Unfortunately, the Internet is so poor in any decent support for Firebird and it's overwhelmingly frustrating.

I'd appreciate any hint. Thank you in advance!

@Edit

Specifying columns does not help.

function FDB_addClient($client_name, $client_address, $client_postal, $client_city, $client_country, $client_vat) {
    $get_total_client_count = ($this->FDB_getTotalClientCount()+1);
    $set_query = ibase_query($this->fb_db, "INSERT INTO T_KLIENT (ID_KLIENTA, NAZWA, WOJEWODZTWO, MIASTO, POCZTA, ADRES, OS_KONTAKT, TELEFON, FAX, NIP, EMAIL, ID_SCENARIUSZA, RAPORTOWANIE, UWAGI, KRS, FAKTUROWANIE, KONTO, AC, STATUS, KOD_KLIENTA, NR_KLIENTA, ID_KATEGORII, ID_ODDZIALU, RYCZALT_KWOTA, GODZ_RYCZALT, KWOTA_GODZ_POZARYCZALT, ONLINE_LOGIN, ONLINE_PASSWORD, PRZEDSTAWICIEL_KOD, F_PROWIZJA_KAPITAL, F_PROWIZJA_ODSETKI, ORGANREJESTROWY, REGON, STRONA_WWW, TELEFON_GSM, BRANZA, RODZAJ_PODMIOTU, NR_DOMU) VALUES (".$get_total_client_count.", '".$client_name."', '---', '".$client_city."', '".$client_postal."', '".$client_address."', 'Brak', 'Brak', 'Brak', '".$client_vat."', 'Brak', NULL, NULL, 'Brak', NULL, NULL, 'Brak', NULL, NULL, '".$client_vat."', '".$client_vat."', -1, 0, 0, 0, 0, 'Brak', 'Brak', NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL)") or die(ibase_errcode().'-'.ibase_errmsg());
    if ($set_query) { return true; } else { return false; }
}
1

There are 1 answers

0
Sates On

This issue was solved by updating fbclient.dll for more comprehensible errors and reading triggers embedded into the database.

Thanks to all users involved.