In my project , i am trying to execute the following query :
DECLARE
Sid nvarchar2(30) := ''; /*Here the values will come from some other variable>*/
Bid nvarchar2(30) := ''; /*Here the values will come from some other variable>*/
ExecuteDSQL varchar2(1000);
ExecuteDSQLResult varchar2(10000);
BEGIN
IF Sid IS NULL THEN Sid := '1' ; ELSE Sid := '4' ; END IF;
IF Bid IS NULL THEN Bid := '1' ; ELSE Bid := '5' ; END IF;
ExecuteDSQL := ' SELECT * FROM iftlog WHERE serverid='''|| Sid
|| ''' AND bpid=''' || Bid || ''' ';
EXECUTE IMMEDIATE ExecuteDSQL INTO ExecuteDSQLResult;
DBMS_OUTPUT.PUT_LINE(ExecuteDSQLResult);
END;
/
The query is resulting into the error of inconsistent datatypes, besides this error the question is can we store results into the temp table as like in MS-SQL ? I am new to oracle database. I need temp table to store the records between lets say 1 to 20,i will be using Row_Number() and will modify the query accordingly in my project.