In MSSQL you can create a table with a computed column, like this...
CREATE FUNCTION CubicVolume
-- Input dimensions in centimeters.
(@CubeLength decimal(4,1), @CubeWidth decimal(4,1),
@CubeHeight decimal(4,1) )
RETURNS decimal(12,3) -- Cubic Centimeters.
AS
BEGIN
RETURN ( @CubeLength * @CubeWidth * @CubeHeight )
END
CREATE TABLE Bricks
(
BrickPartNmbr int PRIMARY KEY,
BrickColor nchar(20),
BrickHeight decimal(4,1),
BrickLength decimal(4,1),
BrickWidth decimal(4,1),
BrickVolume AS
(
dbo.CubicVolume (BrickHeight,
BrickLength, BrickWidth)
)
)
Is there an equivalent in MySQL beside views, stored procedures or
calculating it in a query?
I'm not trying to implement it; I'm just curious. 1 15631 pe******@gmail. com wrote:
Is there an equivalent in MySQL beside views, stored procedures or
calculating it in a query?
No, there is no declarative support for computed fields in MySQL.
Regards,
Bill K. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Paulo Andre Ortega Ribeiro |
last post by:
I have a table with fields called fname (First Name) and lname (Last
Name). I need the user´s email thai is compose from lname and fname:
LOWER(LEFT (fname,1) + lname)
Is there any difference between creatig this computed column ia a table
or in a view in SQL Server 2000?
I can do:
1. CREATE TABLE Users(
|
by: tperovic |
last post by:
Using SS2K, I'm getting the following error while bulk inserting:
Column 'warranty_expiration_date' cannot be modified because it is a
computed column.
Here is my bulk insert statement:
BULK INSERT dbo.TestData
FROM 'TestData.dat'
WITH (CHECK_CONSTRAINTS,
|
by: DMAC |
last post by:
If i want to split a computed column into two or more columns based on
the the length (its a varchar) of the computed column, how often will
sql server determine what the computed column is? roughly along the
lines of
select comp_col,'comp_col 2'=
case when datalength(comp_col)<=100 then comp_col
else left(comp_col,99) + '~' end,
datalength(comp_col)
from aTable
|
by: GJK |
last post by:
In SQL Sever, do the size of computed columns gets added to the total
size of the tables? Does SQL server stores the actual values in
computed columns?
Thanks
_GJK
|
by: Henning N?rg?rd |
last post by:
I'm working as software developer mostely om SQL-server platform.
On SQL-server we are using a lot of "Computed Columns"
Does anyone know if that is possible to do in DB2 too ?
I mean - define a column, based on SQL-query in database.
And how - do i do - would like a practic example if possible.
/Henning
| |
by: Jim Heavey |
last post by:
Hello, I have created a computed column which concatenates a name and date.
My problem is that if the 10 is not 10 characters, I get an extra character
placed into the computed column. Here is the code that I have for the
expersion of the computed column...
dtCompetition.Columns.Expression= ("trim
(CompetitionName) + ' ' + substring(convert
(EventStartDate,System.String),1,10)");
|
by: Raymond Du |
last post by:
Hi,
Can I have computed columns in a datagrid? If yes, how?
TIA
|
by: Dave |
last post by:
I am relativly new to visual basic, so this may be a no-
brainer.
I am attempting to use a computed column in a VB dataset
defined as followe:
'
'dcCost
'
Me.dcCost.ColumnName = "Cost"
|
by: am72de |
last post by:
Hi all,
I have two identical DataTables. One of the columns is a computed one.
With a DataReader I try to copy the DataRows from one table to the
other, but I get an InvalidOperationException, because calculated
columns can not be set. Does anyone know a solution to work around
this behaviour, for example how to exlude this column from the copy
process (without removing it from the table)?
Thanks in advance
|
by: Aamir Mahmood |
last post by:
Hi All
I have DataTable object. Is there a way that I can know which fields
(columns) in the table are computed.
Apparantly the DataTable.Columns returns all columns both computed and
other.
Any help would be appreciated.
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |