Subject | Re: ASCII and ISO8859_1 |
---|---|
Author | zifnabbe |
Post date | 2004-05-02T14:20:49Z |
--- In firebird-support@yahoogroups.com, "zifnabbe" <zifnabbe@u...>
wrote:
a cast on the ascii column?
CREATE PROCEDURE SP_INSERTPERSON (
PERSONID VARCHAR(11) CHARACTER SET ASCII,
FIRSTNAME VARCHAR(32),
SECONDNAME VARCHAR(32),
LASTNAME VARCHAR(48),
STREETNAME VARCHAR(48),
STREETNUMBER SMALLINT,
BUSNUMBER VARCHAR(5),
POSTCODEID INTEGER,
BIRTHDATE TIMESTAMP)
AS
BEGIN
IF (EXISTS (SELECT PERSON_ID FROM PERSONS WHERE PERSON_ID
= :PERSONID)) THEN
BEGIN
UPDATE PERSONS SET
PERSON_FIRSTNAME = :FIRSTNAME,
PERSON_SECONDNAME = :SECONDNAME,
PERSON_LASTNAME = :LASTNAME,
PERSON_BIRTHDATE = :BIRTHDATE,
PERSON_STREETNAME = :STREETNAME,
PERSON_STREETNUMBER = :STREETNUMBER,
PERSON_BUSNUMBER = :BUSNUMBER,
POSTCODE_ID = :POSTCODEID
WHERE
PERSON_ID = :PERSONID;
SUSPEND;
END
ELSE
BEGIN
INSERT INTO PERSONS ( PERSON_ID,
PERSON_FIRSTNAME,
PERSON_SECONDNAME,
PERSON_LASTNAME,
PERSON_BIRTHDATE,
PERSON_STREETNAME,
PERSON_STREETNUMBER,
PERSON_BUSNUMBER,
POSTCODE_ID )
VALUES ( :PERSONID,
:FIRSTNAME,
:SECONDNAME,
:LASTNAME,
:BIRTHDATE,
:STREETNAME,
:STREETNUMBER,
:BUSNUMBER,
:POSTCODEID );
SUSPEND;
END
END
wrote:
> --- In firebird-support@yahoogroups.com, Helen Borrie<helebor@t...>
> wrote:I'm
> > At 11:41 AM 2/05/2004 +0000, you wrote:
> > >Hi,
> > >
> > >Is there a big difference between ASCII and ISO8859_1 character
> set?
> > >
> > >My default is set to ISO8859_1, but I've one ASCII column and
> nowthen
> > >wondering if I might not just set this ASCII column to ISO8859_1
> > >
> > >If I understand it correctly, if I keep using the ASCII table
> Icharacters,
> > >need to use CAST or the introducer form
> >
> > Yes, they are quite different. The ISO character sets use ANSI
> > encoding. But as well as different encoding, they support
> different
> > characters, as well. US ASCII doesn't support accented
> forIs the following code (which I use now) correct? Or do I've to force
> > example.
>
> Am I does correct to assume that the ASCII set is a subset in the
> ISO8859_1 set and would be able to change the ASCII Column to
> ISO8859_1 without a problem?
>
> Or is it better to change the procedures and sql statements to use
> CAST for the ASCII column?
>
a cast on the ascii column?
CREATE PROCEDURE SP_INSERTPERSON (
PERSONID VARCHAR(11) CHARACTER SET ASCII,
FIRSTNAME VARCHAR(32),
SECONDNAME VARCHAR(32),
LASTNAME VARCHAR(48),
STREETNAME VARCHAR(48),
STREETNUMBER SMALLINT,
BUSNUMBER VARCHAR(5),
POSTCODEID INTEGER,
BIRTHDATE TIMESTAMP)
AS
BEGIN
IF (EXISTS (SELECT PERSON_ID FROM PERSONS WHERE PERSON_ID
= :PERSONID)) THEN
BEGIN
UPDATE PERSONS SET
PERSON_FIRSTNAME = :FIRSTNAME,
PERSON_SECONDNAME = :SECONDNAME,
PERSON_LASTNAME = :LASTNAME,
PERSON_BIRTHDATE = :BIRTHDATE,
PERSON_STREETNAME = :STREETNAME,
PERSON_STREETNUMBER = :STREETNUMBER,
PERSON_BUSNUMBER = :BUSNUMBER,
POSTCODE_ID = :POSTCODEID
WHERE
PERSON_ID = :PERSONID;
SUSPEND;
END
ELSE
BEGIN
INSERT INTO PERSONS ( PERSON_ID,
PERSON_FIRSTNAME,
PERSON_SECONDNAME,
PERSON_LASTNAME,
PERSON_BIRTHDATE,
PERSON_STREETNAME,
PERSON_STREETNUMBER,
PERSON_BUSNUMBER,
POSTCODE_ID )
VALUES ( :PERSONID,
:FIRSTNAME,
:SECONDNAME,
:LASTNAME,
:BIRTHDATE,
:STREETNAME,
:STREETNUMBER,
:BUSNUMBER,
:POSTCODEID );
SUSPEND;
END
END