Subject Re: [IBO] Problem with insert
Author Erik Mlakar
Dear Dany M

First i have to say that the query is work just fine. It's just a example. I am just wondering way the query won't accept the values. If there is a where condition in query. without him work query fine. If I am trying to insert values (5, 1, 'PRO TEAM'), i have looked the values on before post event and the field are getting all the right values. In the base is that record a mess. ('-3242343453' , Null, Null) or in some cases (321423423, 4534, 'dfgdfsg[]').

Best regards Erik






Dany M <arbit@...> wrote: erikmlakar wrote:
>
> I am using IB_Query, IB_Datasourse, IB_Connection, IB_Transaction
>
> TABLE IN Firebird is
>
> CREATE TABLE TEAMS (
> AUTONOM INTEGER NOT NULL,
> TEAMNOM INTEGER NOT NULL,
> TEAMNAME VARCHAR(40) NOT NULL;
> ALTER TABLE EKIPE ADD PRIMARY KEY (AUTONOM);
>
> When a simple query in program. Here everting is ok. I not using
> trigger to determinate wich AutoNom is next, but I am using my own
> avtoinciment function witch work very good and it is set on
> IB_QueryNewRecord.
>

IBO has built in support for IB/FB generators!

> SELECT
> TEAM. AUTONOM,
> TEAM. TEAMNOM,
> TEAM. TEAMNAME
> FROM
> TEAM
> WHERE (1=1)
>
> Problem is next:
>
> IF i have query like
>
> SELECT
> TEAM. AUTONOM,
> TEAM. TEAMNOM,
> TEAM. TEAMNAME
> FROM
> TEAM
> WHERE (1=1) And (TEAM. AUTONOM >= 1 and TEAM.AUTONOM <= 1)
>

That looks so strange. That query will only return one row. Always.
Maybe you meant

and (TEAM. TEAMNOM >= 1 and TEAM.TEAMNOM <= 1)

you could write

TEAM.TEAMNOM = 1 since it's an integer.

And I think you can get rid of the (1=1) too.

> And I am trying to insert values (5, 1, 'PRO TEAM'), the values are
> all correct but when i post the query. Values disapear from the grid
> wich is correct. Then I am going to look the record in the base and it
> isn't there , but there is a record wich have values ('-3242343453',
> Null, Null').
>
>
> What is here wrong?
>

???

HTH,

/Dany





---------------------------------
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider.

[Non-text portions of this message have been removed]