on 04-17-2016 11:55 PM
I have a blob column in a data window, OLEdatabaseBLOB, that enables me to retrieve, update, and store an MS Word doc. If I hard code the key value in the key clause, works fine. If I switch to a variable (e.g., :job_id), it doesn't resolve. The SQL shows the key value as "?", null. So here's the dumb question, how do I pass a value to the variable in the key clause? I've tried doing it several ways through the data window arguments but to no avail.
James
Hi James;
This is super easy with the DW OLE Column mapping and yes, a little tricky if you have not done this before. I'll walk you through it - here are the steps I use:
1) Create a Table with a blob column defined inside it.
Here is what I am using for this walk through (SQLAnyWhere - Long Binary column) ...
2) Create a new DW and set a Retrieval Argument on the key column, as follows:
- ID => :ID in my example ...
3) Add an OLE Column to your new DWO, as follows:
4) Map the OLE Column to the DB Table Blob column, as follows:
5) Chris's Trick ... User won't see any OLE on Row Insert!
Thus, use this tip ... add a picture, place in back, slide behind OLE space:
6) Actual test ...
- Insert new row
- Double-Click icon
- Add MS-Word text
- File=>Close&Return (menu)
Last but not least, select the SAVE option in the DW Painter. Update () of course in your PB code.
HTH
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
thanks for your helpful guidance through this.
After trying out I realized (you marked it with very important), that the retrieval argument has to have the same name than the primary key.
In your example for the key clause id = :id this is shown.
If you name the retrieval argument e.g. 'isid', then retrieving the BLOB (with where clause id = :isid) brought me up an error. Seems not to be logical for me, but worked only in this way.
Regards
Bernhard
A question mark is shown when the DisableBind database parameter is not set.
But this does not mean that your SQL will fail.
Take a look at the your PowerBuilder help for further informations.
SyBooks Online (Archive) - DisableBind
SyBooks Online (Archive) - SQL Preview
hth
Arnd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.