Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependent computed by fields not exported correctly [CORE2035] #2472

Open
firebird-automations opened this issue Aug 8, 2008 · 1 comment

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @cincuranet

Votes: 2

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 = http://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));

@firebird-automations
Copy link
Collaborator Author

Modified by: @cincuranet

summary: Dependencies on computed by fields not exported correctly => Dependent computed by fields not exported correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant