473,466 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using a Database for Logging: How to Design?

Hi
I need to log the number of "brochure Requests" on a per Region, Per
date basis.

eg for say 20 Regions , have a 366 columns (one per day of the year).
Obviously I can write a script to Create all the tables, but it seems
kind of clumsy.
Do arrays exist in Mysql?
It might also be easier to organise it into 52 weeks of 7 days.

How do I design the tables?

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
Jul 19 '05 #1
6 2314
hmmmm - i would keep it easier ? just a logging table - lets say your
brochure requests really are tallied somewhere else before you get to the
real table insert ..

so
log_id -> primary key, autoincrement
Region_id -> integer, foreign key back to some region table
Num_req -> integer, number of requests for that reqion, for that day
req_date -> date, date the request was made ..

It sounds to me ilke you were thinking of it like a spreadsheet ..

hth - mondo regards [Bill]

--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex********@efgroup.net
mySql / VFP / MS-SQL
"zzapper" <da***@tvis.co.uk> wrote in message
news:f6*************************@posting.google.co m...
Hi
I need to log the number of "brochure Requests" on a per Region, Per
date basis.

eg for say 20 Regions , have a 366 columns (one per day of the year).
Obviously I can write a script to Create all the tables, but it seems
kind of clumsy.
Do arrays exist in Mysql?
It might also be easier to organise it into 52 weeks of 7 days.

How do I design the tables?

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips

Jul 19 '05 #2
hmmmm - i would keep it easier ? just a logging table - lets say your
brochure requests really are tallied somewhere else before you get to the
real table insert ..

so
log_id -> primary key, autoincrement
Region_id -> integer, foreign key back to some region table
Num_req -> integer, number of requests for that reqion, for that day
req_date -> date, date the request was made ..

It sounds to me ilke you were thinking of it like a spreadsheet ..

hth - mondo regards [Bill]

--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex********@efgroup.net
mySql / VFP / MS-SQL
"zzapper" <da***@tvis.co.uk> wrote in message
news:f6*************************@posting.google.co m...
Hi
I need to log the number of "brochure Requests" on a per Region, Per
date basis.

eg for say 20 Regions , have a 366 columns (one per day of the year).
Obviously I can write a script to Create all the tables, but it seems
kind of clumsy.
Do arrays exist in Mysql?
It might also be easier to organise it into 52 weeks of 7 days.

How do I design the tables?

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips

Jul 19 '05 #3
On Fri, 12 Sep 2003 02:12:25 GMT, "swdev1" <ws**********@advmed.com>
wrote:
hmmmm - i would keep it easier ? just a logging table - lets say your
brochure requests really are tallied somewhere else before you get to the
real table insert ..

so
log_id -> primary key, autoincrement
Region_id -> integer, foreign key back to some region table
Num_req -> integer, number of requests for that reqion, for that day
req_date -> date, date the request was made ..

It sounds to me ilke you were thinking of it like a spreadsheet ..


So what you are suggesting is a long table with a record per
region/per day that's not a bad idea especially in the short term

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
Jul 19 '05 #4
On Fri, 12 Sep 2003 02:12:25 GMT, "swdev1" <ws**********@advmed.com>
wrote:
hmmmm - i would keep it easier ? just a logging table - lets say your
brochure requests really are tallied somewhere else before you get to the
real table insert ..

so
log_id -> primary key, autoincrement
Region_id -> integer, foreign key back to some region table
Num_req -> integer, number of requests for that reqion, for that day
req_date -> date, date the request was made ..

It sounds to me ilke you were thinking of it like a spreadsheet ..


So what you are suggesting is a long table with a record per
region/per day that's not a bad idea especially in the short term

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
Jul 19 '05 #5
zZapPer -
yup - that is what I am suggesting - you DID ask for a logging table schema
..

then to get any #'s back out of it - you are gonna be doing some sql
statements .
let me know your thoughts? regards [Bill]
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex********@efgroup.net
mySql / VFP / MS-SQL
"zzapper" <da***@tvis.co.uk> wrote in message
news:gv********************************@4ax.com...
On Fri, 12 Sep 2003 02:12:25 GMT, "swdev1" <ws**********@advmed.com>
wrote:
hmmmm - i would keep it easier ? just a logging table - lets say your
brochure requests really are tallied somewhere else before you get to the
real table insert ..

so
log_id -> primary key, autoincrement
Region_id -> integer, foreign key back to some region table
Num_req -> integer, number of requests for that reqion, for that day
req_date -> date, date the request was made ..

It sounds to me ilke you were thinking of it like a spreadsheet ..


So what you are suggesting is a long table with a record per
region/per day that's not a bad idea especially in the short term

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips

Jul 19 '05 #6
zZapPer -
yup - that is what I am suggesting - you DID ask for a logging table schema
..

then to get any #'s back out of it - you are gonna be doing some sql
statements .
let me know your thoughts? regards [Bill]
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
FREE LONG DISTANCE -> mailto:ex********@efgroup.net
mySql / VFP / MS-SQL
"zzapper" <da***@tvis.co.uk> wrote in message
news:gv********************************@4ax.com...
On Fri, 12 Sep 2003 02:12:25 GMT, "swdev1" <ws**********@advmed.com>
wrote:
hmmmm - i would keep it easier ? just a logging table - lets say your
brochure requests really are tallied somewhere else before you get to the
real table insert ..

so
log_id -> primary key, autoincrement
Region_id -> integer, foreign key back to some region table
Num_req -> integer, number of requests for that reqion, for that day
req_date -> date, date the request was made ..

It sounds to me ilke you were thinking of it like a spreadsheet ..


So what you are suggesting is a long table with a record per
region/per day that's not a bad idea especially in the short term

zzapper
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips

Jul 19 '05 #7

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

Similar topics

23
by: Rotem | last post by:
Hi, while working on something in my current project I have made several improvements to the logging package in Python, two of them are worth mentioning: 1. addition of a logging record field...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
2
by: agus liem | last post by:
Hai.. I introduce myself, my name : Agus, from Indonesia. Im develop application using POwerbuilder 7 and postgresql 7.3. I have serveral error, and cannot solve yet. Anybody help me? This is...
2
by: prabhupr | last post by:
Hi Folks I was reading this article (http://www.dotnetbips.com/articles/displayarticle.aspx?id=32) on "Custom Attribute", written by Bipin. The only thing I did not understand in this article...
22
by: amygdala | last post by:
Hi, I'm trying to grasp OOP to build an interface using class objects that lets me access database tables easily. You have probably seen this before, or maybe even built it yourself at some...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
9
by: Rasika WIJAYARATNE | last post by:
Hi guys, Please check this out: http://rkwcoding.blogspot.com/2007/07/error-logging.html
7
by: thebarefootnation | last post by:
Hi, I have created an access db that I would like to secure. The database will exist on a shared drive and be used at a number of different locations hence the reason to secure the database. ...
2
by: Frank Aune | last post by:
Hi, Explaining this problem is quite tricky, but please bear with me. Ive got an application which uses MySQL (InnoDB) for two things: 1. Store and retrieve application data (including...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
tracyyun
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...
0
agi2029
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.