Data format problem

Поиск
Список
Период
Сортировка
От Verbus M. Counts
Тема Data format problem
Дата
Msg-id 3C155AB5.1060209@sonicisp.net
обсуждение исходный текст
Ответы Re: Data format problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Data format problem  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
Greetings,

The following is a problem I am having:

#!/bin/bash
#
# Demo script for postgreSQL
#
uname  -a

psql -V

dropdb testdb

createdb testdb

echo "create table titles"
psql testdb <<EOF
create table titles
    (title_id char(6) not null,
    title text not null,
    type char(12) null,
    pub_id char(4) null,
    price float8 null,
    advance numeric(12,2) null,
    num_sold int null,
    notes varchar(200) null,
    pubdate datetime null,
    contract int not null);
EOF

echo "insert into titles"
psql testdb <<EOF
insert into titles
values ('BU1111',
'Cooking with Computers: Surreptitious Balance Sheets',
'business',
'1389',
$11.95,
$5000.00,
3876,
'Helpful hints on how to use your electronic resources to the best
advantage.', '06/09/88', 1);

insert into titles
values ('MC2222',
'Silicon Valley Gastronomic Treats',
'mod_cook',
'0877',
$19.99,
$0.00,
2032,
'Favorite recipes for quick, easy, and elegant meals, tried and tested
by people who never have time to eat, let alone cook.',
'06/09/89', 1);
EOF


-----------------------------------------------------------------
When I run the above:

Linux aossofca.com 2.4.7-10enterprise #1 SMP Thu Sep 6 16:48:20 EDT 2001
i686 unknown
psql (PostgreSQL) 7.1.3
contains readline, history, multibyte support
Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
Portions Copyright (c) 1996 Regents of the University of California
Read the file COPYRIGHT or use the command \copyright to see the
usage and distribution terms.
DROP DATABASE
CREATE DATABASE
create table titles
CREATE
insert into titles
INSERT 59101 1
ERROR:  parser: parse error at or near "."

When I change the $0.00 to $1.00 all works well????????????

--
Regards,
Verbus M. Counts
Director R & D
Advanced Open Source Solutions, Inc.
10 South Grant Street
Roseville, CA 95678
916-765-1624


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Perf number on a project
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Suitability of postgres for very high transaction volume