Defining delimiters in mysql [duplicate]
This question already has an answer here:
syntax error: 'delimiter ' is not valid input here
2 answers
I am having trouble with creating a stored procedure in mySQL. I think the issue is that it is seeing my delimiter as a string, but I may be wrong. Here is my code:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichorderID int)
BEGIN
SELECT hslineitem.orderId, hsorders.orderdate, hslineitem.partNum, hslineitem.numOrdered,
hslineitem.price
FROM hslineitem, hsorders
WHERE hslineitem.orderId = hsorders.orderId
AND orderID = whichorderID ;
END
//
DELIMITER;
So, is there a specific way I need to identify that it is a delimiter and not a string? I have been looking at other examples online and it doesn't seem that they do anything differently. Thanks in advance!
mysql delimiter
marked as duplicate by Alex, Joe Stefanelli
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 22:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
|
show 3 more comments
This question already has an answer here:
syntax error: 'delimiter ' is not valid input here
2 answers
I am having trouble with creating a stored procedure in mySQL. I think the issue is that it is seeing my delimiter as a string, but I may be wrong. Here is my code:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichorderID int)
BEGIN
SELECT hslineitem.orderId, hsorders.orderdate, hslineitem.partNum, hslineitem.numOrdered,
hslineitem.price
FROM hslineitem, hsorders
WHERE hslineitem.orderId = hsorders.orderId
AND orderID = whichorderID ;
END
//
DELIMITER;
So, is there a specific way I need to identify that it is a delimiter and not a string? I have been looking at other examples online and it doesn't seem that they do anything differently. Thanks in advance!
mysql delimiter
marked as duplicate by Alex, Joe Stefanelli
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 22:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
1. How are you running this query? 2. Why did you choose//
? Did you try something else, such as$$
?
– Dark Falcon
Nov 21 '18 at 21:58
just switch delimiter back to what it was before ;-) . :-)END // DELIMITER ;
– Alex
Nov 21 '18 at 22:00
$$ did not work either. Those were the only two examples provided to me by my book, and also the only two I found online.
– C Reilly
Nov 21 '18 at 22:06
Alex, could you elaborate further on what you mean by what it was before? I'm not sure I understand.
– C Reilly
Nov 21 '18 at 22:06
1
Is it possibly just a missing space between "DELIMITER" and the last semicolon?
– Kaii
Nov 21 '18 at 22:08
|
show 3 more comments
This question already has an answer here:
syntax error: 'delimiter ' is not valid input here
2 answers
I am having trouble with creating a stored procedure in mySQL. I think the issue is that it is seeing my delimiter as a string, but I may be wrong. Here is my code:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichorderID int)
BEGIN
SELECT hslineitem.orderId, hsorders.orderdate, hslineitem.partNum, hslineitem.numOrdered,
hslineitem.price
FROM hslineitem, hsorders
WHERE hslineitem.orderId = hsorders.orderId
AND orderID = whichorderID ;
END
//
DELIMITER;
So, is there a specific way I need to identify that it is a delimiter and not a string? I have been looking at other examples online and it doesn't seem that they do anything differently. Thanks in advance!
mysql delimiter
This question already has an answer here:
syntax error: 'delimiter ' is not valid input here
2 answers
I am having trouble with creating a stored procedure in mySQL. I think the issue is that it is seeing my delimiter as a string, but I may be wrong. Here is my code:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichorderID int)
BEGIN
SELECT hslineitem.orderId, hsorders.orderdate, hslineitem.partNum, hslineitem.numOrdered,
hslineitem.price
FROM hslineitem, hsorders
WHERE hslineitem.orderId = hsorders.orderId
AND orderID = whichorderID ;
END
//
DELIMITER;
So, is there a specific way I need to identify that it is a delimiter and not a string? I have been looking at other examples online and it doesn't seem that they do anything differently. Thanks in advance!
This question already has an answer here:
syntax error: 'delimiter ' is not valid input here
2 answers
mysql delimiter
mysql delimiter
edited Nov 21 '18 at 22:06
Joe Stefanelli
110k13191207
110k13191207
asked Nov 21 '18 at 21:47
C ReillyC Reilly
365
365
marked as duplicate by Alex, Joe Stefanelli
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 22:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Alex, Joe Stefanelli
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 22:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
1. How are you running this query? 2. Why did you choose//
? Did you try something else, such as$$
?
– Dark Falcon
Nov 21 '18 at 21:58
just switch delimiter back to what it was before ;-) . :-)END // DELIMITER ;
– Alex
Nov 21 '18 at 22:00
$$ did not work either. Those were the only two examples provided to me by my book, and also the only two I found online.
– C Reilly
Nov 21 '18 at 22:06
Alex, could you elaborate further on what you mean by what it was before? I'm not sure I understand.
– C Reilly
Nov 21 '18 at 22:06
1
Is it possibly just a missing space between "DELIMITER" and the last semicolon?
– Kaii
Nov 21 '18 at 22:08
|
show 3 more comments
1
1. How are you running this query? 2. Why did you choose//
? Did you try something else, such as$$
?
– Dark Falcon
Nov 21 '18 at 21:58
just switch delimiter back to what it was before ;-) . :-)END // DELIMITER ;
– Alex
Nov 21 '18 at 22:00
$$ did not work either. Those were the only two examples provided to me by my book, and also the only two I found online.
– C Reilly
Nov 21 '18 at 22:06
Alex, could you elaborate further on what you mean by what it was before? I'm not sure I understand.
– C Reilly
Nov 21 '18 at 22:06
1
Is it possibly just a missing space between "DELIMITER" and the last semicolon?
– Kaii
Nov 21 '18 at 22:08
1
1
1. How are you running this query? 2. Why did you choose
//
? Did you try something else, such as $$
?– Dark Falcon
Nov 21 '18 at 21:58
1. How are you running this query? 2. Why did you choose
//
? Did you try something else, such as $$
?– Dark Falcon
Nov 21 '18 at 21:58
just switch delimiter back to what it was before ;-) . :-)
END // DELIMITER ;
– Alex
Nov 21 '18 at 22:00
just switch delimiter back to what it was before ;-) . :-)
END // DELIMITER ;
– Alex
Nov 21 '18 at 22:00
$$ did not work either. Those were the only two examples provided to me by my book, and also the only two I found online.
– C Reilly
Nov 21 '18 at 22:06
$$ did not work either. Those were the only two examples provided to me by my book, and also the only two I found online.
– C Reilly
Nov 21 '18 at 22:06
Alex, could you elaborate further on what you mean by what it was before? I'm not sure I understand.
– C Reilly
Nov 21 '18 at 22:06
Alex, could you elaborate further on what you mean by what it was before? I'm not sure I understand.
– C Reilly
Nov 21 '18 at 22:06
1
1
Is it possibly just a missing space between "DELIMITER" and the last semicolon?
– Kaii
Nov 21 '18 at 22:08
Is it possibly just a missing space between "DELIMITER" and the last semicolon?
– Kaii
Nov 21 '18 at 22:08
|
show 3 more comments
1 Answer
1
active
oldest
votes
You statement is missing a space before the last semicolon, because the semicolon in this case is really a parameter for the DELIMITER
command.
Only after resetting the delimiter back to semicolon it can be used normally:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichID int)
BEGIN
SELECT *
FROM orders
WHERE id = whichID; -- this semicolon is interpreted as text
END//
DELIMITER ; -- space is needed here!
SELECT 1 FROM dual; -- but not here.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You statement is missing a space before the last semicolon, because the semicolon in this case is really a parameter for the DELIMITER
command.
Only after resetting the delimiter back to semicolon it can be used normally:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichID int)
BEGIN
SELECT *
FROM orders
WHERE id = whichID; -- this semicolon is interpreted as text
END//
DELIMITER ; -- space is needed here!
SELECT 1 FROM dual; -- but not here.
add a comment |
You statement is missing a space before the last semicolon, because the semicolon in this case is really a parameter for the DELIMITER
command.
Only after resetting the delimiter back to semicolon it can be used normally:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichID int)
BEGIN
SELECT *
FROM orders
WHERE id = whichID; -- this semicolon is interpreted as text
END//
DELIMITER ; -- space is needed here!
SELECT 1 FROM dual; -- but not here.
add a comment |
You statement is missing a space before the last semicolon, because the semicolon in this case is really a parameter for the DELIMITER
command.
Only after resetting the delimiter back to semicolon it can be used normally:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichID int)
BEGIN
SELECT *
FROM orders
WHERE id = whichID; -- this semicolon is interpreted as text
END//
DELIMITER ; -- space is needed here!
SELECT 1 FROM dual; -- but not here.
You statement is missing a space before the last semicolon, because the semicolon in this case is really a parameter for the DELIMITER
command.
Only after resetting the delimiter back to semicolon it can be used normally:
DELIMITER //
CREATE PROCEDURE getOrderInfo (IN whichID int)
BEGIN
SELECT *
FROM orders
WHERE id = whichID; -- this semicolon is interpreted as text
END//
DELIMITER ; -- space is needed here!
SELECT 1 FROM dual; -- but not here.
edited Nov 21 '18 at 22:21
answered Nov 21 '18 at 22:11
KaiiKaii
15.2k22748
15.2k22748
add a comment |
add a comment |
1
1. How are you running this query? 2. Why did you choose
//
? Did you try something else, such as$$
?– Dark Falcon
Nov 21 '18 at 21:58
just switch delimiter back to what it was before ;-) . :-)
END // DELIMITER ;
– Alex
Nov 21 '18 at 22:00
$$ did not work either. Those were the only two examples provided to me by my book, and also the only two I found online.
– C Reilly
Nov 21 '18 at 22:06
Alex, could you elaborate further on what you mean by what it was before? I'm not sure I understand.
– C Reilly
Nov 21 '18 at 22:06
1
Is it possibly just a missing space between "DELIMITER" and the last semicolon?
– Kaii
Nov 21 '18 at 22:08