Dynamic graphics generation inside plperlu query, odbc and MS Access display
От | Philippe Lang |
---|---|
Тема | Dynamic graphics generation inside plperlu query, odbc and MS Access display |
Дата | |
Msg-id | 6C0CF58A187DA5479245E0830AF84F421D0EA8@poweredge.attiksystem.ch обсуждение исходный текст |
Ответы |
Re: Dynamic graphics generation inside plperlu query, odbc and MS Access display
(Ludek Finstrle <luf@pzkagis.cz>)
|
Список | pgsql-odbc |
Hi, I'm trying to generate an image inside a plperlu function (PG 8.1.4), and to display it in a MS Access form, through ODBC. I'm using the GD library for this. Here is the test code: ---------------------------------------------------------------------------- CREATE OR REPLACE FUNCTION test_gd ( IN a int4, IN b int4, OUT val int4, OUT image bytea ) RETURNS SETOF record AS $$ #---------------------------------------------------------------------------- #-- Configuration des paramètres de la fonction #---------------------------------------------------------------------------- @i = ('a', 'b'); @io = (); @o = ('val','image'); #---------------------------------------------------------------------------- #-- Préparation des paramètres de la fonction #---------------------------------------------------------------------------- &start_sub(@_); #---------------------------------------------------------------------------- #-- Test GD #---------------------------------------------------------------------------- use GD; # create a new image $im = new GD::Image(100,100); # allocate some colors $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); # make the background transparent and interlaced $im->transparent($white); # Put a black frame around the picture $im->rectangle(0,0,99,99,$black); # Draw a blue oval $im->arc(50,50,95,75,0,360,$black); # And fill it with red $im->fill(50,50,$black); $output{'image'} = $im->gif; $output{'val'} = $input{'a'} + $input{'b'}; ret(@_); #---------------------------------------------------------------------------- #-- Helper functions #---------------------------------------------------------------------------- end_sub(@_); sub start_sub { init(@_); } sub end_sub { return undef; } sub init { $c = 0; foreach $i (@i) {$input{$i} = @_[$c++]}; foreach $io (@io) {$input{$io} = @_[$c]; $output{$io} = @_[$c++]}; foreach $o (@o) {$output{$o} = @_[$c++]}; } sub ret { while (($key, $value) = each %output) {if (!defined($value)) {elog(ERROR, 'Valeur indéfinie pour ' . $key)}}; return_next \%output; init(@_); } $$ LANGUAGE 'plperlu'; ---------------------------------------------------------------------------- The function looks good. If I run inside pgAdmin: select * from test_gd('7', '3'); I get: val image -------------- 10 GIF89ad The problem is that I'm unable to display anything in a MS Access form, and I'm not quite sure how to do it. I've been usinga "bytea" column type, is that correct? In Ms Access, I've created a pass-through query, linked it to a form with an OLE Dependant Control. But... Nothing. SameProblem id I try wbmp or jpeg images. Does anyone have an idea how to do this? Thanks. Note: I'm using the latest driver: psqlodbc-08_02_0002.zip ---------------------------------- Philippe Lang, Ing. Dipl. EPFL Attik System rte de la Fonderie 2 1700 Fribourg Switzerland http://www.attiksystem.ch Tel: +41 (26) 422 13 75 Fax: +41 (26) 422 13 76
Вложения
В списке pgsql-odbc по дате отправления:
Следующее
От:Дата:
Сообщение: [ psqlodbc-Bugs-1000679 ] UNION select returns wrong column type with ADO (VB6)