Home » SQL & PL/SQL » SQL & PL/SQL » {} in SQL (Oracle 11g)
{} in SQL [message #660938] Thu, 02 March 2017 02:59 Go to next message
rahul1982
Messages: 53
Registered: November 2011
Location: Pune
Member
Hi,

I have below SQL i.e. used for data extraction from source system.
curly brackets {} are observed in SQL statement itself. When i tried to run the SQL I got an error.
Please suggest how can we run the SQL in SQL developer with {} present.

While reading on web, I come to know that {} are used to avoid SQL Injection.

select 
col1,
col3,
......
FROM
ARA_ALL,
AD,
PAY, 
CASHR, 
PAY ,
CEB,
RAB
WHERE
{
ARA_ALL
INNER JOIN AD ON ARA_ALL.RECEIVABLE_APPLICATION_ID = AD.SOURCE_ID
INNER JOIN CASHR ON CASHR.CASH_RECEIPT_ID = ARA_ALL.CASH_RECEIPT_ID 
INNER JOIN PAY ON PAY.PAYMENT_SCHEDULE_ID = ARA_ALL.PAYMENT_SCHEDULE_ID
LEFT OUTER JOIN TRX_ALL ON TRX_ALL.CUSTOMER_TRX_ID = ARA_ALL.APPLIED_CUSTOMER_TRX_ID
LEFT OUTER JOIN PAY ON PAY.PAYMENT_SCHEDULE_ID = ARA_ALL.APPLIED_PAYMENT_SCHEDULE_ID
LEFT OUTER JOIN CEB ON
CASHR.REMIT_BANK_ACCT_USE_ID = CEB.BANK_ACCT_USE_ID
}
AND RAB.BATCH_SOURCE_ID(+) = TRX_ALL.BATCH_SOURCE_ID
AND RAB.ORG_ID(+) = TRX_ALL.ORG_ID
AND AD.SOURCE_TABLE = 'RA'
AND AD.SOURCE_TYPE IN ('REC', 'UNAPP', 'ACC', 'UNID', 'OTHER ACC', 'EDISC', 'UNEDISC', 'TAX')
AND ARA_ALL.APPLICATION_TYPE = 'CASH'

Thanks
Re: {} in SQL [message #660942 is a reply to message #660938] Thu, 02 March 2017 03:16 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This is not SQL, at least neither standard nor Oracle SQL.

Re: {} in SQL [message #660944 is a reply to message #660942] Thu, 02 March 2017 03:28 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Whatever you read on the web about {} I'm pretty sure you misunderstood it.
SQL injection is something you worry about when dynamically constructing SQL statements. Once you have a constructed SQL statement injection stops being an issue.
Re: {} in SQL [message #660945 is a reply to message #660938] Thu, 02 March 2017 03:57 Go to previous messageGo to next message
rahul1982
Messages: 53
Registered: November 2011
Location: Pune
Member
Okay, thanks for the input.
Re: {} in SQL [message #660948 is a reply to message #660945] Thu, 02 March 2017 07:09 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
Also, replace the { with open and close parens.
Re: {} in SQL [message #660953 is a reply to message #660948] Thu, 02 March 2017 08:13 Go to previous message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
just changing the {} to () isn't going to make that valid sql.
Previous Topic: How to query and not include weekend or Bankholidays
Next Topic: Using debug in EBS r12 database with SQL Developer
Goto Forum:
  


Current Time: Fri Mar 29 05:09:56 CDT 2024