Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Statement only seems to work over two lines in Oracle 8i
Hi
could it be that one of the first three lines has a lot of space characters and adding the carraige return on the last line brings it within the limit of the characters in the statement ??, try opening in vi and check where the end of each line is. Notepad can put spaces on the end of lines. Or if you dont like vi, open in word and hit the carraige return symbol to see where the real ends of lines are
cheers
Pete Finnigan
www.pentest-limited.com
In article <997862934.15785.0.nnrp-10.c2de4217_at_news.demon.co.uk>, CME
<support_at_cmesys.demon.co.uk> writes
>Dear all,
>
>
>I have a weird one here that I am desperate to resolve (or might be me being
>stupid..not the first time).
>
>
>I have an SQL statement, that basically errors, when run in code or in
>P/SQL. However if I put a neweline in the statement it then works....help :)
>
>
>Not working version:
>
>SELECT v_SearchCase.SocratesID from v_SearchCase,v_SearchScene,v_FlareDocket
>WHERE v_SearchCase.SocratesID = v_SearchScene.SocratesID(+) AND
>v_SearchScene.SceneID = v_FlareDocket.SceneID(+) AND (v_SearchCase.CrimeNum
>= 'CRO32' OR v_SearchCase.CrimeNum LIKE 'CRE%');
>
>
>This one does work
>
>SELECT v_SearchCase.SocratesID from v_SearchCase,v_SearchScene,v_FlareDocket
>WHERE v_SearchCase.SocratesID = v_SearchScene.SocratesID(+) AND
>v_SearchScene.SceneID = v_FlareDocket.SceneID(+) AND (v_SearchCase.CrimeNum
>= 'CRO32'
>OR v_SearchCase.CrimeNum LIKE 'CRE%');
>
>
>
>Any help would be great, as this SQL is build in code, and is used on other
>databases as well as oracle 8i. I can't start putting \n in the middle of
>the SQL,,,,,why does this happen.
>
>
>Matt
>
>
-- Pete Finnigan IT Security Consultant PenTest Limited Office 01565 830 990 Fax 01565 830 889 Mobile 07974 087 885 pete.finnigan_at_pentest-limited.com www.pentest-limited.comReceived on Fri Aug 24 2001 - 11:59:59 CDT