![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Would anyone know why this doesn't run delimiter // CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ',s,'!'); // delimiter ; SELECT hello('world'); It comes from the MYSQL Help File. scooper |
|
hello('world') | +----------------------------------------------------+ Hello, world ! | +----------------------------------------------------+ |
|
@@version | +-----------+ 5.1.42 | +-----------+ |
#3
| |||
| |||
|
|
On 6 mar, 11:04, "scooper" <robert... (AT) internode (DOT) on.net> wrote: Would anyone know why this doesn't run delimiter // CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ',s,'!'); // delimiter ; SELECT hello('world'); It comes from the MYSQL Help File. scooper Works for me, what was the error you got? mysql> delimiter // mysql mysql> CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) -> RETURN CONCAT('Hello, ',s,'!'); -> // Query OK, 0 rows affected (0.00 sec) mysql> delimiter ; mysql> SELECT hello('world'); +----------------------------------------------------+ | hello('world') | +----------------------------------------------------+ | Hello, world ! | +----------------------------------------------------+ 1 row in set (0.01 sec) mysql> select @@version; +-----------+ | @@version | +-----------+ | 5.1.42 | +-----------+ 1 row in set (0.00 sec) /Lennart |
#4
| |||
| |||
|
|
"Lennart" <erik.lennart.jonsson (AT) gmail (DOT) com> wrote in message news:afb18c08-e7bd-41cc-b7c8-46e87b3b7ba8 (AT) m37g2000yqf (DOT) googlegroups.com... On 6 mar, 11:04, "scooper" <robert... (AT) internode (DOT) on.net> wrote: Would anyone know why this doesn't run delimiter // CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ',s,'!'); // delimiter ; SELECT hello('world'); It comes from the MYSQL Help File. scooper Works for me, what was the error you got? It fails as soon as it hits the first left bracket. scooper |
#5
| |||
| |||
|
|
It fails as soon as it hits the first left bracket. scooper "Lennart" <erik.lennart.jonsson (AT) gmail (DOT) com> wrote in message news:afb18c08-e7bd-41cc-b7c8-46e87b3b7ba8 (AT) m37g2000yqf (DOT) googlegroups.com... On 6 mar, 11:04, "scooper" <robert... (AT) internode (DOT) on.net> wrote: Would anyone know why this doesn't run delimiter // CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ',s,'!'); // delimiter ; SELECT hello('world'); It comes from the MYSQL Help File. scooper Works for me, what was the error you got? mysql> delimiter // mysql mysql> CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) -> RETURN CONCAT('Hello, ',s,'!'); -> // Query OK, 0 rows affected (0.00 sec) mysql> delimiter ; mysql> SELECT hello('world'); +----------------------------------------------------+ | hello('world') | +----------------------------------------------------+ | Hello, world ! | +----------------------------------------------------+ 1 row in set (0.01 sec) mysql> select @@version; +-----------+ | @@version | +-----------+ | 5.1.42 | +-----------+ 1 row in set (0.00 sec) /Lennart |
#6
| |||
| |||
|
|
scooper wrote: It fails as soon as it hits the first left bracket. scooper "Lennart" <erik.lennart.jonsson (AT) gmail (DOT) com> wrote in message news:afb18c08-e7bd-41cc-b7c8-46e87b3b7ba8 (AT) m37g2000yqf (DOT) googlegroups.com... On 6 mar, 11:04, "scooper" <robert... (AT) internode (DOT) on.net> wrote: Would anyone know why this doesn't run delimiter // CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ',s,'!'); // delimiter ; SELECT hello('world'); It comes from the MYSQL Help File. scooper Works for me, what was the error you got? mysql> delimiter // mysql mysql> CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) -> RETURN CONCAT('Hello, ',s,'!'); -> // Query OK, 0 rows affected (0.00 sec) mysql> delimiter ; mysql> SELECT hello('world'); +----------------------------------------------------+ | hello('world') | +----------------------------------------------------+ | Hello, world ! | +----------------------------------------------------+ 1 row in set (0.01 sec) mysql> select @@version; +-----------+ | @@version | +-----------+ | 5.1.42 | +-----------+ 1 row in set (0.00 sec) /Lennart There are no brackets in the code. Only parentheses. Again - what error message do you get? And what exact version of MySQL are you running? -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex (AT) attglobal (DOT) net ================== |
#7
| |||
| |||
|
|
"Jerry Stuckle" <jstucklex (AT) attglobal (DOT) net> wrote in message news:hmtjk8$4hj$3 (AT) news (DOT) eternal-september.org... scooper wrote: It fails as soon as it hits the first left bracket. scooper "Lennart" <erik.lennart.jonsson (AT) gmail (DOT) com> wrote in message news:afb18c08-e7bd-41cc-b7c8-46e87b3b7ba8 (AT) m37g2000yqf (DOT) googlegroups.com... On 6 mar, 11:04, "scooper" <robert... (AT) internode (DOT) on.net> wrote: Would anyone know why this doesn't run delimiter // CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) RETURN CONCAT('Hello, ',s,'!'); // delimiter ; SELECT hello('world'); It comes from the MYSQL Help File. scooper Works for me, what was the error you got? mysql> delimiter // mysql mysql> CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50) -> RETURN CONCAT('Hello, ',s,'!'); -> // Query OK, 0 rows affected (0.00 sec) mysql> delimiter ; mysql> SELECT hello('world'); +----------------------------------------------------+ | hello('world') | +----------------------------------------------------+ | Hello, world ! | +----------------------------------------------------+ 1 row in set (0.01 sec) mysql> select @@version; +-----------+ | @@version | +-----------+ | 5.1.42 | +-----------+ 1 row in set (0.00 sec) /Lennart There are no brackets in the code. Only parentheses. Again - what error message do you get? And what exact version of MySQL are you running? It is Error 1064 (42000) The version is 4.1.13 (not 5.1). Thanks for asking, scooper |
![]() |
| Thread Tools | |
| Display Modes | |
| |