RE: Problem creating table from UNIONs

RE: Problem creating table from UNIONs

 

  

Use a column alias for all the function calls in your query e.g. the following
queries from the union will get the same column name
CREATE TABLE ROUTES AS
SELECT s.CODE_SIG_P_ID, s.DPM_DPN_MID, gf_geolatvalue(geo_lat) geo_lat,
gf_geolongvalue(geo_long) geo_long from
SIGNIFICANT_POINT s, DESIGNATED_POINT d
where s.DPM_DPN_MID= d.DPM_DPN_MID
UNION
SELECT s.CODE_SIG_P_ID, s.NDBM_CODE_NDB_ID, gf_geolatvalue(geo_lat),
gf_geolongvalue(geo_long) from
SIGNIFICANT_POINT s, NDB d
where s. NDBM_CODE_NDB_ID = d. NDBM_CODE_NDB_ID;

-----Original Message-----
From: Sowa
[mailto:oracledba-ezmlmshield-x63927039.[Email address protected]
Sent: Friday, December 03, 2004 12:09 PM
To: LazyDBA Discussion
Subject: Problem creating table from UNIONs


Hello All,

Here is my hickup!

I am trying to create a table from the following unions, but I get the ERROR

ORA-00998: must name this expression with a column alias


CREATE TABLE ROUTES AS
SELECT s.CODE_SIG_P_ID, s.DPM_DPN_MID, gf_geolatvalue(geo_lat),
gf_geolongvalue(geo_long) from
SIGNIFICANT_POINT s, DESIGNATED_POINT d
where s.DPM_DPN_MID= d.DPM_DPN_MID
UNION
SELECT s.CODE_SIG_P_ID, s.NDBM_CODE_NDB_ID, gf_geolatvalue(geo_lat),
gf_geolongvalue(geo_long) from
SIGNIFICANT_POINT s, NDB d
where s. NDBM_CODE_NDB_ID = d. NDBM_CODE_NDB_ID;

Could anyone lead me through.

Sowa



--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:http://www.lazydba.com/legal.html


==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================


Oracle LazyDBA home page