Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7631631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:24:12+00:00 2026-05-31T06:24:12+00:00

I have a long SQL text that I want to assign to a query

  • 0

I have a long SQL text that I want to assign to a query SQL. I do this the following way:

SQL.Text:= 'SELECT T1.COLUMN1,T2.COLUMN2,T1COLUMN3..........,'+
          ' T1.COLUMNn FROM TABLE1 T1 INNER JOIN '+
          ' TABLE2 T2 ON T1.ID=T2.ID'+
          ' WHERE T1.COLUMN10=100'

The actual SQL is 20 times longer than this. My problem is with the line breaks. When I format the source code (Ctrl+D) it sometimes leaves the lines as I typed, but other times it deletes the line breaks and I get something like this:

 'SELECT T1.COLUMN1,T2.COLUMN2,T1COLUMN3 ' + 'FROM TABLE1 T1 INNER JOIN '+  'TABLE2 T2 ON T1.ID=T2.ID'

And this leads to a “line too long (more than 1023 charactes)” error. What’s interesting is this does not happen with all lines. I can’t catch the difference between the lines which will be affected and those that won’t. I need a line break after or before the “+” sign. How do I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:24:14+00:00Added an answer on May 31, 2026 at 6:24 am

    Try to assign the value in every line:

    SQL.Text := 'SELECT T1.COLUMN1,T2.COLUMN2,T1COLUMN3..........,';
    SQL.Text := SQL.Text + ' T1.COLUMNn FROM TABLE1 T1 INNER JOIN ';
    SQL.Text := SQL.Text + ' TABLE2 T2 ON T1.ID=T2.ID';
    SQL.Text := SQL.Text + ' WHERE T1.COLUMN10=100';
    

    I know it looks ugly, but I think it solves your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long running SQL statement that I want to run, and no
I have a SQL query that takes a very long time to run on
I have a web application that needs to fire off a long-running SQL Server
I have a very long-running stored procedure in SQL Server 2005 that I'm trying
I have a pretty long sqlite query: const char *sql_query = SELECT statuses.word_id FROM
I have a SQL script that will insert a long string into a table.
I have a java application that sends text to a sql database on a
I have a really long string of text that I would like to update
Have a SQL command with FOR XML that returns a single long XML as
I want to store images into sql using c# application. So I have this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.