Exforsys

Online Training

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 ...


Go Back   Exforsys > Database > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-21-2006, 01:19 AM
Junior Member
 
Join Date: Nov 2006
Posts: 1
nitinkoshymech is on a distinguished road
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;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-27-2006, 09:34 AM
Junior Member
 
Join Date: Nov 2006
Location: Bangalore, India
Posts: 12
sarunraj is on a distinguished road
Send a message via AIM to sarunraj Send a message via Yahoo to sarunraj
Thumbs up 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to find second max sal of employee with the co chandraismoon Oracle Tutorials 7 05-16-2008 03:08 AM
SQL Server FAQ Limca SQL Server 1 04-27-2006 05:25 PM
Change Password for SQL Server User admin SQL Server 2005 Tutorials 2 04-07-2006 11:09 AM
IBM - Oracle PL SQL / Crystal Reports, 2+Year Exp, Bangalore. lokeshm Experienced Job Seekers - India 0 03-22-2006 12:23 PM
SQL Server CE 2.0 installation Problem NareshShroff SQL Server 2005 Tutorials 2 07-17-2004 06:55 AM


All times are GMT -4. The time now is 09:11 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.