Wiki Home

SQL Problem - pleasehelp !


Namespace: VFP
AH - opera the accounting package .
lcLine1 = [put your field thingie here]
lcLine2 = [put your field thingie here]

'insert into x_table fields (daMemoField) values (lcLine1 + lcLine2)

assume for the moment you will munge programmatically the CR and LF as you see fit.
-- William Sanders

Thanks William - unfortunately I'm putting the info in, and Opera (the accounting package) will be reading it, so I can't really do any munging (is that the same as fudging?).

I'm trying to send invoice data to foxpro tables used by Opera. I think I've got everything pretty much nailed but I've hit a bit of a problem with a memo field.

I need to put 6 or 7 lines of text into the memo field and can't find the right syntax for the sql insert statement.

I'm accessing as a free table via odbc and I've tried...

'insert into x_table values('line one'+Char(13)+Char(10)+'line two')' which gives the error 'Table char.prg does not exist'

also

'insert into x_table values('line one'+Chr(13)+Chr(10)+'line two')' which gives the error 'Must specify additional parameters'

Most probably your table contains additional fields in which case you either have to specify placeholders for all the fields in the VALUES() clause or specify the name of the memo field:
'insert into x_table (mMemo) values('line one'+Chr(13)+Chr(10)+'line two')'
-- Daniel Gramunt

I didn't make this very clear did I. Yes, there are other fields and I have values for all of them in the Values() clause. It does seem from your example that '+Chr(13)+Chr(10)+' is valid syntax?

I've also tried through a .dbc but it didn't appear to make any difference.

Can anyone help? Please?

Watch out for nested quotes. In your above example, you use single quotes for the outer and inner
quotes. NOT ALLOWED. Try using double quotes on the outside. --- Ray Kirk

---
Big thanks to all who answered. In the end the '+chr()+chr()+' did the trick. I was sure I'd tried it like that, but maybe not.

Also just to say what a great idea the wiki is. Any chance of a Delphi Wiki?

Mick Woods.
Category Questions
( Topic last updated: 2004.06.25 07:14:33 AM )