×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Remote View -- Line Too Long

Remote View -- Line Too Long

Remote View -- Line Too Long

(OP)
I am in the process of converting vfp tables to sql server express.  I have the connection made and have used remote views.  For several tables this works fine.  

However, I have a few tables that, have very long field names.  When I try to create the remote view I receive an error that "line is too long".  I am assuming this means the field name as opposed to the number of fields which is about 245.  Is that correct? (In looking at the "view sql", I see it has truncated several of the field names).

Also, if it is the length of the field is there any way around it without having to go through and rename everything?

Thanks for any help.  

Greg

RE: Remote View -- Line Too Long

You didn't say what version of VFP you're using, but in VFP9 the maximum length of a field name is 128 characters, the maximum number of fields in a select statement is 255, and the maximum number of characters in a command line or macro substituted line is 8,192.

When you say the number of fields in the view is about 245, are they all coming from one table?  If so, I'd take a long, hard look at normalising that table.  And if they're coming from multiple tables, what are you going to do with all that data in one view?  

Good luck,
Jim

RE: Remote View -- Line Too Long

(OP)
I am using vfp 8 and a single table.  Do you know if the lengths you described for vfp 9 are the same for 8?  

While my fields are long, they are not 128 characters.  The fields exist in a table right now.  

RE: Remote View -- Line Too Long

Yes, those are the same in VFP8.  Probably you're bumping up against the command line limitation of 8,192 characters.  You might need to do something like the following.

CODE

LOCAL lnH1, lcSql, lnResult

lnH1 = SQLSTRINGCONNECT(Add in your connection string here)

TEXT TO lcSql NOSHOW PRETEXT 7
*(Create SQL View text goes here)
ENDTEXT

lnResult = SQLEXEC(lnH1, lcSql)
But again, I'd urge you to look at normalising that data.

Regards,
Jim

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close