Subject Re: Why TIBOQuery.params[0].value change after open?
Author Kadee
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 09:12 AM 2/05/2003 +0000, you wrote:
> >Hi all;
> >
> >I use IBO_4_ld on D5 ent.
> >
> >I got a problem about parameter of Tiboquery.
> >
> >this is the situation:
> >
> >Tibodatabase -> Tibotransation ->Tiboquery
> >
> >Tibodatabase.databasename := \examples\employee.gdb
> >
> >Tiboquery.sql:
> >select * from employee
> >where dept_no = :dept_no
> >
> >bitbtn1.onclick:
> >
> >Tiboquery.close;
> >Tiboquery.params[0].value := '623';
> >Tiboquery.open;
> >
> >bitbtn2.onclick:
> >Tibodatabase.close;
> >Tibodatabase.open;
> >Tiboquery.close;
> >Tiboquery.params[0].value := 'ZZZ';
> >showmessage('before open:'+Tiboquery.params[0].asstring);
> >Tiboquery.open;
> >showmessage('after open:'+Tiboquery.params[0].asstring);
> >
> >first I click bitbtn1, then
> >I click bitbtn2.
> >the message as follow:
> >[before open:ZZZ]
> >[after open:623]
> >
> >Does anyone know this problem before?
>
> Try dropping a TIB_MonitorDialog onto your form. Call its Show
method in
> your FormCreate handler.
>
> Now, watch what happens at the API. That will give you a clearer
picture
> of what is going on, and better clues for analysing your problem.
>
> Helen

Dear Helen;
Thank you for your quick reply.
following is the result from Ib_monitor

******** bitbtn1click
/*---
CONNECT DATABASE C:\fb\examples\EMPLOYEE.GDB
DB_HANDLE = 14515648

SECONDS = 1.031
----*/
/*---
DATABASE INFO
DB_HANDLE = 14515648
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14515544
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14515144
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14515144
STMT_HANDLE = 14515216

SELECT RDB$PROCEDURE_NAME
FROM RDB$PROCEDURES
ORDER BY RDB$PROCEDURE_NAME ASC

PLAN (RDB$PROCEDURES ORDER RDB$INDEX_21)

FIELDS = [ Version 1 SQLd 1 SQLn 30
RDB$PROCEDURES.RDB$PROCEDURE_NAME = <NIL> ]

SECONDS = 0.010
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14515144
STMT_HANDLE = 14515216
PARAMS = [ ]
----*/
/*---
COMMIT
TR_HANDLE = 14515144
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14509776
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14509776
STMT_HANDLE = 14515216

SELECT S.RDB$FIELD_NAME
, I.RDB$RELATION_NAME
FROM RDB$RELATION_CONSTRAINTS C
, RDB$INDICES I
, RDB$INDEX_SEGMENTS S
WHERE C.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY'
AND C.RDB$RELATION_NAME = I.RDB$RELATION_NAME
AND C.RDB$INDEX_NAME = I.RDB$INDEX_NAME
AND I.RDB$INDEX_NAME = S.RDB$INDEX_NAME
ORDER BY I.RDB$RELATION_NAME ASC
, S.RDB$FIELD_POSITION ASC

PLAN SORT (JOIN (C NATURAL,I INDEX (RDB$INDEX_5,RDB$INDEX_31),S INDEX
(RDB$INDEX_6)))

FIELDS = [ Version 1 SQLd 2 SQLn 30
RDB$INDEX_SEGMENTS.RDB$FIELD_NAME = <NIL>
RDB$INDICES.RDB$RELATION_NAME = <NIL> ]
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14509776
STMT_HANDLE = 14515216
PARAMS = [ ]
----*/
/*---
COMMIT
TR_HANDLE = 14509776
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14515544
STMT_HANDLE = 14515380

SELECT *
FROM EMPLOYEE
where Dept_no = ? /* dept_no */

PLAN (EMPLOYEE INDEX (RDB$FOREIGN8))

FIELDS = [ Version 1 SQLd 11 SQLn 30
EMPLOYEE.EMP_NO = <NIL>
EMPLOYEE.FIRST_NAME = <NIL>
EMPLOYEE.LAST_NAME = <NIL>
EMPLOYEE.PHONE_EXT = <NIL>
EMPLOYEE.HIRE_DATE = <NIL>
EMPLOYEE.DEPT_NO = <NIL>
EMPLOYEE.JOB_CODE = <NIL>
EMPLOYEE.JOB_GRADE = <NIL>
EMPLOYEE.JOB_COUNTRY = <NIL>
EMPLOYEE.SALARY = <NIL>
EMPLOYEE.FULL_NAME = <NIL> ]

SECONDS = 0.010
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14509772

SECONDS = 0.010
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216

SELECT R.RDB$FIELD_NAME
, R.RDB$RELATION_NAME
FROM RDB$RELATION_FIELDS R, RDB$FIELDS F
WHERE R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME
AND F.RDB$COMPUTED_SOURCE IS NOT NULL
AND NOT R.RDB$RELATION_NAME STARTING WITH 'RDB$'
ORDER BY 1 ASC

PLAN SORT (JOIN (F NATURAL,R INDEX (RDB$INDEX_3)))

FIELDS = [ Version 1 SQLd 2 SQLn 30
RDB$RELATION_FIELDS.RDB$FIELD_NAME = <NIL>
RDB$RELATION_FIELDS.RDB$RELATION_NAME = <NIL> ]

SECONDS = 0.010
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216
PARAMS = [ ]
----*/
/*---
COMMIT
TR_HANDLE = 14509772
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14509772
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216

SELECT F.RDB$FIELD_NAME F_FieldName
, F.RDB$RELATION_NAME F_RelationName
, F.RDB$DEFAULT_SOURCE F_DefaultSource
, D.RDB$DEFAULT_SOURCE D_DefaultSource
, D.RDB$FIELD_TYPE D_FieldType
FROM RDB$RELATION_FIELDS F
INNER JOIN RDB$FIELDS D
ON D.RDB$FIELD_NAME = F.RDB$FIELD_SOURCE
WHERE (( F.RDB$DEFAULT_SOURCE IS NOT NULL ) OR ( D.RDB$DEFAULT_SOURCE
IS NOT NULL ))
AND NOT F.RDB$RELATION_NAME STARTING WITH 'RDB$'
ORDER BY 1 ASC

PLAN SORT (JOIN (F NATURAL,D INDEX (RDB$INDEX_2)))

FIELDS = [ Version 1 SQLd 5 SQLn 30
RDB$RELATION_FIELDS.RDB$FIELD_NAME[F_FIELDNAME] = <NIL>
RDB$RELATION_FIELDS.RDB$RELATION_NAME[F_RELATIONNAME] = <NIL>
RDB$RELATION_FIELDS.RDB$DEFAULT_SOURCE[F_DEFAULTSOURCE] = <NIL>
RDB$FIELDS.RDB$DEFAULT_SOURCE[D_DEFAULTSOURCE] = <NIL>
RDB$FIELDS.RDB$FIELD_TYPE[D_FIELDTYPE] = <NIL> ]
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216
PARAMS = [ ]
----*/
/*---
COMMIT
TR_HANDLE = 14509772
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14515544
STMT_HANDLE = 14515380
PARAMS = [ Version 1 SQLd 1 SQLn 1
[DEPT_NO] = '623' ]

SECONDS = 0.010
----*/
/*---
ROLLBACK
TR_HANDLE = 14515544

SECONDS = 0.010
----*/
/*---
DISCONNECT DATABASE
DB_HANDLE = 14515648
----*/
/*---
CONNECT DATABASE C:\fb\examples\EMPLOYEE.GDB
DB_HANDLE = 14515648

SECONDS = 1.032
----*/
******** bitbtn2click
before open:ZZZ
/*---
DATABASE INFO
DB_HANDLE = 14515648
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14515544
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14515144
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14515144
STMT_HANDLE = 14515216

SELECT RDB$PROCEDURE_NAME
FROM RDB$PROCEDURES
ORDER BY RDB$PROCEDURE_NAME ASC

PLAN (RDB$PROCEDURES ORDER RDB$INDEX_21)

FIELDS = [ Version 1 SQLd 1 SQLn 30
RDB$PROCEDURES.RDB$PROCEDURE_NAME = <NIL> ]
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14515144
STMT_HANDLE = 14515216
PARAMS = [ ]
----*/
/*---
COMMIT
TR_HANDLE = 14515144
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14509776
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14509776
STMT_HANDLE = 14515216

SELECT S.RDB$FIELD_NAME
, I.RDB$RELATION_NAME
FROM RDB$RELATION_CONSTRAINTS C
, RDB$INDICES I
, RDB$INDEX_SEGMENTS S
WHERE C.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY'
AND C.RDB$RELATION_NAME = I.RDB$RELATION_NAME
AND C.RDB$INDEX_NAME = I.RDB$INDEX_NAME
AND I.RDB$INDEX_NAME = S.RDB$INDEX_NAME
ORDER BY I.RDB$RELATION_NAME ASC
, S.RDB$FIELD_POSITION ASC

PLAN SORT (JOIN (C NATURAL,I INDEX (RDB$INDEX_5,RDB$INDEX_31),S INDEX
(RDB$INDEX_6)))

FIELDS = [ Version 1 SQLd 2 SQLn 30
RDB$INDEX_SEGMENTS.RDB$FIELD_NAME = <NIL>
RDB$INDICES.RDB$RELATION_NAME = <NIL> ]

SECONDS = 0.010
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14509776
STMT_HANDLE = 14515216
PARAMS = [ ]

SECONDS = 0.010
----*/
/*---
COMMIT
TR_HANDLE = 14509776
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14515544
STMT_HANDLE = 14515380

SELECT *
FROM EMPLOYEE
where Dept_no = ? /* dept_no */

PLAN (EMPLOYEE INDEX (RDB$FOREIGN8))

FIELDS = [ Version 1 SQLd 11 SQLn 30
EMPLOYEE.EMP_NO = <NIL>
EMPLOYEE.FIRST_NAME = <NIL>
EMPLOYEE.LAST_NAME[LAST_NAME] = <NIL>
EMPLOYEE.PHONE_EXT[PHONE_EXT] = <NIL>
EMPLOYEE.HIRE_DATE[HIRE_DATE] = <NIL>
EMPLOYEE.DEPT_NO = <NIL>
EMPLOYEE.JOB_CODE = <NIL>
EMPLOYEE.JOB_GRADE = <NIL>
EMPLOYEE.JOB_COUNTRY = <NIL>
EMPLOYEE.SALARY = <NIL>
EMPLOYEE.FULL_NAME = <NIL> ]
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14509772
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216

SELECT R.RDB$FIELD_NAME
, R.RDB$RELATION_NAME
FROM RDB$RELATION_FIELDS R, RDB$FIELDS F
WHERE R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME
AND F.RDB$COMPUTED_SOURCE IS NOT NULL
AND NOT R.RDB$RELATION_NAME STARTING WITH 'RDB$'
ORDER BY 1 ASC

PLAN SORT (JOIN (F NATURAL,R INDEX (RDB$INDEX_3)))

FIELDS = [ Version 1 SQLd 2 SQLn 30
RDB$RELATION_FIELDS.RDB$FIELD_NAME = <NIL>
RDB$RELATION_FIELDS.RDB$RELATION_NAME = <NIL> ]

SECONDS = 0.010
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216
PARAMS = [ ]
----*/
/*---
COMMIT
TR_HANDLE = 14509772
----*/
/*---
START TRANSACTION
DB HANDLE COUNT 1
TR_HANDLE = 14509772
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216

SELECT F.RDB$FIELD_NAME F_FieldName
, F.RDB$RELATION_NAME F_RelationName
, F.RDB$DEFAULT_SOURCE F_DefaultSource
, D.RDB$DEFAULT_SOURCE D_DefaultSource
, D.RDB$FIELD_TYPE D_FieldType
FROM RDB$RELATION_FIELDS F
INNER JOIN RDB$FIELDS D
ON D.RDB$FIELD_NAME = F.RDB$FIELD_SOURCE
WHERE (( F.RDB$DEFAULT_SOURCE IS NOT NULL ) OR ( D.RDB$DEFAULT_SOURCE
IS NOT NULL ))
AND NOT F.RDB$RELATION_NAME STARTING WITH 'RDB$'
ORDER BY 1 ASC

PLAN SORT (JOIN (F NATURAL,D INDEX (RDB$INDEX_2)))

FIELDS = [ Version 1 SQLd 5 SQLn 30
RDB$RELATION_FIELDS.RDB$FIELD_NAME[F_FIELDNAME] = <NIL>
RDB$RELATION_FIELDS.RDB$RELATION_NAME[F_RELATIONNAME] = <NIL>
RDB$RELATION_FIELDS.RDB$DEFAULT_SOURCE[F_DEFAULTSOURCE] = <NIL>
RDB$FIELDS.RDB$DEFAULT_SOURCE[D_DEFAULTSOURCE] = <NIL>
RDB$FIELDS.RDB$FIELD_TYPE[D_FIELDTYPE] = <NIL> ]
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14509772
STMT_HANDLE = 14515216
PARAMS = [ ]
----*/
/*---
COMMIT
TR_HANDLE = 14509772
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 14515544
STMT_HANDLE = 14515380
PARAMS = [ Version 1 SQLd 1 SQLn 1
[DEPT_NO] = '623' ]
----*/
after open:623

can this mean anything for you?

Thank you again!

Kaadee Aon