URGENT [message #146414] |
Thu, 10 November 2005 04:59 |
indraneelkumar
Messages: 24 Registered: September 2005 Location: bangalore
|
Junior Member |
|
|
Hi
If we want to select a value from a table in PL/SQL we are using the following statement
SELECT SALARY
INTO <VARIABLE> FROM EMPLOYEE
WHERE EMPNO=123;
Here the table name is decided at design time
If we want to decide the table name at run time we will use
EXECUTE IMMEDIATE 'SELECT SALARY FROM '||<TABLE>||'WHERE EMPNO=123' INTO <VARAIBLE>;
I want similar statement in Forms 6i.
Generally in Forms we use the following block in a trigger to get the value from a table
DECLARE
A NUMBER;
BEGIN
SELECT SAL INTO A FROM EMP;
END;
Here "EMP" is decided at design time.
I want to send the table name at runtime.
Example of my requirement
DECLARE
A NUMBER:=0;
B NUMBER;
BEGIN
FOR I IN 1..9 LOOP
SELECT SAL INTO B FROM EMP||I WHERE <CONDITION>;
A:=A+B;
END LOOP;
END;
Here table names are "EMP1","EMP2",...."EMP9"
I don't want to call back end procedure.
Means i don't want to write back end procedure using EXECUTE IMMEDIATE and call it to front end;
Is it possible only in front end?.
I saw "EXEC SQL" but it is not working.
Thanks in advance.
INDRA.
[mod-edit: applied basic formatting and proper case]
[Updated on: Fri, 11 November 2005 00:43] by Moderator Report message to a moderator
|
|
|
Re: URGENT [message #146426 is a reply to message #146414] |
Thu, 10 November 2005 06:28 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Some remarks:
- Modify your topic title to something significant
- urgent plz? Who's that? All messages are urgent and treated likewise.
- Remove the CAPS LOCK: STOP SHOUTING. Use proper case.
- Use code tags where needed.
- READ THE STICKY ON TOP OF THE MESSAGE LIST AND FOLLOW THE GUIDELINES (note the stress on this last remark)
First modify your topic, then we'll talk.
One tip: FORMS_DDL
Another tip: poor design, very poor design...
MHE
[edit: you can edit your message, if you don't I will ]
[Updated on: Thu, 10 November 2005 06:29] Report message to a moderator
|
|
|
|
|
|