
- Forum
- Database
- Oracle Database
- SQL QUERY IN REPORTS 6i:Pls help
SQL QUERY IN REPORTS 6i:Pls help
This is a discussion on SQL QUERY IN REPORTS 6i:Pls help within the Oracle Database forums, part of the Database category; Hi, I've the SQL query below in report builder to retrieve data in reports. In the query in line 14, ...
-
11-21-2006, 02:19 AM #1
- Join Date
- Nov 2006
- Answers
- 1
SQL QUERY IN REPORTS 6i:Pls help
Hi,
I've the SQL query below in report builder to retrieve data in reports.
In the query in line 14, i have specified the parameter &p for a donor code variable values that i'm specifying at run time separated by commas such as 1,2,3,4,5 etc
But the SQL query in Reports doesnt accept the literal '&'
even if i give '
_donor_code', it will take only one value at at time. I want to separate the values by ','
SELECT ALL DONOR_TAB.DONOR_CODE, INITCAP(TITLE_TAB.TITLE_NAME||' '||DONOR_TAB.FIRST_NAME||' '||DONOR_TAB.MIDDLE_NAME||' '||DONOR_TAB.LAST_NAME) donor_name,
RTRIM(INITCAP(RPAD(DONOR_TAB.ADDRESS1, 35, ' ')||RPAD(DONOR_TAB.ADDRESS2, 35, ' ')||RPAD(DONOR_TAB.STREET, 30, ' '))) DISPLAY_COL3,
INITCAP(CITY_MASTER_TAB.CITY_NAME||' - '||DONOR_TAB.PIN) DISPLAY_COL4,
INITCAP(CITY_MASTER_TAB.STATE_NAME||', '||CITY_MASTER_TAB.COUNTRY_NAME) DISPLAY_COL5,
UPPER('DONOR CODE'||' - '||DONOR_TAB.DONOR_CODE) DISPLAY_COL6
FROM DONOR_TAB, CITY_MASTER_TAB, TITLE_TAB
WHERE (DONOR_TAB.REMINDER IN (
_reminder)
AND DONOR_TAB.LANG IN (
_lang)
AND DONOR_TAB.DONOR_CODE IN (&p) ----line 14
AND ((DONOR_TAB.CITY_CODE = CITY_MASTER_TAB.CITY_CODE)
AND (DONOR_TAB.TITLE_CODE = TITLE_TAB.TITLE_CODE)))
ORDER BY DONOR_TAB.DONOR_CODE;
-
11-27-2006, 10:34 AM #2
- Join Date
- Nov 2006
- Location
- Bangalore, India
- Answers
- 16
hi--
why dont u use a parameter form to pass the value of the same.
i dont think it can be done the way u have done in the SQL Query.
You need to pass the value as a parameter.
you can use the parameter form for the same and then use this value in the SQL Query.
Hope it helps your query.
Regards,
RaJ

Reply With Quote





