Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> simple VIEW questions

simple VIEW questions

From: John M Forbes <forbes_at_world.std.com>
Date: 1997/04/23
Message-ID: <E943BK.CxI@world.std.com>#1/1

Here's the requirement:
Another product will be accessing the Oracle database via SQLnet. It requires a single table/view with a primary key. I am building a view for it to use from two tables. Each table has a numeric primary key.
So I'm doing something like:

create view foo (primary key mykey, boo, goo) as
select (convert(varchar(16), tbl1.pkey) + convert(varchar(16), tbl2.pkey)), tbl1.field1, tbl2.field2
from tbl1, tbl2

I'm getting a 'missing expression' on the 'select' line.

a) is my syntax bust?
b) is the approach bust? (i.e. making a primary key this way)
c) what's the 'right' way to do this?
d) do views support [synthesized] primary keys?
(I added the 'primary key' in the field name just now- that might produce an error too...?)
I don't care what the view's primary key is, just that it's there for this other app; can I stick a simple auto-increment counter in here?

best to email replies to forbes_at_world.std.com thanks in advance!

-- 
Received on Wed Apr 23 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US