Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8920137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:11:34+00:00 2026-06-15T06:11:34+00:00

A DDL script to create a trigger (source below) fails with 2 errors: Statement

  • 0

A DDL script to create a trigger (source below) fails with 2 errors:

Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command – line 3, column 44
After line 0 in file C:\CRMDemo\Database\DDL\Trigger_Orders.sql
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown – line 1, column 1
-end
At line 14 in file C:\CRMDemo\Database\DDL\Trigger_Orders.sql

(line 3, column 44 looks like it may be the closing parthesis).
I can’t find any information about errors 42000 or -104.
The trigger is designed to assign a record number from a generator, which does exist. This trigger works properly in Interbase from the same script.
The only thing I can think of is that the column size, Integer, is incorrect for the value returned. But the documentation says the value may be truncated but should work for the expected value (1).

CREATE TRIGGER ORDERS_GENERATE_KEY FOR ORDERS ACTIVE BEFORE INSERT POSITION 95 AS
begin
  NEW.ORDER_NR = GEN_ID(NEW_ORDER_NUMBER, 1);
end;

Firebird is ver 2.5.2, just downloaded. Windows 7. Database should be 32bit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:11:36+00:00Added an answer on June 15, 2026 at 6:11 am

    If you run your statement using isql utility take sure that SET TERM operators are used:

    SET TERM ^ ;
    
    CREATE TRIGGER ORDERS_GENERATE_KEY FOR ORDERS 
      ACTIVE 
      BEFORE INSERT 
      POSITION 95 
    AS
    begin
      NEW.ORDER_NR = GEN_ID(NEW_ORDER_NUMBER, 1);
    end
    ^
    
    SET TERM ; ^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sql /ddl script containing CREATE TABLE commands. I use hibernate and
I encountered the following ddl in a pl/sql script this morning: create index genuser.idx$$_0bdd0011
How would one write a sql server DDL script that can: For each table
I have a DDL and Button which when clicked create a dynamic table; all
I am using SQL Manager Lite to try to run a DDL Create Table
I am assigned the task by manager to create a DDL script. One of
I have a tool that generates a DDL script create table ATTRIBUTE_VALUE ( id
I have some sql script files where i am making some DDL changes as
Is there a way to create the tables through a SQL script when the
is there a possibility to execute an sql script, after EclipseLink generated the ddl?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.