Subject | Re: [firebird-support] problem creating trigger FB 1.5 |
---|---|
Author | Thomas Steinmaurer |
Post date | 2011-11-15T10:05:03Z |
>> Would be interesting how they managed to add ACTION as a field in aPerhaps, yes. Still, having a field ACTION in a Firebird 1.5 dialect 1
> dialect 1 database then?
>
> The database used to be Interbase (and very old version of Interbase) and
> was converted
> a few years ago. Maybe that explains it.
is useless then, because you can't use it. ;-)
Regards,
Thomas
> RBS
>
> On Tue, Nov 15, 2011 at 9:58 AM, Thomas Steinmaurer<ts@...>wrote:
>
>> **
>>
>>
>>> I think action is a reserved keyword as doing a select a simple select
>> will
>>> give:
>>>
>>> Dynamic SQL Error
>>> SQL error code = -104
>>> Token unknown - line 1, char 8
>>> action
>>>
>>> Changing to dialect 3 looks tricky then and best to leave it till this is
>>> done by our
>>> software supplier.
>>
>> Would be interesting how they managed to add ACTION as a field in a
>> dialect 1 database then? Possibly connecting to the database with a
>> newer Firebird version, because e.g. in Firebird 2.5, I can add a field
>> ACTION in a dialect 1 database without problems.
>>
>> This all looks a bit fishy. ;-)
>>
>>
>> --
>> With regards,
>> Thomas Steinmaurer
>>
>> * Upscene Productions - Database Tools for Developers
>> http://www.upscene.com/
>>
>> * My Blog
>> http://blog.upscene.com/thomas/index.php
>>
>> * Firebird Foundation Committee Member
>> http://www.firebirdsql.org/en/firebird-foundation/
>>
>>> RBS
>>> On Tue, Nov 15, 2011 at 9:14 AM, Thomas Steinmaurer<ts@...
>>> wrote:
>>>
>>>> **
>>
>>>>
>>>>
>>>>> OK, Action was a bad choice of field name, but this was not ourselves
>> but
>>>>> the company that
>>>>> provides this software, iSoft.
>>>>> Is the only option then to change the database to dialect 3?
>>>>> Is that possible?
>>>>
>>>> Yes in general, it's a property at database level, but in practice, it's
>>>> more complicated, because:
>>>>
>>>> - The DATE data type only holds the date portion while in dialect 1 it
>>>> is date and time
>>>> - Using double-quotes for string delimiters fails in dialect 3, because
>>>> dialect 3 treats them as object names instead of string literals
>>>> - Numeric representation changed
>>>>
>>>> etc ...
>>>>
>>>> Switching to dialect 3 usually means:
>>>>
>>>> - Migrating data to dialect 3
>>>> - Entirely re-test the application
>>>>
>>>> I wonder if you can do a simple:
>>>>
>>>> select action from audit_trial
>>>>
>>>> In a Firebird 1.5 database? That said, I can't remember if ACTION is a
>>>> reserved keyword in 1.5.
>>>>
>>>>
>>>> --
>>>> With regards,
>>>> Thomas Steinmaurer
>>>>
>>>> * Upscene Productions - Database Tools for Developers
>>>> http://www.upscene.com/
>>>>
>>>> * My Blog
>>>> http://blog.upscene.com/thomas/index.php
>>>>
>>>> * Firebird Foundation Committee Member
>>>> http://www.firebirdsql.org/en/firebird-foundation/
>>>>
>>>>> RBS
>>>>>
>>>>> On Tue, Nov 15, 2011 at 8:49 AM, Bart Smissaert<
>> bart.smissaert@...
>>>>> wrote:
>>>>>
>>>>>>> Use non-reserved keywords as object names in a dialect 1 database
>>>>>>
>>>>>> Is there a way to do that?
>>>>>>
>>>>>> RBS
>>>>>>
>>>>>> On Tue, Nov 15, 2011 at 8:43 AM, Thomas Steinmaurer<
>> ts@...
>>>>>>> wrote:
>>>>>>
>>>>>>> **
>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Running Firebird 1.5, classic, dialect 1 on Windows and trying to
>>>>>>>> create a trigger like this:
>>>>>>>>
>>>>>>>> CREATE TRIGGER EXTENDED_TEXT_DEL FOR EXTENDED_TEXT
>>>>>>>> ACTIVE BEFORE DELETE
>>>>>>>> POSITION 10
>>>>>>>> AS
>>>>>>>> begin
>>>>>>>> insert into audit_trail
>>>>>>>> (Table_Id,"Action",Primary_Key,data)
>>>>>>>> values (45, 1,
>>>>>>>> old.Extended_Text_Type||"|"||
>>>>>>>> old.Foreign_Id||"|"||
>>>>>>>> old.Extended_Text_Sequence_No,
>>>>>>>> old.Extended_Text_Type||"|"||
>>>>>>>> old.Foreign_Id||"|"||
>>>>>>>> old.Extended_Text_Sequence_No||"|"||
>>>>>>>> old.Free_Text
>>>>>>>> );
>>>>>>>> END
>>>>>>>>
>>>>>>>> which will give the following error:
>>>>>>>>
>>>>>>>> Dynamic SQL Error
>>>>>>>> SQL error code = -817
>>>>>>>> Metadata update statement is not allowed by the current database SQL
>>>>>>> dialect 1.
>>>>>>>>
>>>>>>>> Note the double quotes around the field name Action.
>>>>>>>>
>>>>>>>> Any idea how I can run this statement?
>>>>>>>
>>>>>>> You can't with dialect 1. Delimited identifiers are supported by
>>>> dialect
>>>>>>> 3. Use non-reserved keywords as object names in a dialect 1 database.
>>>>>>>
>>>>>>> --
>>>>>>> With regards,
>>>>>>> Thomas Steinmaurer
>>>>>>>
>>>>>>> * Upscene Productions - Database Tools for Developers
>>>>>>> http://www.upscene.com/
>>>>>>>
>>>>>>> * My Blog
>>>>>>> http://blog.upscene.com/thomas/index.php
>>>>>>>
>>>>>>> * Firebird Foundation Committee Member
>>>>>>> http://www.firebirdsql.org/en/firebird-foundation/
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> [Non-text portions of this message have been removed]
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------
>>>>
>>>>>
>>>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>>
>>>>> Visit http://www.firebirdsql.org and click the Resources item
>>>>> on the main (top) menu. Try Knowledgebase and FAQ links !
>>>>>
>>>>> Also search the knowledgebases at http://www.ibphoenix.com
>>>>>
>>>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>> Yahoo! Groups Links
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> [Non-text portions of this message have been removed]
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>
>>> Visit http://www.firebirdsql.org and click the Resources item
>>> on the main (top) menu. Try Knowledgebase and FAQ links !
>>>
>>> Also search the knowledgebases at http://www.ibphoenix.com
>>>
>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>
>>
>>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>