473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Syntax for select statement returning output?

Hi,

I'm fairly new to MySql and come from a MS SQL background.
I have an application that I am converting from MS SQL to MySql.

I need to return a value from MySql using a parameter.

In MS SQL my select statement is:
"select @id = id from database"

That doesn't seem to be working with MySql... does anyone have any
suggestions?

Many thanks for your help!

Luvic.

Jun 6 '06 #1
1 1476
lu***********@gmail.com wrote:
I'm fairly new to MySql and come from a MS SQL background.
I have an application that I am converting from MS SQL to MySql.

I need to return a value from MySql using a parameter.

In MS SQL my select statement is:
"select @id = id from database"

That doesn't seem to be working with MySql... does anyone have any
suggestions?


You can't select something from a database in MySQL, but only from a
table.

In order to use your SQL statement, you would first need to choose the
database you wish to work with on the MySQL server, and then execute
something like this:

SELECT id FROM sometable;

The MySQL manual is at http://dev.mysql.com/doc/.

Hope this helps,

--
Bart

Jun 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
6
by: Samuel Hon | last post by:
Hi I'm not sure what the best approach for this is: I have a stored procedure which I would like to use to return several output values instead of returning a recordset. CREATE PROCEDURE...
4
by: Jarrod Morrison | last post by:
Hi All Im using a stored procedure on my sql server and am unsure of the syntax that i should use in it. Im pretty sure that there is a way to do what i want, but as yet i havent been able to...
2
by: Not Me | last post by:
Hi, I'm trying to create a function that returns a table, however I want to use a local variable in there and enterprise manager ain't liking it! The error I get is number 156 'incorrect syntax...
1
by: dmalhotr2001 | last post by:
Hi, I have an issue with my query. 1. I have 1 stored proc which have execution calls to multiple stored procs within it. 2. I want to wrap that main stored proc in the transaction and...
1
by: Sandesh | last post by:
Hello All, Me saying " has any body come across such error would be underestimating". Well I am getting a very peculiar and unique error "Line 1: Incorrect syntax near 'Actions'." ...
2
by: Birky | last post by:
Assign the output of a select to a variable? I am unable to find a way to assign the results of an SQL statement to a variable. I know how to assign the SQL statement to a variable but again no...
5
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, What is wrong with this code ? I got this error: " Line 1: Incorrect syntax near 'sp_Collect'. " which appears at the last line when | call the cm.ExecuteScalar . The sp takes an int ID...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.