Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How to replace null string fileds with empty strings in a trigger

2 posts in Trigger Last posting was on 2007-05-04 15:27:42.0Z
Miguel Angel Gavidia Posted on 2007-05-03 17:01:42.0Z
Reply-To: "Miguel Angel Gavidia" <mgavidia@sire.com.mx>
From: "Miguel Angel Gavidia" <mgavidia@sire.com.mx>
Newsgroups: advantage.trigger
Subject: How to replace null string fileds with empty strings in a trigger
Date: Thu, 3 May 2007 12:01:42 -0500
Lines: 11
Organization: SIRE
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: 8.14.246.243
Message-ID: <463a1460@solutions.advantagedatabase.com>
X-Trace: 3 May 2007 10:57:04 -0700, 8.14.246.243
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!8.14.246.243
Xref: solutions.advantagedatabase.com Advantage.Trigger:333
Article PK: 1136398

Hello
I need to replace all my string fields in all my tables when inserting and
when updating with empty string, i'm using tadstables to insert, delete and
update my Database and i want to use a trigger with only the code to replace
the fields for example x and y in anytable to empty string.

thank you in advance

Miguel Gavidia


Jeremy Mullin Posted on 2007-05-04 15:27:42.0Z
Date: Fri, 4 May 2007 15:27:42 +0000 (UTC)
Message-ID: <e96e9af22a5308c95c4599bfc8d8@devzone.advantagedatabase.com>
From: Jeremy Mullin <no@email.com>
Subject: Re: How to replace null string fileds with empty strings in a trigger
Newsgroups: Advantage.Trigger
References: <463a1460@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.24.38.100
X-Trace: 4 May 2007 09:23:07 -0700, 10.24.38.100
Lines: 49
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.100
Xref: solutions.advantagedatabase.com Advantage.Trigger:334
Article PK: 1136399

Hi Miguel,

This doesn't help with the trigger, but I may have a different solution that
is easier and more efficient. If you are using a newer version of the TDataSet
(I think 8.0 or 8.1) you can use the AdsTableOptions.AdsPreserveSpaces option,
which will write empty strings instead of NULLs. I've included the help page
text below.

J.D. Mullin
Advantage R&D


AdsTableOptions.AdsPreserveSpaces

Boolean flag used to specify if you want character fields set as empty strings
to be written as a buffer of spaces instead of converted to a NULL/empty
value.

Syntax

property AdsTableOptions.AdsPreserveSpaces

Description

The default value of this option is False, which will result in behavior
that mimics Paradox behavior, where empty strings are set as NULL when posting
new field values.
If you change this option to True, any character fields that are assigned
an empty string value, or are assigned a buffer of spaces, will be written
as such, and will not be converted into a NULL value.
Note that fields that are not specifically set (during an append/insert operation,
for example) will still contain NULL values unless you explicitly set the
fields to contain empty strings.

> Hello
> I need to replace all my string fields in all my tables when inserting
> and
> when updating with empty string, i'm using tadstables to insert,
> delete and
> update my Database and i want to use a trigger with only the code to
> replace
> the fields for example x and y in anytable to empty string.
> thank you in advance
>
> Miguel Gavidia
>