Please post the error as well.
I assume you are getting error in extending temporary tablespace segment.
Have you run the query directly from sql clients (sqldeveloper or any) and checked if you are facing same issue.
Do you have many sort operations in the query?
Hope these note would help you to sort out the issue
How Can Temporary Segment Usage Be Monitored Over Time? (Doc ID 364417.1)
TROUBLESHOOTING GUIDE (TSG) : ORA-1652: unable to extend temp segment (Doc ID 1267351.1)
Master Note: Overview of Oracle Temporary Tablespaces (Doc ID 1498442.1)
Temporary Segment Handling in Temporary Tablespace (Doc ID 73439.1)
Exactly I am getting the error as 'ORA-01652: unable to extend temp segment by 128 in tablespace TEMP2' I tried to run from SQL developer it is running fine , when I am running from application I am getting that error.so is there any issue with lexical parameter?