Global variable [message #588707] |
Thu, 27 June 2013 10:14 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/d3f7a1abc73e65bdbd9c9c38f474a92e?s=64&d=mm&r=g) |
jay_cooldude
Messages: 50 Registered: March 2013 Location: Hyd
|
Member |
|
|
Hi Sir,
I have a problem using global variables.
I have created two fmb files
1)LOGIN.fmb
2)EMP_CONNECT.fmb
In login.fmb file i have created a login page using emp table and global variables (:global.u,:global.p).
my table structure and data is
SQL> desc emp
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-DEC-80 800
20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500
30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400
30
7698 BLAKE MANAGER 7839 01-MAY-81 2850
30
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
7788 SCOTT ANALYST 7566 09-DEC-82 3000
20
7839 KING PRESIDENT 17-NOV-81 5000
10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0
30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
7876 ADAMS CLERK 7788 12-JAN-83 1100
20
7900 JAMES CLERK 7698 03-DEC-81 950
30
7902 FORD ANALYST 7566 03-DEC-81 3000
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
7934 MILLER CLERK 7782 23-JAN-82 1300
10
7566 JONES MANAGER 7839 02-APR-81 2975
20
14 rows selected.
and i have used used empno as user id and assigned it to
:global.u ,ename as password and assigned it to
:global.p
.
In a new_form i called a new emp_connect.fmx file
in that data block
i gave target data source type as :from query clause
source as (select * from emp start with empno=:global.u connect by prior empno=mgr order by deptno,level)
and created items and canvas.
I executed the form login.fmb and opened the form emp_connect.fmb
but when i tried to execute the form using [cntrl+F11].
it throws an error FRM-40505: ORACLE ERROR: unable to perform query.
but if i use the following query in from clause query of emp_connect's data block, then it works fine
(select * from emp start with empno=7566 connect by prior empno=mgr order by deptno,level)
please find the login .fmb file in the attachment . i will sent emp_connect.fmb file in next message.
Thanks In advance.
Regards,
Jay.
[MERGED by LF]
-
Attachment: LOGIN.fmb
(Size: 52.00KB, Downloaded 1193 times)
[Updated on: Thu, 27 June 2013 10:25] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|