Home » SQL & PL/SQL » SQL & PL/SQL » Help needed
Help needed [message #275124] Thu, 18 October 2007 06:59 Go to next message
world.apps
Messages: 70
Registered: January 2007
Location: Hyderabad
Member
Hi,

I need to run fallowing SQL without UNION. When I run it with out Union I am getting fallowing error. Pls help me in this.


SQL> select 'a' 
  2  from dual
  3  union
  4  select 'b'
  5  from dual;
'
-
a
b

SQL> ed
Wrote file afiedt.buf

  1  select 'a'
  2  from dual
  3  select 'b'
  4* from dual
SQL> /
select 'b'
*
ERROR at line 3:
ORA-00933: SQL command not properly ended



Thanks in advance
Re: Help needed [message #275126 is a reply to message #275124] Thu, 18 October 2007 07:12 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Why?

The syntax for what you want to achieve is "union".

If there is a reason you can't use it, than that reason will most likely also apply to any workaround someone might come up with, so tell us the reason first.
Re: Help needed [message #275127 is a reply to message #275124] Thu, 18 October 2007 07:13 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Without union? So run it if you can!

I don't understand the problem, actually ... what are you trying to do?
Re: Help needed [message #275128 is a reply to message #275124] Thu, 18 October 2007 07:23 Go to previous messageGo to next message
flyboy
Messages: 1903
Registered: November 2006
Senior Member
What output do you expect from the query without UNION?

I guess, this is homework assignment on using Row Generator Techniques.
Re: Help needed [message #275147 is a reply to message #275124] Thu, 18 October 2007 09:04 Go to previous messageGo to next message
ora110
Messages: 42
Registered: September 2007
Location: China
Member
what do you want to do ?
you can't do it without a "union"
Re: Help needed [message #275157 is a reply to message #275147] Thu, 18 October 2007 10:18 Go to previous messageGo to next message
Michel Cadot
Messages: 68734
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
http://www.orafaq.com/forum/mv/msg/91133/275150/102589/#msg_275150

Regards
Michel
Re: Help needed [message #275243 is a reply to message #275147] Thu, 18 October 2007 23:18 Go to previous messageGo to next message
flyboy
Messages: 1903
Registered: November 2006
Senior Member
ora110 wrote on Thu, 18 October 2007 16:04

what do you want to do ?
you can't do it without a "union"

The same result can be achieved by SQL without UNION, however it is not 'simple' omitting the UNION word, but quite different concept.
Have you gone through the link I posted?

However as I do not exactly know what world.apps is trying to achieve, it is hard to tell more.
By the way, the thread title is very descriptive.

[Edit: added last paragraph]

[Updated on: Thu, 18 October 2007 23:23]

Report message to a moderator

Re: Help needed [message #275248 is a reply to message #275243] Thu, 18 October 2007 23:59 Go to previous messageGo to next message
codename3610
Messages: 1
Registered: October 2007
Location: Bangalore
Junior Member
Ya i too dnt get wat ur requirement is......

Well you are getting that error is coz there is no seprators or eof
between the 2 SQL statements...... two sql statements cnt be run like that......

if u want to really run 2 sql statements then you can put both ur sql statements in a file then run it.....

Eg:

if ur file is in D directory with name test.sql

then put the following satement in the file as it is:

select 'a' from dual;
select 'b' from dual;


now goto ur SQL client then run ur script by one of the following means:

SQL>@D:\test.sql

<OR>

SQL>START D:\test.sql
Re: Help needed [message #275250 is a reply to message #275124] Fri, 19 October 2007 00:11 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>Ya i too dnt get wat ur requirement is......
English is the language to be used in this forum.
YA may refer to:

Yahoo Answers 
Young adult 
Young adult literature, library and publishing classification 
Yottampere, unit of measurement 
Yet another... 
Yliopiston Apteekki 
yA may refer to:

Yoctoampere, unit of measurement 
Ya can mean:

Yes 
slang form of you 
Ya (Cyrillic) (Я), a Cyrillic alphabet letter (which, on its own, means "I" in several Slavic languages) 
Yaa - an Arabic letter 
An Arabic word meaning "O!" or "Oh!" 
Ya (kana) Romanisation of the Japanese kana や and ヤ 
Ya.com, a Spanish Internet service provider owned by the German communications giant T-Online. (homepage) 
Ya (arrow), a type of arrow. 
Ya (newspaper), a former Spanish Catholic newspaper. 



DNT can refer to:
Norwegian Mountain Touring Association, (In Norwegian, Den Norske Turistforening – DNT) 
DNT Record Distribution, a record label 
Dysembryoplastic neuroepithelial tumour - a type of low grade (WHO Grade I) brain tumour. 
Dinitrotoluene - Explosive 


wat
Quote:


A wat (derived from the Pali word avasa as well as from the Sanskrit word avasatha) is a monastery temple in Cambodia, Laos or Thailand. The word "wat" (Thai วัด) (sometimes rendered "vat" when referring to Laos) means "school." Strictly speaking a wat is a Buddhist temple and school with resident monks. A Buddhist site without resident monks cannot correctly be described as a wat, although the term is frequently used more loosely, even for ruins of ancient temples.

In everyday language in Thailand a wat is any place of worship except a mosque. Thus wat cheen is a Chinese temple (either Buddhist or Taoist), wat khaek is a Hindu temple, and wat kris or wat krit or wat fa-hrang is a Christian church.





ur
Quote:


Ur was an ancient city in southern Mesopotamia, located near the mouth (at the time) of the Euphrates and Tigris rivers on the Persian Gulf and close to Eridu. It is considered to be one of the earliest known civilizations in world history. Because of marine regression, the remains are now well inland in present-day Iraq, south of the Euphrates on its right bank, and named Tell el-Mukayyar [1], near the city of Nasiriyah south of Baghdad.

The site is marked by the ruins of a ziggurat (right), still largely intact, and by a settlement mound. The ziggurat is a temple of Nanna, the moon deity in Sumerian mythology, and has two stages constructed from brick: in the lower stage the bricks are joined together with bitumen, in the upper stage they are joined with mortar. The Sumerian name for this city was Urim.[2]


[Updated on: Fri, 19 October 2007 01:20] by Moderator

Report message to a moderator

Previous Topic: unix in Pl/sql blocks
Next Topic: add decode in a where clause
Goto Forum:
  


Current Time: Wed Feb 12 08:42:49 CST 2025