Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-02

Access to  PostgreSQL

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Pino Zollo

Il sabato 20 febbraio 2010 17:17:19
ha scritto:

Show quoted text 5 lines
Correct. A grid cannot show blobs. In order to know it is empty, it must read it first. So you will always see (blob). This is why I for my current project at work choose a varchar(255) (or shorter) for text, since it mostly contained labels and captions. These will be returned as string.

Well, the Data Base is already there and used by other applications, so I will not change it.

Just for practising I modified the "test2pg" program that comes with FP to make it read into my database and it works perfectly. See the attached source well compressed.

Here is the output on the terminal: TEXT, REAL and times are properly printed. ------------------
pino at IK1CHE:~/LAZARUS$ ./testpg2
Number of Fields : 4
|call |qso_date |time_on |freq |
+----------+----------+----------+----------+
|Dummy |2000-01-01| | |
|I1BRT |2009-10-05|19:30:00 |0.555542 |
|IK1CHE |2002-10-14|19:56:50 |0.135546 |
|YV4AB |2009-12-21|22:43:07 |14.2 |
|CO2NO |2009-12-21|22:52:15 |14.2 |
-------------------

So the data-aware grid or other components are buggy....

As I am new to the list I do not know to whom to tell it....maybe the expert is reading this notes.
I can provide more detail on the data base structure if needed.

.....talking about bugs....I have 2 or 3 more....

Just for tasting here Ctl-V does not work on the IDE editor, but Ctl-C copies OK...very annoying while editing....
but the menu EDIT...Paste works.

Best Regards

Pino

"In the universe there is no time existing as a physical reality, there is no past, no present and no future" "Time is a mind construction into which one experiences motion" "Time is a flow of irreversible material changes" -Davide Fiscaletti Key ID: 0xF6768208 Key fingerprint = B16D 0A7C 5B29 A334 CE6A 71F6 EAF8 3D88 F676 8208 Key server: hkp://wwwkeys.eu.pgp.net -------------- next part -------------- A non-text attachment was scrubbed... Name: testpg2.pp.zip Type: application/x-zip Size: 1013 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100220/81e36b99/attachment.bin>

Reply by email

Joost van der Sluis
to Pino Zollo
Pino Zollo wrote 13 lines
Il sabato 20 febbraio 2010 17:17:19 ha scritto: > Correct. A grid cannot show blobs. In order to know it is empty, it must > read it first. So you will always see (blob). This is why I for my > current project at work choose a varchar(255) (or shorter) for text, > since it mostly contained labels and captions. These will be returned as > string. Well, the Data Base is already there and used by other applications, so I will not change it. Just for practising I modified the "test2pg" program that comes with FP to make it read into my database and it works perfectly.

Well, this program calls libpq directly. I doubt that you do the same in your Lazarus program. I think you use a TSQLQuery there?

Maybe you can modify the packages/fcl-db/src/sqldb/examples/dshowtable example which comes with fpc to use a TSQLQuery to show your table.

Show quoted text 14 lines
Here is the output on the terminal: TEXT, REAL and times are properly printed. ------------------ pino at IK1CHE:~/LAZARUS$ ./testpg2 Number of Fields : 4 |call |qso_date |time_on |freq | +----------+----------+----------+----------+ |Dummy |2000-01-01| | | |I1BRT |2009-10-05|19:30:00 |0.555542 | |IK1CHE |2002-10-14|19:56:50 |0.135546 | |YV4AB |2009-12-21|22:43:07 |14.2 | |CO2NO |2009-12-21|22:52:15 |14.2 | ------------------- So the data-aware grid or other components are buggy....

Let's not jump onto conclusions.

btw, that the TDBGrid shows blobs as (blob) is normal. You can avoid this by using persistent fields.

Joost.

Reply by email