From rgp@systame.com Thu Aug 29 17:31:01 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6A27D475BA0; Thu, 29 Aug 2002 13:31:01 -0400 (EDT) Received: from imf09bis.bellsouth.net (mail309.mail.bellsouth.net [205.152.58.169]) by postgresql.org (Postfix) with ESMTP id B35464759F2; Thu, 29 Aug 2002 13:31:00 -0400 (EDT) Received: from [216.77.205.46] by imf09bis.bellsouth.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20020829173236.CRAW23917.imf09bis.bellsouth.net@[216.77.205.46]>; Thu, 29 Aug 2002 13:32:36 -0400 User-Agent: Microsoft-Entourage/10.1.0.2006 Date: Thu, 29 Aug 2002 13:31:10 -0400 Subject: Access 'field too long' error From: Randall Perry To: Cc: Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/358 X-Sequence-Number: 5472 Getting the error: The size of a field is too long From SHenshall@westcountrypublications.co.uk Fri Aug 30 13:53:41 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 82133476818; Fri, 30 Aug 2002 09:53:41 -0400 (EDT) Received: from mail_exchange.westcountrypublications.co.uk (wcpmail.westcountrypublications.co.uk [195.171.163.153]) by postgresql.org (Postfix) with ESMTP id 02592476816; Fri, 30 Aug 2002 09:53:39 -0400 (EDT) Received: by MAIL_EXCHANGE with Internet Mail Service (5.5.2650.21) id ; Fri, 30 Aug 2002 14:46:01 +0100 Message-ID: From: "Henshall, Stuart - WCP" To: 'Randall Perry' , pgsql-general@postgresql.org Cc: pgsql-admin@postgresql.org Subject: Re: [GENERAL] Access 'field too long' error Date: Fri, 30 Aug 2002 14:46:00 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2502B.936AEFF0" X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/403 X-Sequence-Number: 5517 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2502B.936AEFF0 Content-Type: text/plain; charset="iso-8859-1" I have succesfully linked the following table and view in both MS Access 97 and 2000. create table num_tbl(pk serial,n numeric(7,2),primary key (pk)); create view num_vw1 sa select * from num_tbl; I have had problems wiht indexes on 97 when used on fields it couldn't have indexed. If you post your table & view definition (as well as Access ver) I'll see if it works for me or not. - Stuart > -----Original Message----- > From: Randall Perry [mailto:rgp@systame.com] > Sent: 29 August 2002 18:31 > To: pgsql-general@postgresql.org > Cc: pgsql-admin@postgresql.org > Subject: [GENERAL] Access 'field too long' error > > > Getting the error: > The size of a field is too long > > From access when trying to link to a view. Discovered the > problem field is > of type numeric(7,2). But, if I try linking to the table the > view is based > on, I don't get the error. So, somehow this numeric field in > a view looks > different to Access than the same numeric field in a table. > > Any ideas? > > > -- > Randy Perry > sysTame > Mac Consulting/Sales > > http://www.systame.com/ > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > ------_=_NextPart_001_01C2502B.936AEFF0 Content-Type: text/html; charset="iso-8859-1" RE: [GENERAL] Access 'field too long' error

I have succesfully linked the following table and view
in both MS Access 97 and 2000.
create table num_tbl(pk serial,n numeric(7,2),primary key (pk));
create view num_vw1 sa select * from num_tbl;
I have had problems wiht indexes on 97 when used on fields it
couldn't have indexed.
If you post your table & view definition (as well as Access ver)
I'll see if it works for me or not.
- Stuart

> -----Original Message-----
> From: Randall Perry [mailto:rgp@systame.com]
> Sent: 29 August 2002 18:31
> To: pgsql-general@postgresql.org
> Cc: pgsql-admin@postgresql.org
> Subject: [GENERAL] Access 'field too long' error
>
>
> Getting the error:
>     The size of a field is too long
>
> From access when trying to link to a view. Discovered the
> problem field is
> of type numeric(7,2). But, if I try linking to the table the
> view is based
> on, I don't get the error. So, somehow this numeric field in
> a view looks
> different to Access than the same numeric field in a table.
>
> Any ideas?
>
>
> --
> Randy Perry
> sysTame
> Mac Consulting/Sales
>
> http://www.systame.com/
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

------_=_NextPart_001_01C2502B.936AEFF0-- From rgp@systame.com Mon Sep 2 15:38:30 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 11F964761AD; Mon, 2 Sep 2002 11:38:30 -0400 (EDT) Received: from imf16bis.bellsouth.net (mail016.mail.bellsouth.net [205.152.58.36]) by postgresql.org (Postfix) with ESMTP id B1680476410; Mon, 2 Sep 2002 11:37:42 -0400 (EDT) Received: from [216.78.241.164] by imf16bis.bellsouth.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20020902153923.LYEP7192.imf16bis.bellsouth.net@[216.78.241.164]>; Mon, 2 Sep 2002 11:39:23 -0400 User-Agent: Microsoft-Entourage/10.1.0.2006 Date: Mon, 02 Sep 2002 11:37:52 -0400 Subject: Re: [GENERAL] Access 'field too long' error From: Randall Perry To: "Henshall, Stuart - WCP" Cc: , Message-ID: In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/7 X-Sequence-Number: 5546 Here's my view definition: View "v_cust_rev_by_month" Column | Type | Modifiers ---------------+-----------------------+----------- id | integer | cust_code | character varying(25) | date | date | month | text | total_uploads | integer | revenues | numeric | balance | numeric | In testing, if I create a new table from this view and don't include the numeric fields, it links to access ok. If include either of the numeric fields I get the 'field is too long' error. If I link the original table the view is derived from (the view is 3 steps removed from the original because it calls on views that call on views) I don't get the error. Here's the original table def. The revenues and balance fields above are derived from the price and amount fields. Column | Type | Modifiers ------------+------------------------+-------------------------------------- -------------- id | integer | not null default nextval('"invoice_id_seq"'::text) cust_code | character varying(25) | not null inv_no | character varying(15) | not null date | date | not null due | date | not null no_of_dist | integer | not null quantity | numeric(7,2) | not null descript | character varying(300) | not null price | numeric(7,2) | not null amount | numeric(7,2) | not null x_period | integer | not null x_no | integer | not null I can use ADO to grab the view data, but I need the recordset for a report -- and you can't set a report's recordset to an ADO source. Bummer. > I have succesfully linked the following table and view > in both MS Access 97 and 2000. > create table num_tbl(pk serial,n numeric(7,2),primary key (pk)); > create view num_vw1 sa select * from num_tbl; > I have had problems wiht indexes on 97 when used on fields it > couldn't have indexed. > If you post your table & view definition (as well as Access ver) > I'll see if it works for me or not. > - Stuart > >> -----Original Message----- >> From: Randall Perry [mailto:rgp@systame.com] >> Sent: 29 August 2002 18:31 >> To: pgsql-general@postgresql.org >> Cc: pgsql-admin@postgresql.org >> Subject: [GENERAL] Access 'field too long' error >> >> >> Getting the error: >> The size of a field is too long >> >> From access when trying to link to a view. Discovered the >> problem field is >> of type numeric(7,2). But, if I try linking to the table the >> view is based >> on, I don't get the error. So, somehow this numeric field in >> a view looks >> different to Access than the same numeric field in a table. >> >> Any ideas? >> >> >> -- >> Randy Perry >> sysTame >> Mac Consulting/Sales >> >> http://www.systame.com/ >> >> >> >> ---------------------------(end of >> broadcast)--------------------------- >> TIP 6: Have you searched our list archives? >> >> http://archives.postgresql.org >> > -- Randy Perry sysTame Mac Consulting/Sales http://www.systame.com/ From tgl@sss.pgh.pa.us Mon Sep 2 16:23:56 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 20A544759AF; Mon, 2 Sep 2002 12:23:56 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 66114475914; Mon, 2 Sep 2002 12:23:55 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g82GO0ZM023458; Mon, 2 Sep 2002 12:24:00 -0400 (EDT) To: Randall Perry Cc: "Henshall, Stuart - WCP" , pgsql-general@postgresql.org, pgsql-admin@postgresql.org, pgsql-odbc@postgresql.org Subject: Re: [GENERAL] Access 'field too long' error In-reply-to: References: Comments: In-reply-to Randall Perry message dated "Mon, 02 Sep 2002 11:37:52 -0400" Date: Mon, 02 Sep 2002 12:24:00 -0400 Message-ID: <23457.1030983840@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/8 X-Sequence-Number: 5547 Randall Perry writes: > Here's my view definition: > View "v_cust_rev_by_month" > Column | Type | Modifiers > ---------------+-----------------------+----------- > id | integer | > cust_code | character varying(25) | > date | date | > month | text | > total_uploads | integer | > revenues | numeric | > balance | numeric | > In testing, if I create a new table from this view and don't include the > numeric fields, it links to access ok. > If include either of the numeric fields I get the 'field is too long' error. > If I link the original table the view is derived from (the view is 3 steps > removed from the original because it calls on views that call on views) I > don't get the error. My bet is that something on the client side is getting confused by the lack of precision specification for the numeric columns in the view. It works on the original table because that has a precision spec. You can probably work around this by redefining the view with explicit casts. Note the difference in the following examples: regression=# create table foo(f1 numeric(7,2)); CREATE regression=# create view v as select f1, f1+1 from foo; CREATE regression=# create view v2 as select f1, (f1+1)::numeric(7,2) from foo; CREATE regression=# \d v View "v" Column | Type | Modifiers ----------+--------------+----------- f1 | numeric(7,2) | ?column? | numeric | View definition: SELECT foo.f1, (foo.f1 + '1'::"numeric") FROM foo; regression=# \d v2 View "v2" Column | Type | Modifiers ---------+--------------+----------- f1 | numeric(7,2) | numeric | numeric(7,2) | View definition: SELECT foo.f1, ((foo.f1 + '1'::"numeric"))::numeric(7,2) AS "numeric" FROM foo; In the longer run it might be possible to tweak the ODBC driver to prevent this failure --- I'm not sure what ODBC does when it sees a -1 typmod for a numeric column, but perhaps it could do something different than it does now. regards, tom lane From rgp@systame.com Mon Sep 2 20:47:02 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 8892C475A3F; Mon, 2 Sep 2002 16:47:02 -0400 (EDT) Received: from imf24bis.bellsouth.net (mail024.mail.bellsouth.net [205.152.58.64]) by postgresql.org (Postfix) with ESMTP id D3CEF474E49; Mon, 2 Sep 2002 16:47:01 -0400 (EDT) Received: from [216.78.241.164] by imf24bis.bellsouth.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20020902204701.VRXI24863.imf24bis.bellsouth.net@[216.78.241.164]>; Mon, 2 Sep 2002 16:47:01 -0400 User-Agent: Microsoft-Entourage/10.1.0.2006 Date: Mon, 02 Sep 2002 16:47:10 -0400 Subject: Re: [GENERAL] Access 'field too long' error From: Randall Perry To: Randall Perry Cc: , Message-ID: In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/9 X-Sequence-Number: 5548 Just tried a SQL Pass Thru query and got the same 'field too long' error. >> >>> -----Original Message----- >>> From: Randall Perry [mailto:rgp@systame.com] >>> Sent: 29 August 2002 18:31 >>> To: pgsql-general@postgresql.org >>> Cc: pgsql-admin@postgresql.org >>> Subject: [GENERAL] Access 'field too long' error >>> >>> >>> Getting the error: >>> The size of a field is too long >>> >>> From access when trying to link to a view. Discovered the >>> problem field is >>> of type numeric(7,2). But, if I try linking to the table the >>> view is based >>> on, I don't get the error. So, somehow this numeric field in >>> a view looks >>> different to Access than the same numeric field in a table. >>> >>> Any ideas? >>> >>> >>> -- >>> Randy Perry >>> sysTame >>> Mac Consulting/Sales >>> >>> http://www.systame.com/ >>> >>> >>> >>> ---------------------------(end of >>> broadcast)--------------------------- >>> TIP 6: Have you searched our list archives? >>> >>> http://archives.postgresql.org >>> >> > -- Randy Perry sysTame Mac Consulting/Sales http://www.systame.com/