Main Page | Report this Page
Computers Forum Index  »  Computer - Databases - Sybase  »  Can a view be used inside a derived tables?...
Page 1 of 1    

Can a view be used inside a derived tables?...

Author Message
toedipper...
Posted: Sat Jul 26, 2008 4:19 am
Guest
Hi all,

We have a Nortel symposium telecoms system which uses Sybase to store
details of all the calls etc.

Now, Symposium does not allow access to the tables so we have to use
pre-configed views.

There is no problem using this for basic selects.

However, can these views be used inside derived tables?

Why I ask...

This works

SELECT
blah
,blah
,blah
FROM
someview
WHERE
somefieldintheview = this


This does'nt

SELECT
*
FROM
(
SELECT
blah
,blah
,blah
FROM
someview
WHERE
somefieldintheview = this
) a

The above fails with 2 syntax errors, the first pointing at the 2nd
select and the 2nd pointing at the last bracket.

Any ideas?

cheers,

toe
 
Bret_Halford...
Posted: Mon Jul 28, 2008 4:03 am
Guest
When you say "Sybase", which version of which Sybase product are you
asking about?

Does the version you are using support derived tables at all?
 
mpeppler at (no spam) peppler.org...
Posted: Tue Jul 29, 2008 12:16 pm
Guest
On Jul 26, 1:19 am, toedipper <send_rubbish_here... at (no spam) hotmail.com>
wrote:
Quote:
Hi all,

We have a Nortel symposium telecoms system which uses Sybase to store
details of all the calls etc.

Now, Symposium does not allow access to the tables so we have to use
pre-configed views.

There is no problem using this for basic selects.

However, can these views be used inside derived tables?

Why I ask...

This works

SELECT
   blah
  ,blah
  ,blah
FROM
  someview
WHERE
  somefieldintheview = this

This does'nt

SELECT
   *
FROM
   (
   SELECT
     blah
    ,blah
    ,blah
  FROM
   someview
  WHERE
  somefieldintheview = this
) a

The above fails with 2 syntax errors, the first pointing at the 2nd
select and the 2nd pointing at the last bracket.

Any ideas?

cheers,

toe

Derived tables with views works (I use them in 12.5.4) - so my guess
(as Bret says) is that you have a version of ASE that doesn't support
derived tables.

Michael
 
ThanksButNo...
Posted: Thu Aug 07, 2008 1:01 am
Guest
On Aug 6, 2:42 pm, toedipper <send_rubbish_here... at (no spam) hotmail.com> wrote:

Quote:
Hi,

Can anyone tell me how to find out what version of Sybase I'm running?
I know it's ASE but I access it remotely, are there any commands/queries
I can type to display the exact version?

Cheers,

toe

$ isql -Uuser -Ppassword -Etcetera
1> select at (no spam) at (no spam) version
2> go
 
toedipper...
Posted: Thu Aug 07, 2008 2:42 am
Guest
toedipper wrote:
Quote:
Hi all,

We have a Nortel symposium telecoms system which uses Sybase to store
details of all the calls etc.

Now, Symposium does not allow access to the tables so we have to use
pre-configed views.

There is no problem using this for basic selects.

However, can these views be used inside derived tables?

Why I ask...

This works

SELECT
blah
,blah
,blah
FROM
someview
WHERE
somefieldintheview = this


This does'nt

SELECT
*
FROM
(
SELECT
blah
,blah
,blah
FROM
someview
WHERE
somefieldintheview = this
) a

The above fails with 2 syntax errors, the first pointing at the 2nd
select and the 2nd pointing at the last bracket.

Any ideas?

cheers,

toe
Hi,


Can anyone tell me how to find out what version of Sybase I'm running?
I know it's ASE but I access it remotely, are there any commands/queries
I can type to display the exact version?

Cheers,

toe
 
toedipper...
Posted: Fri Aug 08, 2008 1:01 am
Guest
toedipper wrote:
Quote:
Hi all,

We have a Nortel symposium telecoms system which uses Sybase to store
details of all the calls etc.

Now, Symposium does not allow access to the tables so we have to use
pre-configed views.

There is no problem using this for basic selects.

However, can these views be used inside derived tables?

Why I ask...

This works

SELECT
blah
,blah
,blah
FROM
someview
WHERE
somefieldintheview = this


This does'nt

SELECT
*
FROM
(
SELECT
blah
,blah
,blah
FROM
someview
WHERE
somefieldintheview = this
) a

The above fails with 2 syntax errors, the first pointing at the 2nd
select and the 2nd pointing at the last bracket.

Any ideas?

cheers,

toe

Hi all,

Managed to find the version of Sybase we use (below) does this support
derived table and/or using views inside derived tables?

Cheers,

toe


Adaptive Server Enterprise/12.5.0.3/EBF 11449 ESD#4/P/NT
(IX86)/OS4.0/rel12503/1939/32-bit/OPT/Sat Sep 20 22:28:57 2003
 
mpeppler at (no spam) peppler.org...
Posted: Fri Aug 08, 2008 3:04 pm
Guest
On Aug 7, 10:01 pm, toedipper <send_rubbish_here... at (no spam) hotmail.com>
wrote:
Quote:
toedipper wrote:
Hi all,

We have a Nortel symposium telecoms system which uses Sybase to store
details of all the calls etc.

Now, Symposium does not allow access to the tables so we have to use
pre-configed views.

There is no problem using this for basic selects.

However, can these views be used inside derived tables?

Why I ask...

This works

SELECT
  blah
 ,blah
 ,blah
FROM
 someview
WHERE
 somefieldintheview = this

This does'nt

SELECT
  *
FROM
  (
  SELECT
    blah
   ,blah
   ,blah
 FROM
  someview
 WHERE
 somefieldintheview = this
) a

The above fails with 2 syntax errors, the first pointing at the 2nd
select and the 2nd pointing at the last bracket.

Any ideas?

cheers,

toe

Hi all,

Managed to find the version of Sybase we use (below) does this support
derived table and/or using views inside derived tables?

Cheers,

toe

Adaptive Server Enterprise/12.5.0.3/EBF 11449 ESD#4/P/NT
(IX86)/OS4.0/rel12503/1939/32-bit/OPT/Sat Sep 20 22:28:57 2003

No - you would need 12.5.1 or later.

Michael
 
 
Page 1 of 1    
All times are GMT
The time now is Sun Mar 21, 2010 9:29 pm