Home » Developer & Programmer » Forms » parametrized cursor in oracle form
parametrized cursor in oracle form [message #534623] Wed, 07 December 2011 23:00 Go to next message
swapnil_naik
Messages: 269
Registered: December 2009
Location: Mumbai
Senior Member

Hi Friends, i want to your help..

I am creating a button , on this button i call a procedure
e.g. excel

on this procedure i call parametrized cursor ...but i give me error i dont know what is this ..my code is like this

Quote:

PROCEDURE excel IS
CURSOR C2(v_link_nm varchar2) is
select alt_loc LOC, alt_inv_no INV_NO, alt_inv_dt INV_DT, alt_amt AMOUNT, alt_rvc2 ALT_RVC,
alt_doc_no DOC_NO, alt_doc_typ DOC_TYP, alt_authid AUTH_ID, alt_authdt AUTH_DT
from v_link_nm
where alt_authdt between :FROM_DATE and :TO_DATE
MINUS
select a.alt_loc, a.alt_inv_no, a.alt_inv_dt, a.alt_amt, a.alt_rvc2,a.alt_doc_no, a.alt_doc_typ, a.alt_authid, a.alt_authdt from acc_loc1_tab a
where a.alt_authdt between :FROM_DATE and :TO_DATE
and a.alt_cmpny_cd = :GLOBAL.cmpny_cd ORDER BY 1,2,3;

begin

null;
end;


when i compiled i get error v_link_nm not defined...
please help me out...
Re: parametrized cursor in oracle form [message #534637 is a reply to message #534623] Thu, 08 December 2011 01:18 Go to previous message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Shame on you! Being a member of this forum for two years, you still don't want to properly ask a question. When exactly do you plan to do that? You didn't specify software versions you use, didn't format the code so that is readable, didn't enclose it within code tags ... really, shame-on-you.

Anyway: you can't use a parameter as a table name. If you need to do that, dynamic SQL would have to be used. For some more information (including examples), read Using dynamic SQL in Oracle Forms article.

If you could explain what you want to do and why you think that a table name should be acquired via a parameter, maybe someone might suggest a different approach.
Previous Topic: how can i use this (numtodsinterval)
Next Topic: Cannot display image from blob column in stored procedure
Goto Forum:
  


Current Time: Wed Jul 10 05:43:56 CDT 2024