Subject | [ib-support] Casting from integer to varchar datatype.. |
---|---|
Author | Rotandiko Sastroprawiro |
Post date | 2002-06-21T01:48:34Z |
Hello all,
I have query SQL at Store Procedure like this :
FOR SELECT DISTINCT MO.OBJECT_ID, MO.LOCALE_ID, MO.OBJECT_NAME,
MO.OBJECT_VALUES, MO.OBJECT_TYPE_ID, MOT.OBJECT_TYPE_NAME
FROM M_OBJECTS MO, M_OBJECT_TYPE MOT, M_CONTENTS MC
WHERE (MO.OBJECT_TYPE_ID = MOT.OBJECT_TYPE_ID AND
CAST(MC.CONTENT_ID AS VARCHAR(255)) = MO.OBJECT_VALUES)
AND MO.LOCALE_ID = 1
INTO :OBJID, :OBJLCLID, :OBJNM, OBJVL, :OBJTPID, :OBJTPNM
DO
SUSPEND;
the result is data from M_OBJECTS where MO.LOCALE_ID = 1 and
MO.OBJECT_VALUES = CAST(MC.CONTENT_ID AS VARCHAR(255))
like i want, but when i change
...WHERE (MO.OBJECT_TYPE_ID = MOT.OBJET_TYPE_ID AND
CAST(MC.CONTENT_ID AS VARCHAR(255)) != MO.OBJECT_VALUES)
AND MO.LOCALE = 1...
the result is all data in M_OBJECTS include the result above
(MO.OBJECT_VALUES = CAST(MC.CONTENT_ID AS VARCHAR(255)) which
i want their not include in the result.
why it happen ??
note : MC.CONTENT_ID is INTEGER.
Thanks,
Diko
I have query SQL at Store Procedure like this :
FOR SELECT DISTINCT MO.OBJECT_ID, MO.LOCALE_ID, MO.OBJECT_NAME,
MO.OBJECT_VALUES, MO.OBJECT_TYPE_ID, MOT.OBJECT_TYPE_NAME
FROM M_OBJECTS MO, M_OBJECT_TYPE MOT, M_CONTENTS MC
WHERE (MO.OBJECT_TYPE_ID = MOT.OBJECT_TYPE_ID AND
CAST(MC.CONTENT_ID AS VARCHAR(255)) = MO.OBJECT_VALUES)
AND MO.LOCALE_ID = 1
INTO :OBJID, :OBJLCLID, :OBJNM, OBJVL, :OBJTPID, :OBJTPNM
DO
SUSPEND;
the result is data from M_OBJECTS where MO.LOCALE_ID = 1 and
MO.OBJECT_VALUES = CAST(MC.CONTENT_ID AS VARCHAR(255))
like i want, but when i change
...WHERE (MO.OBJECT_TYPE_ID = MOT.OBJET_TYPE_ID AND
CAST(MC.CONTENT_ID AS VARCHAR(255)) != MO.OBJECT_VALUES)
AND MO.LOCALE = 1...
the result is all data in M_OBJECTS include the result above
(MO.OBJECT_VALUES = CAST(MC.CONTENT_ID AS VARCHAR(255)) which
i want their not include in the result.
why it happen ??
note : MC.CONTENT_ID is INTEGER.
Thanks,
Diko