Home » Developer & Programmer » Reports & Discoverer » REP-300 : 'invalid identifier SELECT ==> (Oracle reports)
REP-300 : 'invalid identifier SELECT ==> [message #437928] Wed, 06 January 2010 09:35 Go to next message
lkngstr82is
Messages: 33
Registered: January 2010
Location: USA
Member
Hi All,

I have created a report using lexical references. I can run it without errors from within oracle reports. However, When I call it from form or using rwclient it fails with the following error message:

REP-300 : 'invalid identifier' SELECT ==> REPORT FROM

I used following format for running report:

rwclient server=<reports server name> userid=<username>/<pwd>@<connect string> report=test_report1.rdf destype=cache desformat=html

Let me know if you could help me out


Thanks
Harshad
Re: REP-300 : 'invalid identifier SELECT ==> [message #437933 is a reply to message #437928] Wed, 06 January 2010 09:42 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
What code are you using to set the parameter? Because it looks like it's null when you run the report.
Re: REP-300 : 'invalid identifier SELECT ==> [message #437936 is a reply to message #437928] Wed, 06 January 2010 09:48 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is "lexical references"? A lexical parameter? If so, command you have used doesn't contain any parameters (destype and desformat don't count here).
Re: REP-300 : 'invalid identifier SELECT ==> [message #437942 is a reply to message #437928] Wed, 06 January 2010 10:00 Go to previous messageGo to next message
lkngstr82is
Messages: 33
Registered: January 2010
Location: USA
Member
Thanks for the reply. lexical references/parameter are added as user parameters and assigned in after parameter form trigger.

I have tried running using parameters, it gave me the same error:

rwclient server=rep_cio14-5394-b userid=scott/cis_test@cisdev report=test_report1.rdf destype=cache desformat=html empno=RPAD(ENAME,256)

Following are the codes:

QUERY:

SELECT &EMPNO REPORT FROM EMP

EMPNO has width of 256 and has been initialized as
rpad(ename,256)

BEFORE PARAMETER FORM TRIGGER:
function BeforePForm return boolean is
begin
:EMPno := NULL;
return (TRUE);
end;

AFTER PARAMETER FORM TRIGGER:

begin
IF :EMPno = 'Y' THEN
:EMPNo := 'RPAD(TO_CHAR(eMPNo),10)'||'||'' ''';
--:TITLE := 'Employee No';
END IF;
IF :Ename = 'Y' THEN
IF LOWER(:EMPno) = 'N' THEN
:EMPno := 'RPAD(Ename,30)';
ELSE
:EMPno := :EMPNO || '||RPAD(Ename,30)';
END IF;
END IF;
IF :MGR = 'Y' THEN
IF LOWER(:EMPNO) = 'N' THEN
:EMPNO := 'RPAD(MGR,13)';
ELSE
:EMPNO := :EMPNO || '||RPAD(MGR,13)';
END IF;
END IF;

IF :DEPTNO = 'Y' THEN
IF LOWER(:EMPNO) = 'N' THEN
:EMPNO := 'RPAD(DEPTNO,13)';
ELSE
:EMPNO := :EMPNO || '||RPAD(DEPTNO,13)';
END IF;
END IF;
return (TRUE);
end;
Re: REP-300 : 'invalid identifier SELECT ==> [message #437949 is a reply to message #437942] Wed, 06 January 2010 10:16 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It seems that you are doing it wrong.

In After Parameter Form trigger you are checking whether :EMPNO parameter equals 'Y' or 'N', but pass "empno=RPAD(ENAME,256)" to the report; it is never true.

Moreover, this
IF LOWER(:EMPno) = 'N' 
will also never be true.

Perhaps there's something more, but it is difficult to tell in such an unformatted code (would you mind to format it properly next time and enclose it within [code] tags to preserve formatting? I would have done that for you, but - your code really isn't formatted at all!).
Re: REP-300 : 'invalid identifier SELECT ==> [message #437950 is a reply to message #437928] Wed, 06 January 2010 10:18 Go to previous messageGo to next message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
When posting code can you please use code tags - see the orafaq forum guide if you're not sure how.

However, this:
IF LOWER(:EMPno) = 'N' THEN

Can never be true.
Re: REP-300 : 'invalid identifier SELECT ==> [message #437955 is a reply to message #437942] Wed, 06 January 2010 10:32 Go to previous messageGo to next message
lkngstr82is
Messages: 33
Registered: January 2010
Location: USA
Member
I apologize and thank you for the correction.
I have correctd the code as below, it still gives me the same error.


begin

IF :EMPno = 'Y' THEN
:EMPNo := 'RPAD(TO_CHAR(eMPNo),10)'||'||'' ''';
END IF;

IF :Ename = 'Y' THEN
IF UPPER(:EMPNO) = 'N' THEN
:EMPno := 'RPAD(Ename,30)';
ELSE
:EMPno := :EMPNO || '||RPAD(Ename,30)';
END IF;
END IF;

IF :MGR = 'Y' THEN
IF UPPER(:EMPNO) = 'N' THEN
:EMPNO := 'RPAD(MGR,13)';
ELSE
:EMPNO := :EMPNO || '||RPAD(MGR,13)';
END IF;
END IF;

IF :DEPTNO = 'Y' THEN
IF UPPER(:EMPNO) = 'N' THEN
:EMPNO := 'RPAD(DEPTNO,13)';
ELSE
:EMPNO := :EMPNO || '||RPAD(DEPTNO,13)';
END IF;
END IF;

return (TRUE);
end;


Re: REP-300 : 'invalid identifier SELECT ==> [message #437957 is a reply to message #437955] Wed, 06 January 2010 10:36 Go to previous messageGo to next message
Littlefoot
Messages: 21821
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What exactly did you fix? Did you read my previous message?
Re: REP-300 : 'invalid identifier SELECT ==> [message #437964 is a reply to message #437928] Wed, 06 January 2010 11:00 Go to previous messageGo to next message
lkngstr82is
Messages: 33
Registered: January 2010
Location: USA
Member
IF UPPER(:EMPno) = 'N' THEN


EMNO is the lexical parameter that holds all the other columns initialized in AFTER PARAMETER FORM trigger.

Also, even if I remove EMPNO initialization,i.e. rpad(ename,256)-error message still persists.

Let me know if I did something wrong in posting message

Thanks
Harshad



EDIT: fixed code tags - CM

[Updated on: Wed, 06 January 2010 11:28] by Moderator

Report message to a moderator

Re: REP-300 : 'invalid identifier SELECT ==> [message #437970 is a reply to message #437964] Wed, 06 January 2010 11:28 Go to previous message
cookiemonster
Messages: 13952
Registered: September 2008
Location: Rainy Manchester
Senior Member
lkngstr82is wrote on Wed, 06 January 2010 17:00
IF UPPER(:EMPno) = 'N' THEN


EMNO is the lexical parameter that holds all the other columns initialized in AFTER PARAMETER FORM trigger.


EMNO or EMPNO?

Becuase I can see no EMNO in your code.

But if EMPNO is the lexical parameter, why are you using it as a Y/N flag? You've got 1 parameter here when you need 2, one for the Y/N and one for the lexical.
Previous Topic: Calling a report from another report
Next Topic: Report web lay out creating error
Goto Forum:
  


Current Time: Sat Nov 09 22:56:24 CST 2024