dbTalk Databases Forums  

Graphic from Pdox to SQL ?

comp.databases.paradox comp.databases.paradox


Discuss Graphic from Pdox to SQL ? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bjorn Sagbakken
 
Posts: n/a

Default Graphic from Pdox to SQL ? - 11-11-2006 , 10:13 AM






Hello.

I'm sure I've seen this issue discussed before, but now I cannot find it. So
here is the question:

I have converted several Paradox tables to MS-SQL-tables, and use Paradox as
front-end tool, all with success, except with those tables having a graphic
field type in Paradox. In the SQL, I guess this field type correspond to
"image" type. I have written a test-script in Paradox to copy the graphic
from Pdox to SQL, using tcursors and graphic variables. There is no
errormessage running this, but the graphic will not stick in the SQL table,
or the cannot be retieved back to Paradox.

Anyone who knows a trick or two?

(I use Paradox 11)

Thanks,
Bjorn



Reply With Quote
  #2  
Old   
Ed Nash
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-11-2006 , 12:21 PM






Bjorn Sagbakken wrote:

Quote:
There is no errormessage running this, but the graphic will not stick in the SQL table,
or the cannot be retieved back to Paradox.
How big is the graphic file? The BDE cannot transfer via ODBC BLOB
files larger than 1000000 bytes.


Reply With Quote
  #3  
Old   
Bjorn Sagbakken
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-11-2006 , 01:58 PM



"Ed Nash" <name (AT) mail (DOT) com> wrote

Quote:
Bjorn Sagbakken wrote:

There is no errormessage running this, but the graphic will not stick in
the SQL table, or the cannot be retieved back to Paradox.

How big is the graphic file? The BDE cannot transfer via ODBC BLOB files
larger than 1000000 bytes.
Oh, the files are quite small. At least some of them, smaller than your
statement for limitation. I ran a tcursor scan that saved the graphics to
jpg-files just to check. But you set me on an idea; maybe there are options
in the BDE for the SQL connection?




Reply With Quote
  #4  
Old   
Ed Nash
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-11-2006 , 02:13 PM



Bjorn Sagbakken wrote:

Quote:
field type in Paradox. In the SQL, I guess this field type correspond to
"image" type.
Just to make sure you are using the correct type, have you tried loading
images into your SQL base from a command line, outside of Paradox?
Oracle has a loader program called SQL*Loader for that. I think it is
called "bulk loader" in MS-SQL.


Reply With Quote
  #5  
Old   
Ed Nash
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-11-2006 , 02:21 PM



Bjorn Sagbakken wrote:

Quote:
jpg-files just to check. But you set me on an idea; maybe there are options
in the BDE for the SQL connection?
- There are some things to tweak. I don't have the BDE in front of me
so I can't help much now.

- How are you attempting to post from Pdox to MS-SQL: tcursor directly,
tcursor.add(), table add(), etc? IIRC, I could never get an SQL INSERT
to work so I always did a table (not tcursor) add. Attach a table var
to the remote table and another to a local PRIV table, then add local to
remote.

- Are you first reading the source JPG, using readFromFile, into a BLOB
or GRAPHIC field before attempting to load to the server?


Reply With Quote
  #6  
Old   
Bjorn Sagbakken
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-12-2006 , 03:26 AM



"Ed Nash" <name (AT) mail (DOT) com> wrote

Quote:
Bjorn Sagbakken wrote:

jpg-files just to check. But you set me on an idea; maybe there are
options in the BDE for the SQL connection?

- There are some things to tweak. I don't have the BDE in front of me so
I can't help much now.

- How are you attempting to post from Pdox to MS-SQL: tcursor directly,
tcursor.add(), table add(), etc? IIRC, I could never get an SQL INSERT to
work so I always did a table (not tcursor) add. Attach a table var to the
remote table and another to a local PRIV table, then add local to remote.
I have tried to post from Pdox to MS-SQL directly with tcursors, one tcursor
pointing to the Pdox table and one pointing to the SQL table; using
insertrecord, copyrecord, and later also copying the imagefield alone, not
the whole record. Tried tcursor.add(), but it fails. I have also tried to
temporary write the graphic content to a file(both bmp and jpg) and read it
back into a graphic variable before inserting this to the SQL-field. Haven't
tried SQL INSERT or table add.
I will check out table add.

Quote:
- Are you first reading the source JPG, using readFromFile, into a BLOB or
GRAPHIC field before attempting to load to the server?
Basically the graphic content resides in a Paradox table with GRAPHIC as the
field type, and ideally this should go directly to the SQL, but yes, I have
also tried to readfromfile.




Reply With Quote
  #7  
Old   
Bjorn Sagbakken
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-12-2006 , 03:39 AM



"Ed Nash" <name (AT) mail (DOT) com> wrote

Quote:
Bjorn Sagbakken wrote:

field type in Paradox. In the SQL, I guess this field type correspond to
"image" type.

Just to make sure you are using the correct type, have you tried loading
images into your SQL base from a command line, outside of Paradox? Oracle
has a loader program called SQL*Loader for that. I think it is called
"bulk loader" in MS-SQL.
No, haven't tried this yet. I searched some for "bulk loader" but I found no
easy program to do a quick test. Eventually I will use .NET for web-pages,
so I need to figure out how to store images into the SQL from that side
also. Maybe I should just jump into that....




Reply With Quote
  #8  
Old   
Ed Nash
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-12-2006 , 06:07 AM



Bjorn Sagbakken wrote:

Quote:
Basically the graphic content resides in a Paradox table with GRAPHIC as the
field type, and ideally this should go directly to the SQL, but yes, I have
also tried to readfromfile.
How about readfromfile into a Paradox BLOB then add the Paradox table to
the MS-SQL table? I have done this before with both MS-SQL and Oracle.
I remember experimenting with the GRAPHIC type and not having luck.
Using a BLOB seems to make the most sense to be because a BLOB just
stores raw bits and all you want to do is move the bits to SQL.


Reply With Quote
  #9  
Old   
Anders Jonsson
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-12-2006 , 11:50 AM



Quote:
I have written a test-script in Paradox to copy the graphic from Pdox to
SQL, using tcursors and graphic variables.
Björn,

Try to use a binary variable instead of a graphic one.

I use readfromfile to get the image into a binary variable and then tCursors
to get it into the MSSQL table.

Anders





Reply With Quote
  #10  
Old   
Jim Hargan
 
Posts: n/a

Default Re: Graphic from Pdox to SQL ? - 11-12-2006 , 04:37 PM



On Sun, 12 Nov 2006 10:39:31 +0100, Bjorn Sagbakken wrote:

Quote:
Eventually I will use .NET for web-pages,
so I need to figure out how to store images into the SQL from that side
also.
At the risk of showing my ignorance of most of the topics discussed in this
thread -- are you trying to serve images into web pages? If you are, you
realize that the web page won't contain the bits and bytes of the actual
image, but only the path (URL) to where the image is stored as a jpg, png,
or gif. So maybe you only need to store the images's URLs in your SQL
table, and not the images themselves. All you need to do for the images is
save them as jpegs and load them into a subdirectory on your web site
server, then store the paths to these images in the table.


Jim Hargan


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.