From: Web Manager <web@inter-resa.com>
To: pgsql-sql@postgresql.org
Subject: Problem with array syntax
Date: Tue, 11 Jan 2000 16:00:45 -0500
Message-ID: <387B99FD.29C3B43F@inter-resa.com> (raw)
Hello!
Since I am new at this and that my self testing is not working, can
someone help me with the syntax of creating an array and the way to
insert data in it?
In a tourism context, let's say that an hotel has 2 room type. I want a
2 month room availability table for each days... say 3 days for this
example!
The matrix would look like:
room_type 1 1 2 2
month 1 2 1 2
day1 3 4 2 4
day2 3 5 0 0
day3 0 2 1 2
where room_type is 1 or 2
where month is 1 or 2
where dayX is the day's number. So for the room_type 2, the 3rd day of
the 2sd month gives me "2" room availability.
would some thing like:
create table test (hotel_id varchar(8),type_ch int2[],mois int2[],jour
int2[]);
be ok?
How can I insert values so the array will allow me to scan a precice
position:
room type 1, first month, first day (= 3)
Thanks a lot!!!
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Andre Paquin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: web@inter-resa.com
Subject: Re: Problem with array syntax
In-Reply-To: <387B99FD.29C3B43F@inter-resa.com>
References: <387B99FD.29C3B43F@inter-resa.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox