CaesarII Posted August 9, 2012 Share Posted August 9, 2012 In regards to the DVD database in my earlier post, I’m trying to create some code that will cause a button on the main menu to go to one data block if the number of copies of a dvd is above 0 and another data block if the number of dvd's is 0. I was thinking about something along the lines of; select VIDEO_CARD.NO_OF_COPIES from VIDEO_CARDBEGIN WHERE VIDEO_CARD.NO_OF_COPIES > 0go_block('Rental_Card')OTHERWISEgo_block('reservation_card')end/ Any help would be appreciated Link to comment Share on other sites More sharing options...
justsomeguy Posted August 9, 2012 Share Posted August 9, 2012 You don't use a WHERE clause like that, and I don't think PL/SQL has an "OTHERWISE". You should use if/then/else. http://docs.oracle.com/cd/E14072_01/appdev.112/e10472/controlstatements.htm Link to comment Share on other sites More sharing options...
CaesarII Posted August 13, 2012 Author Share Posted August 13, 2012 thanks Link to comment Share on other sites More sharing options...
CaesarII Posted August 13, 2012 Author Share Posted August 13, 2012 I’ve come up with the following:select VIDEO_CARD.NO_OF_COPIES from VIDEO_CARDDECLARE NUM (number ="0");BEGINIF VIDEO_CARD.NO_OF_COPIES > NUM THENgo_block('Rental_Card');ELSEgo_block('reservation_card');end if;end; however whenever i try and compile it, it comes up with error 103 Link to comment Share on other sites More sharing options...
justsomeguy Posted August 13, 2012 Share Posted August 13, 2012 What is error 103? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now