Re: [fpc-pascal] Re: Delphi's anonymous functions in Free Pascal

2011-10-24 Thread waldo kitty
On 10/21/2011 01:25, Jürgen Hestermann wrote: Florian Klämpfl schrieb: > If anybody does not see why increasing complexity without a good reason > should be avoided, I recommend: I agree wholeheartly. In the past Pascal was a simple still powerfull language but meanwhile it has become a catchm

Re: RE : [fpc-pascal] Re: How to insert a record and get the primary keywith sqldb?

2011-10-24 Thread Marcos Douglas
On Mon, Oct 24, 2011 at 11:26 AM, Graeme Geldenhuys wrote: > > On 2011-10-24 15:15, Ludo Brands wrote: > > > > Most databases have functions to create GUID's (with different randomness > > quality and different storage requirements): > > No, no, no... you are missing the point of this thread, and

RE : RE : [fpc-pascal] Re: How to insert a record and get the primarykeywith sqldb?

2011-10-24 Thread Ludo Brands
> > > > Most databases have functions to create GUID's (with different > > randomness quality and different storage requirements): > > No, no, no... you are missing the point of this thread, and > what I meant by using a GUID. The idea is that you can > created the GUID values client-side befo

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread michael . vancanneyt
On Mon, 24 Oct 2011, Graeme Geldenhuys wrote: On 2011-10-24 14:25, michael.vancann...@wisa.be wrote: And, very important but often underestimated: At least our clients can read an integer primary/foreign key aloud over the phone when the need arises. I can't hear them doing that with a GUID

Re: RE : [fpc-pascal] Re: How to insert a record and get the primary keywith sqldb?

2011-10-24 Thread Graeme Geldenhuys
On 2011-10-24 15:15, Ludo Brands wrote: > > Most databases have functions to create GUID's (with different randomness > quality and different storage requirements): No, no, no... you are missing the point of this thread, and what I meant by using a GUID. The idea is that you can created the GUID

Re: [fpc-pascal] Re: How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Graeme Geldenhuys
On 2011-10-24 14:43, michael.vancann...@wisa.be wrote: > We will of course support GUID PKs, although in my opinion, there is > precious little to support as it will in general be client code that > generates the GUID (unless I am much mistaken in what is common > practise) ? That is indeed the c

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Graeme Geldenhuys
On 2011-10-24 14:25, michael.vancann...@wisa.be wrote: > > And, very important but often underestimated: > At least our clients can read an integer primary/foreign key aloud over the > phone when the need arises. I can't hear them doing that with a GUID :-) Enable client-side logging (our apps h

Re: [fpc-pascal] Indy 10 HTTP Server component with FPC

2011-10-24 Thread Graeme Geldenhuys
On 2011-10-24 13:23, Burkhard Carstens wrote: > > For TIdTCPServer I manually add the IPv4 binding like this: > IdTCPServer1.Bindings.add.IPVersion:=Id_IPv4; > IdTCPServer1.Active:=true; > > Without that, Activate fails on linux systems that have ipv6 enabled. Thanks Bulkhard! Finally I am maki

RE : [fpc-pascal] Re: How to insert a record and get the primary keywith sqldb?

2011-10-24 Thread Ludo Brands
> > Summary: > > 1. A lot of (or some) people don't like GUID PKs > > 2. Some (or a lot of) people do. > > > > Regardless of being in camp 1 or 2, I think FPC should > recognize that > > both 1. and 2. are used in practice. Of course, if developers don't > > want to contribute code to support 2,

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Marco van de Voort
In our previous episode, Henry Vermaak said: > >> You just discarded most Microsoft product designs =-) > >> They use GUIDs all over the place :-) > > > > At least they designed them in when they were still unique. (based on Mac > > address) > > It's pretty easy to spoof mac addresses? True, but

Re: [fpc-pascal] Re: How to insert a record and get the primary key with sqldb?

2011-10-24 Thread michael . vancanneyt
On Mon, 24 Oct 2011, Reinier Olislagers wrote: On 24-10-2011 14:23, Henry Vermaak wrote: On 24/10/11 13:05, Marco van de Voort wrote: In our previous episode, michael.vancanneyt-0is9kj9s...@public.gmane.org said: Henry Summary: 1. A lot of (or some) people don't like GUID PKs 2. Some (or

[fpc-pascal] Re: How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Reinier Olislagers
On 24-10-2011 14:23, Henry Vermaak wrote: > On 24/10/11 13:05, Marco van de Voort wrote: >> In our previous episode, >> michael.vancanneyt-0is9kj9s...@public.gmane.org said: Henry Summary: 1. A lot of (or some) people don't like GUID PKs 2. Some (or a lot of) people do. Regardless of being in cam

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread michael . vancanneyt
On Mon, 24 Oct 2011, Vincent Snijders wrote: 2011/10/24 : On Mon, 24 Oct 2011, Vincent Snijders wrote: 2011/10/22 Graeme Geldenhuys : 1) Use a GUID created at the time you do the Insert. This also means you can do Master/Detail records with no problems at all. I consider this bad adv

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Henry Vermaak
On 24/10/11 13:05, Marco van de Voort wrote: In our previous episode, michael.vancann...@wisa.be said: I consider this bad advice. GUID are bad primary keys, because of their size and the fact they are not sequential by design. You just discarded most Microsoft product designs =-) They use GUI

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Marco van de Voort
In our previous episode, michael.vancann...@wisa.be said: > > I consider this bad advice. GUID are bad primary keys, because of > > their size and the fact they are not sequential by design. > > You just discarded most Microsoft product designs =-) > They use GUIDs all over the place :-) At least

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Vincent Snijders
2011/10/24 : > > > On Mon, 24 Oct 2011, Vincent Snijders wrote: > >> 2011/10/22 Graeme Geldenhuys : >>> >>> 1) Use a GUID created at the time you do the Insert. This also means >>> you can do Master/Detail records with no problems at all. >> >> I consider this bad advice. GUID are bad primary keys

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread michael . vancanneyt
On Mon, 24 Oct 2011, Vincent Snijders wrote: 2011/10/22 Graeme Geldenhuys : 1) Use a GUID created at the time you do the Insert. This also means you can do Master/Detail records with no problems at all. I consider this bad advice. GUID are bad primary keys, because of their size and the fac

Re: [fpc-pascal] Indy 10 HTTP Server component with FPC

2011-10-24 Thread Burkhard Carstens
Am Sonntag, 23. Oktober 2011 00:04 schrieb Graeme Geldenhuys: > On 22/10/2011, Marco van de Voort wrote: > > I haven't tried for years, but I can remember some strange problems > > designtime that went away if you manually added a tidbinding in > > formcreate. > > I'm not using design-time usage a

Re: [fpc-pascal] Re: How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Reinier Olislagers
On 24-10-2011 11:14, michael.vancann...@wisa.be wrote: > On Mon, 24 Oct 2011, Reinier Olislagers wrote: >> Also, using INSERT...RETURNING it's very well possible to get the >> sequence value directly when inserting the data. > > Yes, but not all DBs support this. We use Firebird a lot, and it didn

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Graeme Geldenhuys
On 2011-10-24 12:40, Marcos Douglas wrote: > > GUID isn't the key, but a way to know how get the register before insert it. In our case we use the actual GUID value as the actual primary key. The GUID is unique in our database and across multiple databases. This is very important to us, because w

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Marcos Douglas
On Mon, Oct 24, 2011 at 7:13 AM, Vincent Snijders wrote: > > 2011/10/22 Graeme Geldenhuys : > > 1) Use a GUID created at the time you do the Insert. This also means > > you can do Master/Detail records with no problems at all. > > I consider this bad advice. GUID are bad primary keys, because of >

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Graeme Geldenhuys
On 2011-10-24 12:13, Vincent Snijders wrote: > > I consider this bad advice. GUID are bad primary keys, because of > their size and the fact they are not sequential by design. We did some speed tests between GUIDs (Char(36) as used by tiOPF which strips some chars from a normal GUID) and Int, Str

Re: [fpc-pascal] How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Vincent Snijders
2011/10/22 Graeme Geldenhuys : > 1) Use a GUID created at the time you do the Insert. This also means > you can do Master/Detail records with no problems at all. I consider this bad advice. GUID are bad primary keys, because of their size and the fact they are not sequential by design. Vincent __

Re: RE : [fpc-pascal] Re: How to insert a record and get the primary keywith sqldb?

2011-10-24 Thread Mark Morgan Lloyd
michael.vancann...@wisa.be wrote: Before MySQL 5.0.12 last_insert_id returns table 2, since 5.0.12 table 1. Triggers were introduced in 5.0.2. SQLServer's SCOPE_IDENTITY() returns table 1 (the trigger is out of scope) and @@IDENTITY returns 2. This mess is why I prefer sequences :-) :-) I

Re: RE : [fpc-pascal] Re: How to insert a record and get the primary keywith sqldb?

2011-10-24 Thread michael . vancanneyt
On Mon, 24 Oct 2011, Ludo Brands wrote: What's funny is that I never understood how the MySQL/SQL-Server way could correctly work. For example I have 2 tables, both with an auto-incremental field. Table 1 has an after insert trigger that does an extra insert in table 2. When I do an insert i

RE : [fpc-pascal] Re: How to insert a record and get the primary keywith sqldb?

2011-10-24 Thread Ludo Brands
> What's funny is that I never understood how the > MySQL/SQL-Server way could correctly work. For example I have > 2 tables, both with an auto-incremental field. > Table 1 has an after insert trigger that does an extra insert > in table 2. > When I do an insert in table 1 , what does 'last_i

Re: [fpc-pascal] Re: How to insert a record and get the primary key with sqldb?

2011-10-24 Thread michael . vancanneyt
On Mon, 24 Oct 2011, Reinier Olislagers wrote: On 22-10-2011 15:33, michael.vancanneyt-0is9kj9s...@public.gmane.org wrote: On Sat, 22 Oct 2011, Marco van de Voort wrote: In our previous episode, Felipe Monteiro de Carvalho said: Ok, now I want to insert a record in my table and I would l

[fpc-pascal] Re: How to insert a record and get the primary key with sqldb?

2011-10-24 Thread Reinier Olislagers
On 22-10-2011 15:33, michael.vancanneyt-0is9kj9s...@public.gmane.org wrote: > > > On Sat, 22 Oct 2011, Marco van de Voort wrote: > >> In our previous episode, Felipe Monteiro de Carvalho said: >>> Ok, now I want to insert a record in my table and I would like to >>> obtain the auto-generated Pri