Public bug reported:

Binary package hint: beancounter

After setting up the beancounter package I tried to insert some data
about Gold-EUR-Exchange rates into the database by entering:

beancounter addportfolio 'XAUEUR=X':10:EUR:Gold:mine:331.00:20040501

This command results in an errormessage:

FEHLER:  NULL-Wert in Spalte »exchange« verletzt Not-Null-Constraint at
/usr/share/perl5/Finance/BeanCounter.pm line 1494.

which is translated into "NULL-Value in column »exchange« violates NON-
NULL-Constraint at ..."

The "XAUEUR=X" is correctly converted into the http://finance.yahoo.com-
Request:

http://download.finance.yahoo.com/d/quotes.csvr?e=.csv&f=snl1d1t1c1p2va2bapomwerr1dyj1x&s=XAUEUR=X

which results in the .csv file:

"XAUEUR=X",966.3192,"8/20/2010","5:54pm",N/A,N/A,N/A,N/A,N/A

which in fact does not carry any information about the exchange as there
is none.

The default value for the column "exchange" is an empty varchar() which
seems reasonable (as long no Oracle-DB is involved)

The culprit is the line

$cmd =~ s|'?N/A'?|null|g;   # convert (textual) "N/A" into (database)
null

in BeanCounter.pm which converts any 'N/A' into Database-NULL without
concern of their meaning.

I would gladly provide a (trivial) patch which implements an exception
to that N/A handling as far as the column "exchange" is concerned:

select symbol,name,exchange from stockinfo;
  symbol  |    name    | exchange
----------+------------+----------
 XAUEUR=X | XAU to EUR |
(1 Zeile)

** Affects: beancounter (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  Binary package hint: beancounter
  
  After setting up the beancounter package I tried to insert some data
  about Gold-EUR-Exchange rates into the database by entering:
  
  beancounter addportfolio 'XAUEUR=X':10:EUR:Gold:mine:331.00:20040501
  
  This command results in an errormessage:
  
  FEHLER:  NULL-Wert in Spalte »exchange« verletzt Not-Null-Constraint at
  /usr/share/perl5/Finance/BeanCounter.pm line 1494.
  
  which is translated into "NULL-Value in column »exchange« violates NON-
  NULL-Constraint at ..."
  
- 
- The "XAUEUR=X" is correctly converted into the 
http://finance.yahoo.com-Request:
+ The "XAUEUR=X" is correctly converted into the http://finance.yahoo.com-
+ Request:
  
  
http://download.finance.yahoo.com/d/quotes.csvr?e=.csv&f=snl1d1t1c1p2va2bapomwerr1dyj1x&s=XAUEUR=X
  
  which results in the .csv file:
  
  "XAUEUR=X",966.3192,"8/20/2010","5:54pm",N/A,N/A,N/A,N/A,N/A
  
  which in fact does not carry any information about the exchange as there
  is none.
  
- The default value for the column "exchange" is an empty which seems
- reasonable (as long no Oracle-DB is involved)
+ The default value for the column "exchange" is an empty varchar() which
+ seems reasonable (as long no Oracle-DB is involved)
  
  The culprit is the line
  
  $cmd =~ s|'?N/A'?|null|g;   # convert (textual) "N/A" into (database)
  null
  
  in BeanCounter.pm which converts any 'N/A' into Database-NULL without
  concern of their meaning.
  
  I would gladly provide a (trivial) patch which implements an exception
  to that N/A handling as far as the column "exchange" is concerned:
  
  select symbol,name,exchange from stockinfo;
-   symbol  |    name    | exchange 
+   symbol  |    name    | exchange
  ----------+------------+----------
-  XAUEUR=X | XAU to EUR | 
+  XAUEUR=X | XAU to EUR |
  (1 Zeile)

-- 
Cannot insert Gold quotes into beancounter portfolio
https://bugs.launchpad.net/bugs/622258
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to