Re: "Macro" statement
From: --CELKO-- (jcelko212_at_earthlink.net)
Date: 01/26/05
- Next message: --CELKO--: "Re: "Macro" statement"
- Previous message: Smartikat: "Reverse data processed..."
- Maybe in reply to: zaratino: "Re: "Macro" statement"
- Next in thread: zaratino: "Re: "Macro" statement"
- Reply: zaratino: "Re: "Macro" statement"
- Messages sorted by: [ date ] [ thread ]
Date: 25 Jan 2005 16:42:22 -0800
>> Imagine that we have a table named tblA and fields [sic] with the
almost same name, for example Field01, Field02,...Field20. (I have
named fields [sic] on that way for the better explanation). <<
A column is not a field -- nothing like it at all. Since each column
is a separate attribute of the entity in your data model, it would be
VERY unusual to have such a table if you had a proper data model.
However, if I were writing a 1950's file system (files are made of
records which do have fields), then they would probably be a repeating
group -- and a violation of First Normal Form (1NF).
>> Now, suppose that we want to do almost the same update on all of the
fields [sic]: <<
In SQL an UPDATE works on entire rows (rows are not records), changing
all the columns at the same time.
UPDATE Foobar
SET x = <value1>,
y = <value2>,
z = <value3>,
etc.
If you want to pass the values as parameters, then you can skip some of
them by passing a NULL and having this SET clause in your UPDATE
statement.
SET x = COALESCE (<value1>, x)
Dynamic SQL generation is considered very poor design; it says you have
no data model and no idea what to do until run time.
- Next message: --CELKO--: "Re: "Macro" statement"
- Previous message: Smartikat: "Reverse data processed..."
- Maybe in reply to: zaratino: "Re: "Macro" statement"
- Next in thread: zaratino: "Re: "Macro" statement"
- Reply: zaratino: "Re: "Macro" statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|