Welcome! Log In Create A New Profile

Advanced

Q10

Posted by ShaunGVW 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Q10
July 27, 2010 08:33PM
Question asks for a staement to do the following.... and then gives the requirements.
Are we supposed to achieve it all in one statement? I don't see how you can insert into multiple tables in one statement.
Would need minimum of three statements.

Any ideas?
Re: Q10
July 28, 2010 12:26PM
There is a way to insert into each table depending on the criteria with only one statement. Have a look at the INSERT WHEN clause. I don't have my books with me so I can't give the reference off-hand.
Re: Q10
July 28, 2010 12:32PM
I used the INSERT WHEN clause. So if the condition is true, then insert into one table and then if the condition is not true, insert into the other tables. So basicall, INSERT WHEN....ELSE...

I also used a SET OPERATOR.

I found this question very tricky but it gives me the same results as per the assignment if I enter in < 6000.
Re: Q10
July 28, 2010 01:35PM
Ok, thanks. I will look at it again tonight.
Re: Q10
July 28, 2010 08:33PM
I can't seem to find reference to "INSERT WHEN" clause?
avatar Re: Q10
July 29, 2010 09:37AM
ShaunGVW Wrote:
-------------------------------------------------------
> I can't seem to find reference to "INSERT WHEN"
> clause?
It is in the second book (manual "something" II) - I think chapter 3 or 5 (you'll have to page around a bit but it is there). Btw. I think the manuals are terrible for finding anything and learning SQL. Look on the Oracle website, they have free PDF manuals that are much better for finding stuff. Just make sure that whatever you use is in the syllabus.
Re: Q10
July 29, 2010 09:51AM
I did eventually find reference to "WHEN" command, to do with CASE and DECODE.
I agree with what you say about finding stuff. There is an index at the end of manual 2, but "WHEN" wasn't in it.

I have now managed to find some examples on the 'net, so will try again tonight.
avatar Re: Q10
July 29, 2010 10:51AM
I just remembered it is in the chapter called "Chapter 5: Manipulating Large Data Sets" or something like that, towards the end of the chapter.
Re: Q10
July 29, 2010 10:59AM
Have a look at Lesson 3 in the second manual. It shows you how to insert into multiple tables and also how to set conditions to insert.
avatar Re: Q10
July 29, 2010 01:51PM
Sorry, yes it's in chapter 3, not 5 like I said previously.
Re: Q10
July 29, 2010 08:41PM
Thanks for the help.
Figured it out, got the correct results, although I'm not sure I quite understand the question, but anyway!
Time to put them all together and submit!!smileys with beer
Re: Q10
August 06, 2010 02:17PM
Hi guys.
I am having a hard time uploading the 3 scripts from the labs folder. Any help would be appreciated. Thanx. hot smiley
Re: Q10
August 06, 2010 02:19PM
open the scripts in wordpad, copy, paste in Oracle & run
Re: Q10
August 06, 2010 11:42PM
Thanx... Kinda figured that out later on... silly me tho.
Sorry, only registered users may post in this forum.

Click here to login