If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mySQL support for constants?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-13-07, 12:35
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
mySQL support for constants?

Hi to all,

I want to ask if MySQL version 5.0 or later supports variable constants?
Like in any programmling languages like Visual Basic 6, you can declare a constant variable and refer to it through the lifetime of your program?
It also won't allow its value to be modified.

Does mySQL have that feature? or we just have to declare a variable and put a default value to it?

thanks and god bless all!
Reply With Quote
  #2 (permalink)  
Old 06-13-07, 12:46
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
has had that feature since version 3.23

http://dev.mysql.com/doc/refman/4.1/...variables.html
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 06-13-07, 13:10
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
Ok, but still the variable can be modifie. I am asking technically if there are variables similar to that of VB6, which , cannot be modified
Reply With Quote
  #4 (permalink)  
Old 06-13-07, 13:15
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
this begs the question, why aren't you actually using vb6 if that's what you want?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 06-13-07, 14:26
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
Don't get me wrong, but I am only asking for that kind of feature in mySQL.
Reply With Quote
  #6 (permalink)  
Old 06-14-07, 03:34
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
I hate to think what would happen if you filled up the cache of MySQL with constants... Why do you need a constant in MySQL, that is the real question? I see no need for such a thing, and I don't believe any other DBs are utilising this. Why don't you just use a table of constants
Reply With Quote
  #7 (permalink)  
Old 06-14-07, 10:28
Panoy Panoy is offline
Registered User
 
Join Date: Mar 2007
Posts: 77
very well said
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On