Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

join without use of UNION 2

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Table A contains a reference no, a date, & an amount, for transactions up to & including yesterday. Table B contains the same 3 fields for today's transactions. Reference Numbers in Table A might not be in Table B. I need to write a VIEW to merge them, for later use in a Stored Procedure.
I cannot, however use a "UNION" in my VIEW to achieve this, as my run-time environment returns an error.
 
Why not merge your two "tables" in your stored procedure, and avoid this problem altogether? Malcolm
 
Thanks Malcolm, but Table A is absolutely ginormous, & so this obvious option isn't a starter.
 
Your view may be failing because UNION requires a sort, which tends to fail within a view specification. However, UNION ALL does not do a sort since it does not try to weed out duplicate rows. This might just do the trick for you.
 
I just tried creating a view with a UNION in Oracle and it works OK. What RDBMS are you using?
 
Thanks Carp.
I get the message "Set Operators May Not Appear Within The Definition Of A View" when I use "Union" or "Union All" in my VIEW, hence the need to program around this limitation.
The o/s is AIX 4.1.4, with a SYBASE 11.5.1 DB.
Help !
 
I don't know Sybase, but some how, I get the feeling there is something else causing this error. Any chance you can paste the code here? Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top