Re: [firebird-support] Replacement of parameters within a stored procedure

2012-12-15 Thread Mark Rotteveel
On 14-12-2012 21:49, Dmitry Kuzmenko wrote:
 Hello, SoftTech!

 Saturday, December 15, 2012, 12:36:32 AM, you wrote:

 S I have used Execute Statement in the past.  Using it to run SQL
 S statements built on the fly.  What my problem is, is taking an existing 
 SQL statement and
 S replacing the Param1 and Param2 with actual values.  Again, I cannot build 
 it on the fly.

 well, then, I can't understand the problem.
 You have statement in the varchar variable, and you can change it
 to anything.
 And, ES accepts parameters.

EXECUTE STATEMENT only accepts parameters on Firebird 2.5, not on 
Firebird 1.5 (which is the version SoftTech is using).

Mark
-- 
Mark Rotteveel


Re: {Disarmed} Re: [firebird-support] Replacement of parameters within a stored procedure

2012-12-15 Thread SoftTech
OK, I'm sure I've seen this in the list before...  Where can I find 
documentation on moving from v1.5 to v2.5?  

  - Original Message - 
  From: Mark Rotteveel 
  To: firebird-support@yahoogroups.com 
  Sent: Saturday, December 15, 2012 4:23 AM
  Subject: {Disarmed} Re: [firebird-support] Replacement of parameters within a 
stored procedure



  On 14-12-2012 21:49, Dmitry Kuzmenko wrote:
   Hello, SoftTech!
  
   Saturday, December 15, 2012, 12:36:32 AM, you wrote:
  
   S I have used Execute Statement in the past. Using it to run SQL
   S statements built on the fly. What my problem is, is taking an existing 
SQL statement and
   S replacing the Param1 and Param2 with actual values. Again, I cannot 
build it on the fly.
  
   well, then, I can't understand the problem.
   You have statement in the varchar variable, and you can change it
   to anything.
   And, ES accepts parameters.

  EXECUTE STATEMENT only accepts parameters on Firebird 2.5, not on 
  Firebird 1.5 (which is the version SoftTech is using).

  Mark
  -- 
  Mark Rotteveel


  
  -- 
  This message has been scanned for viruses and 
  dangerous content by MailScanner, and is 
  believed to be clean. 

[Non-text portions of this message have been removed]



[firebird-support] Modelling XML data in a Firebird database

2012-12-15 Thread Matthias Hanft
Hello,

I'm getting a daily electronic account statement from my bank (format
'MT940' for those of you who deal with that kind of data, too).  Amongst
others, the account statement includes all money transfers from my
customers which I write into a Firebird database - each money transfer
information consists of just a few well-defined data fields which can
easily mapped to an SQL data row (including fields like name/account
number/bank code of sender, amount, reason for payment etc.).

While the new SEPA bank standard is currently introduced, a bank
customer can switch his electronic statement from 'MT940' to
'camt.053' format.  'camt.053' is a hierarchical XML file, where
many, many, many fields are defined (from which about 10% are
currently used, though).  Depending on which bank you are
using and from which other bank the money transfer from your
customer comes, you can't foresee at all which possible fields
are used and which are not.

There *is* some way to convert some camt.053 fields into the
old MT940 fields (and, consequently, keep the old FB database
as is), but you'd loose some important information then -
so you don't really want to strip the new format down to the
old one.

Thinking about a new database scheme for camt.053, the following
comes to my mind:

a) provide database fields for *all* defined XML fields (which
would lead to 90% NULL fields and make the whole database
somewhat unmanageable)
b) provide just database fields for already used XML fields and
subsequently add new fields when banks start to use new XML
fields (which would require slight database and client changes
each time)
c) create a unique ID for each money transfer and store an open-
end key-value pair for that event (with the event ID as
foreign key), separating hierarchical field names e.g. by a
slash (Document/Stmt/Ntry/BookgDt for the booking date of
the entry of the statement of the document).  Would be pretty
universal (and future-proof), but could just be implemented
with universal string data types as values, even if the value
is an amount of money or a date (so it's hard to search events
'between' some dates or get all money transfers above a certain
amount or something like that)
d) store the whole XML account statement as-is in a text blob;
retains *all* information without any loss (and would be future-
proof as well), but can't be searched at all (and might be slow,
and complicated to handle)
e) any other idea?

What do you suggest, thinking about flexibility, speed, and space?

For the moment, I tend to model c), maybe extending a key-value row
to key-integervalue-stringvalue-datevalue-currencyvalue and just
filling the approprate value field, leaving the others NULL.  And/or
using an additional type field to access the specific value field
directly.  (On the other hand, from the key name, it should be possible
to deduce the type automatically - this would have to be done while
filling the database anyway.)

Thank you for your advice - and for reading until here :-)

-Matt




++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com 

++
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

* To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

* To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/



Re: {Disarmed} Re: [firebird-support] Replacement of parameters within a stored procedure

2012-12-15 Thread Mark Rotteveel
On 15-12-2012 13:48, SoftTech wrote:
 OK, I'm sure I've seen this in the list before...  Where can I find 
 documentation on moving from v1.5 to v2.5?

The biggest breaking changes were between 1.5 and 2.0, so I guess 
http://www.firebirdsql.org/file/documentation/release_notes/html/install210.html
 
(Firebird 2 Migration  Installation) is your starting point. AFAIK this 
is the collection of the compatibility issues listed in the 2.0 and 2.1 
release notes, but it might still be worthwhile to read through the 2.0, 
2.1 and 2.5 releasenotes as well.

Mark
-- 
Mark Rotteveel