-- get image
  select doc into vtemp_doc from docs_doc where doc_id = .vdoc_id

   -- put graphic into file
   write .vtemp_doc to &vtemp_file


Troy


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Betaserver
Sent: Tuesday, September 02, 2003 8:38 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Extract images


I have a reverse to Christians question.. Can you extract an image from the
database and save it as a bmp/jpg/gif without user interaction ?

-- Frank Conroy, Systems Network Administrator
-- F.J. O'Hara Corp, Boston, MA
-- [EMAIL PROTECTED] - 617-790-3093


-----Original Message-----
From: Jim Limburg [mailto:[EMAIL PROTECTED]
Sent: Friday, August 29, 2003 4:09 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: insert images


Christian

One other reccomendation.. I would construct the whole command
into a text variable and then execute it with the ampersand...

Like:
SET VAR vm_cmd1 TEXT = 'INSERT INTO bilder (ut) VALUES'
SET VAR vm_cmd2 TEXT =
'(['C:/inetpub/wwwroot/Hjortmar/formbilder/220.jpg'])'
SET VAR vm_cmd TEXT = (.vm_cmd1 + ' ' + .vm_cmd2)
&vm_cmd

I have had a lot better luck running code like this, plus makes it easier
to trace when you can see the value of vm_cmd just before it executes.

I know some of the pure codists on this list would think it's a bit
much to go this route, but as I said, I have had a lot better luck
doing this, and besides, there have been some commands I have had
to concatenate together in this fashion just to get it to work.
They wouldn't work straight out.

Jim Limburg

Christian Hjortmar wrote:
> Can a variable be used as value in a valuelist?
>
> This is what the manual says I should do and it works:
> INSERT INTO bilder (ut)  VALUES
> (['C:/inetpub/wwwroot/Hjortmar/formbilder/220.jpg'])
>
> but this is what I am trying to use:
> INSERT INTO bilder (ut)  VALUES .vbild
>
> .vbild is a variable that contains the text
> (['C:/inetpub/wwwroot/Hjortmar/formbilder/220.jpg'])
>
> I would like to insert images in my database and the images are all in
> the same directory.
> Being a lazy boy I figured out the following code.
>
> This is my little eep:
>
> SET VAR vtal INTEGER = 219
> SET VAR vbild TEXT = ' '
> SET VAR vbildfil INTEGER = 1
> SET VAR vfram TEXT = '(['
> SET VAR vbak TEXT = '])'
> SET VAR vparfr TEXT = '
> SET VAR vparbak TEXT = '
>
> WHILE vtal < 16500 THEN
>
>   vbild = 'C:/inetpub/wwwroot/Hjortmar/formbilder/' + (CTXT(.vtal)) +
'.jpg'
>   vbildfil = (CHKFILE(.vbild))
>   vbild = .vfram + .vparfr + 'C:/inetpub/wwwroot/Hjortmar/formbilder/' +
> (CTXT(.vtal)) + '.jpg' + .vparbak + .vbak
>   IF vbildfil = 0 THEN
>     vbild = .vbild
>   ELSE
> ---***    INSERT INTO bilder (ut)  VALUES
> (['C:/inetpub/wwwroot/Hjortmar/formbilder/220.jpg']) ***---
> ---*** A variable containing the same thing as the text above does not
> work in an insert command !!! ***---
>     INSERT INTO bilder (ut)  VALUES .vbild
>   ENDIF
>
>   SET VAR vtal = (.vtal + 1)
> ENDWHILE
> RETURN
>
>
> Regards from Christian Hjortmar
> + 46 46 2119142
>

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [EMAIL PROTECTED]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [EMAIL PROTECTED]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================

Reply via email to