got it... for anyone who's interested...

got it... for anyone who's interested...

Post by Andy Gans » Fri, 27 Feb 1998 04:00:00



Quote:>A guy in another newsgroup said he remembered some kind of Oracle
>extensions to handle tree-structured data in tables, but he didn't
>remember what they were and I can't seem to find anything about it
>in my manuals.And he was right.  (I finally found it.)  Oracle has a feature called

'hierarchical queries', just for this purpose.  They involve some extra
clauses that are added to your SQL statement, including keywords such
as CONNECT BY and START WITH.  You can find them in the Oracle SQL
Language Reference Manual...
-Andy
 
 
 

1. help with interesting 'query'

hi

        i need the 'groups' help with a query.  hopefully someone will be
able to help.  i have two tables ...

create table foo
(
        id      varchar (10)
        f1      varchar (5)
        f2      int
        f3      varchar (5)
        f4      int
        f5      varchar (5)
        f6      int
        f7      varchar (5)
        f8      int
)

create table fooExtended
(
        id      varchar (10)
        f1      varchar (5)
        f2      int
        f3      varchar (5)
        f4      int
        f5      varchar (5)
        f6      int
        f7      varchar (5)
        f8      int
)

one is obviously a copy of the other.  the contents of foo will be
overriden on a daily basis - we purchase our data from an outside
provider.  however, we extend the data by changing the value of some
subset of the non-primary key fields (id is the primary key).  i need to
be able to perform a query that given an 'id' will retrieve any non null
values from fooExtended but if a field is null in fooExtended will
retrieve its value from foo.

        i realize that one way of solving this is to make fooExtended a
complete copy of foo when and if we extend any of its values - but that
is expensive in terms of storage.  i'm hoping to use a more
efficient/elegant solution.

        here's another question....

        is it possible to programmatically supply a table name, the fields
and predicates used in a query ?  for instance

exec doQuery 'employee', 'emp_id, fname, lname', 'where fname like a%'

doQuery is a stored procedure that programmatically 'builds' a query.  
the above will result in the following query being built

select emp_id, fname, lname
from employee
where fname like 'a%'

for what its worth i'm using ms-sql server 6.5.

any help would be greatly appreciated.

thanks
dave

2. Version.

3. Interesting 'undocumented feature'

4. Multi rows selection in MSFLEXGRID

5. Interesting behaviour of : LIKE @v + '%'

6. Wordtech Systems R&R Version for Oracle?

7. er, 'interesting' new 9i feature

8. beginer problems opening database via ADO front end on network

9. help with interesting 'query'

10. Anyone interested?

11. Anyone Interested?

12. Anyone interested in WYSIWYG (XSL based) XML editor

13. In case anyone is interested.....(Answer to Identity column question)