MySQL Forums
Forum List  »  Newbie

Re: New to MySql but old man in programming
Posted by: John Kowawsky
Date: April 24, 2005 09:03AM

Im new to mySQL too and only programmed for 10 year... But ill try to help you.

I guess the :field you are giving is to receive an parameter from somewere. What youre putting there depends of where youre using select.

Im currently doing a web system using MySQL with JSP.

In JSP, i just put:

Select * From OrderTransactions
Where ((CompanyNo = ?) ...

And then I specify using the Connection.setParameter() method, or the taglib <sql:query> with <sql:param>. Other scripts or languages can have different syntax. I dont use Delphi so I dont know how is it there. Howerer i remember is pretty similar. You should try any forum of the language youre trying anyway.

In MySQL 5 stored procedure and user functions you only have to define the variable, get the value (by function parameter or other select) and use it without ':'. Like:

Select * From OrderTransactions
Where ((CompanyNo = varCompanyNo) ...

In this case you should search in the MySQL manual for "stores procedures" and "define". It only works in MySQL 5 thought.

It all works fine with me

I dont know but I think MySQL can create global variables for use with input (prompt) selects.

hope it help.

SSPecter

Options: ReplyQuote


Subject
Written By
Posted
Re: New to MySql but old man in programming
April 24, 2005 09:03AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.