[This post is an archive from the old SQL Yoga forums]
Hi again,
Is it possible with SQL Yoga to pass binary data (I have a picture field in the Valentina DB) into the DB ?
If yes, how ?
Thx,
Christian
Passing Binary Data
Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, trevordevore
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Passing Binary Data
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Passing Binary Data
SQL Yoga attempts to work with binary data in a seamless fashion. Assuming you have defined your database column as a binary type then you should be able to insert the binary data as-is without doing anything special.
If you are having trouble then post your code along with info on your db schema and we can troubleshoot.
If you are having trouble then post your code along with info on your db schema and we can troubleshoot.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Location: Overland Park, Kansas
- Contact:
Re: Passing Binary Data
I think I discovered the problem :
--> passing binary data to an encrypted Valentina DB is not working (unencrypted Db is ok)
The problem is that I rely on encryption...
The code is really straightforward...
put sqlrecord_createObject("Picts") into theRecordA
answer file ""
put URL("binfile:"&it) into tPicBlob
put the ticks into tId
sqlrecord_set theRecordA,"pic",tBlob
sqlrecord_set theRecordA,"id",tId
sqlrecord_create theRecordA
The DB schema is pretty simple too (as I tried this in a little test stack):
tables
Picts
field order: Pic,id
primary key: id
fields
Pic
meta type: text
name: Pic
signed: false
type: PICTURE
default value: NULL
primary key: false
accepts null: true
limit:
id
meta type: sequence
name: id
signed: false
type: sequence
default value: NULL
primary key: true
accepts null: false
limit:
RecID
meta type: sequence
name: RecID
signed: false
default value:
--> passing binary data to an encrypted Valentina DB is not working (unencrypted Db is ok)
The problem is that I rely on encryption...
The code is really straightforward...
put sqlrecord_createObject("Picts") into theRecordA
answer file ""
put URL("binfile:"&it) into tPicBlob
put the ticks into tId
sqlrecord_set theRecordA,"pic",tBlob
sqlrecord_set theRecordA,"id",tId
sqlrecord_create theRecordA
The DB schema is pretty simple too (as I tried this in a little test stack):
tables
Picts
field order: Pic,id
primary key: id
fields
Pic
meta type: text
name: Pic
signed: false
type: PICTURE
default value: NULL
primary key: false
accepts null: true
limit:
id
meta type: sequence
name: id
signed: false
type: sequence
default value: NULL
primary key: true
accepts null: false
limit:
RecID
meta type: sequence
name: RecID
signed: false
default value:
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder