» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2007, 04:49 AM
Cigma Cigma is offline
Junior Member
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Cigma is on a distinguished road
Default Performing multi-line SQL statement

hi guys, I am running MySQL QB 1.1.19. I am wondering why every other SQL Query program can perform a multi-line SQL statement but MySQL QB can not? What is needed to do to make it work?
I am unable to execute this statement in QB in the SCRIPT window:

CREATE TRIGGER Inventory_BeforeDelete BEFORE DELETE ON Inventory
FOR EACH ROW
BEGIN
DELETE FROM InventoryProperty WHERE InventoryProperty.InventoryKey=OLD.InventoryKey;
END;

QB want's the entire thing on one line. Please help me in some way!
Thank you! -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 02-07-2007, 08:03 AM
Thalian Thalian is offline
Senior Member
 
Join Date: Jul 2006
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 18
Thalian is on a distinguished road
Default

MySQL QB has two SQL editors: the query area and the script editor. The first one is for single queries only and the other one is for multiple statements and can be used to step through the script. You are using the same delimiter for both, the command itself and the trigger text. So there must be at least a "delimiter xxx" command.
Open a script tab and put this code in:

delimiter $
CREATE TRIGGER Country_BeforeDelete BEFORE DELETE ON Country
FOR EACH ROW
BEGIN
DELETE FROM City WHERE City.ID = OLD.Capital;
END $ -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DiscountASP.NET Launches SQL Database Transfer Tool outsourcingplans Web Hosting News 0 08-09-2006 04:23 AM
sql statement for asp page dutchman ASP forums and Tips 1 08-08-2006 03:02 PM
DiscountASP.NET Introduces New Services outsourcingplans Web Hosting News 0 08-08-2006 07:42 AM
Re-invent Launches Free SQL 2005 Hosting outsourcingplans Web Hosting Industry 0 04-24-2006 08:41 PM
DiscountASP.NET Launches SQL 2005 & ASP.NET 2.0 Hosting outsourcingplans Web Hosting News 0 11-29-2005 02:50 PM


All times are GMT. The time now is 11:07 PM.