Issue Details (XML | Word | Printable)

Key: CORE-2035
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Jiri Cincura
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Dependent computed by fields not exported correctly

Created: 08/Aug/08 04:13 PM   Updated: 08/Aug/08 04:13 PM
Component/s: ISQL
Affects Version/s: 2.1.1
Fix Version/s: None

Environment: Linux, 32b, NPTL


 Description  « Hide
I have two tables orders (1) and order_items (N). If I add computed field to table orders to fetch some data from order_items, then using isql -x to extract DDL script includes this fields in table creation. So using the script to create same structure fails.

Here's the sample of wrong script:

CREATE TABLE ORDERS (ID BIGINT NOT NULL,
...
        TOTAL_ORDER_PRICE COMPUTED BY ((select coalesce(sum(total_item_price), 0) from order_items where order_items.id_order = orders.id) * ((100 - promo_code_discount) / 100)),
PRIMARY KEY (ID));

CREATE TABLE ORDER_ITEMS (ID BIGINT NOT NULL,
        ID_ORDER BIGINT NOT NULL,
        ITEM_NAME VARCHAR200 NOT NULL,
        NUMBER_OF_ITEMS INTEGER NOT NULL,
        PRICE_PER_ITEM MONEY NOT NULL,
        DISCOUNT DISCOUNT NOT NULL,
        PRICE_PER_ITEM_WITH_DISCOUNT COMPUTED BY (price_per_item * ((100 - discount) / 100)),
        TOTAL_ITEM_PRICE COMPUTED BY (price_per_item_with_discount * number_of_items),
PRIMARY KEY (ID));

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.