Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 15th, 2004, 09:23 AM
Tatsu Tatsu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 11 Tatsu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
view referencing another view

With firebird 1.5, views referencing another view raises
exceptions. Is there anybody experiencing this bug?
Actually, this is quite a fundamental deficiency as a relational
database and very disappointing. I sincerely hope this bug
will be crashed as soon as possible.

Reply With Quote
  #2  
Old June 15th, 2004, 03:54 PM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 8
Hi,

This works fine here.

Can you give us a reproducable case?

Or at least an example of a failure?

--
With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server.
Upscene Productions
http://www.upscene.com
__________________
Martijn Tonies
Database Workbench: developer IDE for Firebird, MySQL, InterBase, MSSQL Server and Oracle
Upscene Productions
http://www.upscene.com

Reply With Quote
  #3  
Old June 16th, 2004, 01:12 AM
Tatsu Tatsu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 11 Tatsu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you, Mr. Martijn Tonies,

I have a "sales" table with fields of "seller", "customer",
"item","sales","profit". The "sales" and "profit" field data type are double precision and other field data types are all varchar.

This table contains all sale activity record. And I first created the following view, using IBExpert personal.

1.
CREATE VIEW VI_TOTALPROFITSALES_BY_CUSTOMER(
CUSTOMER, PROFIT, SALES) AS
select customer, sum(profit), sum(sales) from sales
group by customer;

And then I create the following view.

2.
CREATE VIEW VI_PROFIT_RATE_BY_CUSTOMER(
CUSTOMER, PROFIT_RATE) AS
select customer, profit/sales*100 from vi_totalprofitsales_by_customer where sales <> 0;

And then, I created another view referencing the
above view as follows.

3.
CREATE VIEW VI_PROFITRATE_RANK_BY_CUSOTMER(
CUSTOMER,
PROFIT_RATE,
RANKING)
AS
select s.customer, s.profit_rate,
( select count(t.profit_rate) from vi_profit_rate_by_customer t
where s.profit_rate >= t.profit_rate) prate
from vi_profit_rate_by_customer s where s.profit_rate is not null;

And this last view raises the following exception:

"Arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow or string truncation."

Please let me know if you have a solution.

With regards,

Reply With Quote
  #4  
Old June 16th, 2004, 01:16 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 8
>>Please let me know if you have a solution

Not with only this info.

I'm just saying, that in general, this should work fine. I suggest you post your question -- with the table metadata and some sample data -- to the Firebird support list at Yahoogroups.com

Also, you might want to try and see if this error is data related.

Or do you get this error while creating the 3rd view?


With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server.
Upscene Productions
http://www.upscene.com

Reply With Quote
  #5  
Old June 16th, 2004, 05:51 AM
Tatsu Tatsu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 11 Tatsu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, Mr. Tonies,

I did not know where to send the relevant meta data.
Can I send the data to you alo by e-mail? But the data
are a lot...

Incidentally, for additional information, when inserting all
the data of the 2nd view into a table, say, temptable,
the 3rd view gets desired results from the temptable properly. So, I suspect that this exception raising is irrelevant to the meta data.

Please let us know your idea.

Reply With Quote
  #6  
Old June 16th, 2004, 05:58 AM
upscene upscene is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 223 upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level)upscene User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 7 h 14 m 50 sec
Reputation Power: 8
Hi,

Post it to Firebird support - if this is a bug and reproducable with your metadata and sample data, it will be forwarded to the Firebird developers.

--
Martijn Tonies

Reply With Quote
  #7  
Old June 16th, 2004, 06:13 AM
Tatsu Tatsu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 11 Tatsu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, Mr. Tonies,

I try sending the data to Firebird Support.

I appreciate your consistently quick advice.

With regards,

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > view referencing another view


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT