I thought to understand that you cannot use a datawindow to insert a blob
(image) into a database. That you had to first insert a row and then use an
update statement to get the blob variable into the blob column (which I have
been trying to do unsuccessfully).
Anyway, I did 'end up' with a row in my image table and wanted to see if I
could 'see' the image.
When I try to create a datawindow, I cannot select the blob field (long
binary) and I get a message stating "This column's data type requires the
use of an embedded SQL statement."
Ugh. I was at least hoping to be able to 'view' image files using a
datawindow. Is this not possible?
I saw lots of posts that seemed to suggest that to view an image that was
coming from a database, you first had to read it using ReadEx, write it to a
file and then display it from there. Is that possible?
If that is the case, then blobs are not for me as I need my datawindows to
print quickly and would not be interested in the extra step of reading from
the database, writing to a file and then reading the file (unless I am
missing some basic concept).
Can anyone advise if you can actually add image blobs (long binary) to a
datawindow and then simply do dw_1.print()?
Thanks all!!
Paul
"Paul Murray" <pemu...@staysystems.com> wrote in message
news:49e579da$1@forums-1-dub...
Right, I seem to recall something about having to add the column later as an
OLE column?
Anyway, I will give that a try and let you know.
Thanks again!
Paul
"Clive Collie" <clive_doesn...@dillistone.com> wrote in message
news:49e5a76f$1@forums-1-dub...
Is the blob data not going into the database, or are you not able to extract
it and render it as an image in your app?
--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com
"Paul Murray" <pemu...@staysystems.com> wrote in message
news:49e614c8@forums-1-dub...
> Greetings All,
>
> I am going nowhere fast with trying to get a blob into my ASA table using
> PB 11.5.
>
> I thought maybe the Key Clause is wrong for the OLE column (Blob). Tried
> the InkEdit control, but that did not work either. Screenshot of
> datawindow is attached. Identity Key id 'image_id'.
>
> If someone can point me in the right direction, I would really, really
> appreciate it.
>
> Thanks, Paul
>
> Here is my code:
>
> messagebox("DocPath",docpath)
> messagebox("advertiser_id",string(advertiser_id))
>
> integer li_fnum
> long ll_bytes
> blob image
>
> li_fnum = FileOpen(docpath, StreamMode!)
>
> messagebox("File number / File id",string(li_fnum))
>
> ll_bytes = FileReadEx(li_fnum, image)
>
> messagebox("Bytes Read from file: " + docpath,string(ll_bytes))
>
> long newrow
> long image_id
>
> datastore image_maintenance
> image_maintenance = CREATE Datastore
> image_maintenance.DataObject = "dw_image_maintenance"
> image_maintenance.settransobject(sqlca)
> newrow = image_maintenance.insertrow(0)
>
> //image_maintenance.setitem(newrow,"image",image) //does not work
> image_maintenance.setitem(newrow,"image_description",docpath)
> image_maintenance.setitem(newrow,"advertiser_id",advertiser_id)
>
> image_maintenance.update()
>
> commit;
>
> image_id = image_maintenance.getitemnumber(newrow,"image_id")
>
> messagebox("***image_id***", string(image_id))
>
> UPDATEBLOB "image"
> SET image = :image
> where image_id = :image_id;
>
> commit;
>
> dw_2.retrieve(advertiser_id)
>
> st_1.hide()
> sle_1.hide()
> cb_selectfile.hide()
> cb_movefile.hide()
> mle_selected.hide()
>
> st_2.hide()
> sle_2.hide()
> cb_7.hide()
> cb_3.hide()
> mle_1.hide()
>
>
>
>
>
> "Paul Murray" <pemu...@staysystems.com> wrote in message
> news:49e5deac@forums-1-dub...
That is a great question.
I have no idea where it is failing. I don't know how to 'look' at the Blob
without the datawindow so the Blob may or may not have been successfully
inserted into my table.
I do 'see' that the file sizes of the images that are read are about 60,000
bytes (or is it bits).
Paul
"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:49e61d3a@forums-1-dub...
If anything, run this query in PB and see if there's data in your blob
column:
Select <non-blob columns>,
(if image is NULL then 'nope' else 'I see data' endif) as blob_test
from <tablename>
--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com
"Paul Murray" <pemu...@staysystems.com> wrote in message
news:49e62bbc@forums-1-dub...
Thanks! I opened up SQL Anywhere Central and was able to see the images in
the database. Very cool!
Now I am thinking that instead of an OLE column, maybe I should try to read
the data from the table and use SetPicture on a picture control?
I could loop through the rows after I retrieve the dw and do setpicture()
for each one. I guess I could use SelectBlob, assign to a variable, and
then use setpicture to make the image show in the dw?
Yes? No? Is there a better way?
Thanks!
Paul
"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:49e630f6$1@forums-1-dub...
Have you read this document? http://www.sybase.com/detail?id=44008
--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com
"Paul Murray" <pemu...@staysystems.com> wrote in message
news:49e644a9$1@forums-1-dub...
I have had that document up on my PC for days. I think the examples for
adding and OLE column (which is what I think is required here) are a little
thin.
Is there a different in print quality using a picture control vs. a BLOB on
the datawindow?
Paul
"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:49e65f51@forums-1-dub...
You are saying that if I have a picture control on a datawindow, I cannot
use SetPicture?
If true, I really need help with trying to square away why this does not
work. I moved the whole pbl down to my laptop on XP and found it did not
work there either. Do I need to do a nested select in the datawindow to get
the image to show (something with selectblob) or is the datawindow supposed
to do that automatically when you create an OLE column? Or am I doing it
wrong? Is creating an OLE column the wrong approach?
Thanks!!
Paul
"Paul Horan[Sybase]" <phoran_remove@remove_sybase.com> wrote in message
news:49e65f51@forums-1-dub...
Let's say you table contains three column: pk, description and blob
Create a data window and use the pk and description columns in the normal
way.
Now in the dw designer add the inkpic control. When you do this you get the
little Ink Picture Database Setup dialog. Choose your table, pick any column
you like for the Ink data, since we are not saving it doesn't matter. In Col
for background image choose your blob column. In key clause set the pk of
the row to the field you used in the datawindow. So if your key column in
the containing dw was called pk and the pk of the table is called pk you
would set the key clause to
pk = :pk
or primary key in table = : primary key column object in dw.
Now as long as the data in the blob feld is a well known bitmap format you
should see your picture. It work better than a picture control because the
picture control distorts the picture. Let's hope PB12 has got a better
solution because this messing about should have been sorted about 15 years
ago like it was in Delphi 1.
"Paul Murray" <pemu...@staysystems.com> wrote in message
news:49e5deac@forums-1-dub...
Took me a while to find your response because it was out to the left.
I now have the InkPicture control working, thank you very much.
Is it safe to say that the OLE Blob field simply does not work? I would
hate to see anyone else spend so much time trying to get it to work.
Thanks, again!!
Paul
"Clive Collie" <clive_doesn...@dillistone.com> wrote in message
news:49e6e8e1$1@forums-1-dub...
Why would that be?
Is there any difference in print quality using InkPicture. I am guessing
that I can print in any resolution based on the density of the original
image?
Here is the SQL for my datawindow that is supposed to display the
image/blob:
SELECT "image"."image_id",
"image"."advertiser_id",
"image"."image_description",
"image"."mobilink_timestamp"
FROM "image"
WHERE "image"."advertiser_id" = :advertiser_id
Of course, the SQL does not reference the BLOB column "image" because you
cannot select it in the datawindow painter. I can SEE the images in Sybase
Central in my image table.
"Paul Murray" <pemu...@staysystems.com> wrote in message
news:49e69dd7@forums-1-dub...
It works just fine... There's an example of it's use in the sample apps.
w_ole_example.
But the BLOB data needs to have been *created* with that OLEControl. That
places an OLE "wrapper" around the raw binary data, and that wrapper
contains metadata about the blob - essentially "this is a Word doc and it
opens with MSWORD.EXE", or "this is a picture and it opens with PAINT.EXE".
Without that, PB has no idea what to do with the binary data. It's just a
random collection of bits...
"Manuel Espinoza" <jmespinoza_no_spam@seicom_dot_com_dot_mx> wrote in
message news:49e745e1@forums-1-dub...
> PMFJI, But I've tried to get the InkControl many times with no luck. I
> get this error after setting up and retreieve in DW's Painter:
>
> ---------------------------
> Preview - d_archivos_externos
> ---------------------------
> Select Error: ct_data_info(GET): user api layer: external error: A
> CS_IODESC can only be retrieved for text or image columns. Column 1 is
> not a text or image column.
> ---------------------------
> Aceptar
> ---------------------------
>
> My table "archivos_externos" has 3 columns as PK, and my blob field is
> called "archivo". The PK columns are "em_clave", "link_id", "id_archivo".
> So ended up with the config showed in the attached image. I'm guessing
> this may be due to my versions of ASE Client/Server? I have PB10.2.1 9004
> on WinXP Pro SP3 and ASE 11.9.2 Client, and the database is an ASE 12.5 on
> Win2003 Server.
>
> Any idea?
>
>
>
> "Clive Collie" <clive_doesn...@dillistone.com> escribió en el
> mensaje news:49e6e8e1$1@forums-1-dub...
This was another unsuccessful try :-(
I adeed a dummy image column as suggested but the only improvement was no
error message, just a blank control :-s
Maybe some day will get this control running...
"Clive Collie" <clive_doesn...@dillistone.com> escribió en el
mensaje news:49e7579e$1@forums-1-dub...
if your primary key is named em_clave, try this in the 'Key Clause' field:
EM_CLAVE = :em_clave
Saludos
"Manuel Espinoza" <jmespinoza_no_spam@seicom_dot_com_dot_mx> escribió en el
mensaje news:49e745e1@forums-1-dub...
> PMFJI, But I've tried to get the InkControl many times with no luck. I
> get this error after setting up and retreieve in DW's Painter:
>
> ---------------------------
> Preview - d_archivos_externos
> ---------------------------
> Select Error: ct_data_info(GET): user api layer: external error: A
> CS_IODESC can only be retrieved for text or image columns. Column 1 is
> not a text or image column.
> ---------------------------
> Aceptar
> ---------------------------
>
> My table "archivos_externos" has 3 columns as PK, and my blob field is
> called "archivo". The PK columns are "em_clave", "link_id", "id_archivo".
> So ended up with the config showed in the attached image. I'm guessing
> this may be due to my versions of ASE Client/Server? I have PB10.2.1 9004
> on WinXP Pro SP3 and ASE 11.9.2 Client, and the database is an ASE 12.5 on
> Win2003 Server.
>
> Any idea?
>
>
>
> "Clive Collie" <clive_doesn...@dillistone.com> escribió en el
> mensaje news:49e6e8e1$1@forums-1-dub...
"Manuel Espinoza" <jmespinoza_no_spam@seicom_dot_com_dot_mx> wrote in
message news:49e77198@forums-1-dub...
Thanks anyway.
"MiguelBR" <migue...@yahoo.es> escribió en el mensaje
news:49e82fdb$1@forums-1-dub...
Anyway this InkControl would be a plus to me; the app is running using the
"retrieve -> write to temp file -> show image -> delete temp file" process.
I'm a bit concerned because it's hard to admit that I can't get it to work
:-(
Thanks!
"Clive Collie" <clive_doesn...@dillistone.com> escribió en el
mensaje news:49e842ff@forums-1-dub...