I am trying to execute dynamic sql select statement and return the result back to C# ExecuteReader.
I can retrieve the result in sql server using following sql code.
Create Table TestCustomer(ID Varchar(50), CustomerName Varchar(100));
Insert Into TestCustomer (ID, CustomerName) Values ('1', 'One');
Insert Into TestCustomer (ID, CustomerName) Values ('2', 'Two');
Insert Into TestCustomer (ID, CustomerName) Values ('3', 'Three');
DECLARE @SQLScript VARCHAR(MAX), @CustomerName VARCHAR(100);
SET @CustomerName = 'Two';
SET @SQLScript = 'select * from TestCustomer where CustomerName = '''+ @CustomerName +''' ';
EXEC(@SQLScript);
But when I try to retrieve the result on oracle server using following oracle sql code, I don't see table result is coming out like sql server does.
DECLARE
SQLScript VARCHAR2(4000);
CustomerName VARCHAR2(20) := 'Two';
BEGIN
SQLScript := 'select * from TestCustomer where CustomerName = :CustomerName';
EXECUTE IMMEDIATE SQLScript USING CustomerName;
END;
How to return the table result once the dynamic sql script is executed, so that c# can get the table result?

