1

I need to write a Select query in bind-variable and this query has more than 2500 symbols.

Variable sql_txt clob;

Exec :sql_txt := 'Select .....';

But SQL Plus support only <2499 symbols. How to fix it?

Balazs Papp
41.5k2 gold badges29 silver badges47 bronze badges
asked Jan 29, 2020 at 15:17
1
  • Maybe write all in a text file and execute this file with sqlplus Commented Jan 29, 2020 at 16:28

1 Answer 1

2

That limitation is for a single line.

You can break your statement into multiple lines to overcome that limitation, such as:

begin
 :sql_txt := 'select ... ' ||
 ' ... ' ||
 ...
 ' ... ';
end;
/
answered Jan 29, 2020 at 15:27
1
  • I wrote the same as you. Now I want to print it in SQL Plus, but the text doesn't show, only small part of it. Commented Jan 29, 2020 at 18:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.