Help!!! The error message "SELECT in a stored procedure must have INTO"
Hi everyone, This is my first project in MySql database. I use VB.Net and OleDb to connect to MySql(5.0.1 alpha-max). When I call the stored produce, I get the error message: ERROR [42000][MySQL][ODBC 3.51 Driver][mysqld-5.0.1-alpha-max]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'usp_CountryAll' at line 1 When I call the same stored procedure in the MySql console, it is fine. But when I call it at the MySql Query Broswer, I get "SELECT in a stored procedure must have INTO" error message. I have checked it on the internet and I saw many messages about "SELECT in a stored procedure must have INTO" error message. But I didn't find the direct answer in my case. I am very appreciated, if anyone can point out how to change my source code in follows. Here is my stored procedure and VB.Net code: CREATE PROCEDURE `testdb`.`usp_CountryAll`() SELECT CountryId, ShortName, FullName FROM Country ORDER BY ShortName Try Dim oOdbcDA As OdbcDataAdapter = New OdbcDataAdapter Dim oOdbcCmd As OdbcCommand Dim oDS As DataSet = New DataSet Dim oRow As DataRow Dim oMySqlConn As OdbcConnection = New OdbcConnection oMySqlConn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=testdb;USER=root;PASSWORD=;OPTION=3" oMySqlConn.Open() oOdbcCmd = New OdbcCommand("usp_CountryAll", oMySqlConn) oOdbcCmd.CommandType = CommandType.StoredProcedure oOdbcDA.SelectCommand = oOdbcCmd oOdbcDA.Fill(oDS) For Each oRow In oDS.Tables(0).Rows lstResult.Items.Add(oRow("FullName")) Next Catch ex As Exception MsgBox(ex.Message) End Try Thanks! Owen Ni - Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com
Help:how can i connect mysql server with the server's IP but not localhost?
Hi: Now i can use command: mysql -h localhost -u root -p connect to mysql server. But when i use command: mysql -h 127.0.0.1 -u root -p or: mysql -h 10.0.0.1 -u root -p (10.0.0.1 is the IP of mysql server) i failed,why? and how can do ? Thanks. __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: myODBC?
Hi, maybe I didn't phrase my question correctly. I'm using a SGI machine running Irix and going to be using a mySQL db on a Linux box behind a firewall. Since I will set up a tunnel with ssh2 to forward port 3306, it will appear to the Irix system that the db exists locally. Now here is what I'm confused about: Do I 1) install both iODBC and myODBC on the Irix system? or 2) install iODBC on the Irix one and myODBC on that Linux machine where the mySQL db physically located? Thanks! Wen -Original Message- From: Venu [mailto:[EMAIL PROTECTED]] Sent: Friday, August 24, 2001 9:33 AM To: Werner Stürenburg; Wen Tien Cc: [EMAIL PROTECTED] Subject: RE: myODBC? Hi !!! )-Original Message- )From: Werner Stürenburg [mailto:[EMAIL PROTECTED]] )Sent: Friday, August 24, 2001 5:59 AM )To: Wen Tien )Cc: [EMAIL PROTECTED] )Subject: Re: myODBC? ) ) )In my understanding, myODBC is a middleware for programs which )don't know how to deal directly with mySQL. So if you use perl or )php, you won't ever use ODBC, as this only slows things down, )obviously. ODBC is kind of a workaround in my understanding. ) )Please correct me, if I'm wrong. ) )Wen Tien schrieb am Freitag, 24. August 2001, 14:39:55: ) )> Hi, )> I am a newbie that has a question about what exactly is )myODBC (for Unix) )> doing. Is myODBC, 1) a "wrapper" over the mySQL database to )make it conform )> to the ODBC interface or 2) a plug-in driver that goes with a manager )> program to allow the access of mySQL db? I am using an Irix machine that )> tries to use a mySQL db on a Linux box (natively via port )forwarding) so I'm )> trying to decide where to install what... thanks. ) MyODBC is a ODBC Driver for MySQL. The current version is fully conformed to MS ODBC 2.x Specifications. So you can use the driver to access MySQL as per this specifications. Coming to the second one, yes, MyODBC works fine with all major driver managers such as MS ODBC DM, iODBC, unixODBC and Merant ODBC DM. Also it works in a stand alone mode too when you link the static library of the driver to your application. In this case no DSN issue will be coming. You can use DSN less connection, by specifying proper connection fields. The only drawback in this case (for any odbc driver ) is it can only talk to MySQL server, and it can't talk to any other, but its not the case when going through the manager. Regards Venu -- For technical support contracts, go to https://order.mysql.com/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Mr. Venu <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Developer /_/ /_/\_, /___/\___\_\___/ Woodside, California USA <___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
myODBC?
Hi, I am a newbie that has a question about what exactly is myODBC (for Unix) doing. Is myODBC, 1) a "wrapper" over the mySQL database to make it conform to the ODBC interface or 2) a plug-in driver that goes with a manager program to allow the access of mySQL db? I am using an Irix machine that tries to use a mySQL db on a Linux box (natively via port forwarding) so I'm trying to decide where to install what... thanks. Wen Tien - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
myODBC on Irix 6.5 follow-up
Hi all, I have now managed to execute the configure script without any errors. However, the Makefile generated still contains errors? Again, has anyone ever managed to build and install myODBC under Irix? Any thoughts is appreciated... thanks! bypass spam filter: sql, mySQL, table, query Wen Tien UCLA, Department of Computer Science [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
myODBC on Irix 6.5
Hi all, I downloaded the latest Unix source of myODBC drivers but the configure script failed under Irix 6.5. ("Unexpected end of file") I looked at some web resources and it seems that many developers also have similar difficulties configuring/compiling myODBC for Irix. I was wondering if anyone has successfully compiled and installed myODBC on Irix and what are the "stuff" you are running (shell, compiler, etc) and if any tweaks is needed... It is very important to me to get myODBC drivers to work but if anyone can suggest other means of connecting to mySQL database while maintaining open database connectivity please feel free to comment as well... Thanks a bunch in advance. Wen Tien UCLA, Department of Computer Science - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Starting MySQL
Please add /usr/local/mysql/bin in your PATH. dwayne> I'm fairly new to MySQL and unix. I have installed mysql on redhat 6.2 without too many problems. I am changing my o/s to FreeBSD 4.2 and have installed mysql after many hours of grief. I have mysql set to start at boot time and this seems to work well. The problem I have is that I can't access the server from the command prompt without using the full path to mysql (ie /usr/local/mysql/bin/mysql). Any help would be greatly appreciated. dwayne> dwayne> Dwayne dwayne> dwayne> [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: [Q] DBI connect with MySQL(SOLVED)
Okay, I get it. The problem comes from the statement below, wen> $db = param('test') or die("Could not find database!"); After I revised it to "my $db = "test" or die("Could not find database!");" I get expected result. Thanks for your consideration. Regards, --Wen [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: [Q] DBI connect with MySQL
iii> You will get errors like these if your script does not print out a header iii> before spitting out other information. It is usually best to print the iii> header in the very beginning of the script so you do not have to worry about iii> it. You dont have to wait until you are about to print out some html. iii> iii> $output->header(); I add "$output->header();" just behind "my $output = new CGI;", but the result does not change. Maybe still there are other factors as you said. Thanks so much for your information. Regards, --Wen [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
[Q] DBI connect with MySQL
Hi,gurus, I am a novice at MySQL. When I try to run a sample program in the book of "MySQL & mSQL" I get a error message from my apache server as follows, * Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. * The sample program is #!/usr/bin/perl -w use strict; use CGI qw(:standard); use CGI::Carp; use DBI; CGI::use_named_parameters(1); my ($db); my $output = new CGI; $db = param('test') or die("Could not find database!"); my $dbh = DBI->connect("DBI:mysql:$db:$server",root,passward ); if (not $dbh) { print header, start_html('title'=>"Information on $host => $db", 'BGCOLOR'=>'white'); print <$host $db For the following reasons the connection failed. $DBI::errstr END_OF_HTML exit(0); } print header, start_html('title'=>"Information on $host => $db", 'BGCOLOR'=>'white'); print <$host $db Tables END_OF_HTML my @tables = $dbh->func( '_ListTables' ); foreach (@tables) { print "$_\n"; } print < END_OF_HTML exit(0); Could someone tell me what is wrong? Thanks a lot. Regards, --Wen [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
[Q] DBI connect with MySQL
Hi,gurus, I am a novice at MySQL. When I try to run a sample program in the book of "MySQL & mSQL" I get a error message from my apache server as follows, * Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [EMAIL PROTECTED] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. * The sample program is #!/usr/bin/perl -w use strict; use CGI qw(:standard); use CGI::Carp; use DBI; CGI::use_named_parameters(1); my ($db); my $output = new CGI; $db = param('test') or die("Could not find database!"); my $dbh = DBI->connect("DBI:mysql:$db:$server",root,passward ); if (not $dbh) { print header, start_html('title'=>"Information on $host => $db", 'BGCOLOR'=>'white'); print <$host $db For the following reasons the connection failed. $DBI::errstr END_OF_HTML exit(0); } print header, start_html('title'=>"Information on $host => $db", 'BGCOLOR'=>'white'); print <$host $db Tables END_OF_HTML my @tables = $dbh->func( '_ListTables' ); foreach (@tables) { print "$_\n"; } print < END_OF_HTML exit(0); Could someone tell me what is wrong? Thanks a lot. Regards, --Wen [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: mysql ./config..... concerning lncurses
markr> error messages show that lncurses, lcurses, ltermcap, could not be found. markr> We are running Debian Linux 2.2x, on SPARC. We are trying to install markr> 3.23.33. Any help would be useful thank you. FYI, you can get 3.23.xx.deb from unstable in Debian. Regards, --Wen [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Deleting Tables
coter> Can someone tell me how to delete tables with MYSQL Version 3.23? I have a database named homework, with 5 tables in it. (Home1, home2, home3, etc...) I have cleared the databases, and they are empty. But when I try to run my script to repopulate Home1... I get the following... coter> coter> # mysql -uroot -p homework < home1.sql coter> Enter password: coter> ERROR 1050 at line 9: Table 'home1' already exists One solution is adding "DROP TABLE IF EXISTS home1;" in home1.sql. Regards, --Wen [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php