Hi,
I have a table called SQLTbl, keeps all SQL of my reports
Field Name Value
QueryCode: D-X1
QueryName: EmployList query
SQLQuery: SELECT empno,ename,job..........
I would like to pulls only string/tables values between "FROM" clause and "WHERE" caluse
Eg:-
Quote:
<TABLE cellSpacing=0 cellPadding=6 width="100%" border=0><TBODY><TR><TD class=alt2 style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset">Select empno,ename,job, deptno,dname
FROM emp, dept innerjoin dept.deptno.emp.deptno
WHERE dept.dname = "XYZ" </TD></TR></TBODY></TABLE>
So, from the above query I would like to pull only string value b/w FROMm and WHERE as given below
"FROM emp, dept innerjoin dept.deptno.emp.deptno"
I tried
SELECT INSTR(SQLQuery,"FROM") ????
FROM SQLTbl
I hope it does make sense to you
I thiink I have to use INTR or any other function but don't know how. I would appreciate your help.
Farhan
I have a table called SQLTbl, keeps all SQL of my reports
Field Name Value
QueryCode: D-X1
QueryName: EmployList query
SQLQuery: SELECT empno,ename,job..........
I would like to pulls only string/tables values between "FROM" clause and "WHERE" caluse
Eg:-
Quote:
<TABLE cellSpacing=0 cellPadding=6 width="100%" border=0><TBODY><TR><TD class=alt2 style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset">Select empno,ename,job, deptno,dname
FROM emp, dept innerjoin dept.deptno.emp.deptno
WHERE dept.dname = "XYZ" </TD></TR></TBODY></TABLE>
So, from the above query I would like to pull only string value b/w FROMm and WHERE as given below
"FROM emp, dept innerjoin dept.deptno.emp.deptno"
I tried
SELECT INSTR(SQLQuery,"FROM") ????
FROM SQLTbl
I hope it does make sense to you
I thiink I have to use INTR or any other function but don't know how. I would appreciate your help.
Farhan