Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo Fields

Status
Not open for further replies.

lmajors

Programmer
Feb 20, 2004
3
US
I am trying to perform a changeto query to change a memo field in one table to a memo field in another table. "Operation is not supported for BLOB fields". How do I handle memo fields to update another table?
Thanks for any help.
 
lmajors,

You need to use ObjectPAL for this; neither QBE or SQL queries support memos.

If you could provide a few more details about what you're trying to do, we may be able to help get you started.

Hoping to help...

-- Lance
 
Using Paradox 10 this is what I am tring to do. Both "Comments" are M10.

qu=Query
ANSWER: :pRIV:ANSWER.DB

nomcom.DB | Preferences_ID | Comments |
Insert | _join8 | _com |

preferences_temp.DB | preferences_id | Comments |
| _join8 | _com |
EndQuery

if not executeQBE(qu) then
errorShow()
endIf

Thanks,
Lin
 
You will have to use tcursors to update the table.

Example:

VAR

TC1,TC2 TCURSOR

ENDVAR

SETMOUSESHAPE(MOUSEWAIT,TRUE)
MESSAGE("Updating table, please wait....")
TC1.OPEN("preferences_temp.DB")
TC2.OPEN("nomcom.DB")
TC2.EDIT()
SCAN TC1 :
TC2.INSERTRECORD()
TC2."preferences_id"=TC1."preferences_id"
TC2."Comments"=TC1."Comments"
TC2.POSTRECORD()
ENDSCAN
TC2.ENDEDIT()
TC2.CLOSE()
TC1.CLOSE()
MESSAGE("Table update complete, thank you."
SETMOUSESHAPE(MOUSEARROW,TRUE)

Now this example is very basic and relies upon Pdox to handle record locking and verification for you. It also will create a record in the noncom table for each record in the preferences_temp table. Seems kind of redundant to me, but I don't know your table structure. If you are wanting to only update certain types of records you can modify the scan to read.

SCAN TC1 FOR TC1."preferences_id" = "YOUR VARIABLE HERE" :

Personally I use querys only where I am pulling data into a users priv directory and modifing it there. In a multiuser enviornment TCursors are more reliable and easier to control.
 
I guess I should have changed my example I really don't need an insert but a changeto. How would I scan both tables for the same value?
Similar to:
qu=Query
ANSWER: :pRIV:ANSWER.DB

nomcom.DB | Preferences_ID | Comments |
| _join8 | changeto _com |

preferences_temp.DB | preferences_id | Comments |
| _join8 | _com |
EndQuery

if not executeQBE(qu) then
errorShow()
endIf

Thanks,
Lin
 
Do a straight joined query (checking all fields) to produce the complete record set you want to change (resulting in an answer.db table). Then change every record in the answer.db table using a tCursor scan loop. Finally, ADD the answer table back into the original table you wanted changed as an UPDATE.

Mac :)

"There are only 10 kinds of people in this world... those who understand binary and those who don't"

langley_mckelvy@cd4.co.harris.tx.us
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top