Oracle pl/sql dynamic query with IN paramters

Issue: Sending dynamic paramter to oracle pl/sql. Example : you will pass a paramter of employee names to the procedure and you want to dynamically construct the SQL query. Parameter Passed : v_emp   Value Passed : v_emp = ‘haneef,ganesh,rajesh,minaal’   This query will not work:   SELECT emp_id, emp_name from, FROM EMP_TABLE WHERE emp_name IN v_emp;   Working Query  SELECT emp_id, emp_name from, FROM EMP_TABLE WHERE emp_name IN (SELECT EXTRACTVALUE (xt.COLUMN_VALUE, ‘e’) FROM TABLE ( XMLSEQUENCE ( EXTRACT ( xmltype ( ‘<coll><e>’ || REPLACE (v_emp, ‘,’, ‘</e><e>’) || ‘</e></coll>’), ‘/coll/*’))) xt) ORDER BY emp_id ASC;        

» Read more

Enable Right Click – Copy in protected web pages

Problem : Some websites use javascripts to block mouse right click so that you will not be able to copy text or images from the site. Solution: If you are using google chrome , add the extension called Allow Copy. Features of Allow Copy: Allow Copy will re-enable select, copy, paste and right click in any webpage using any copy protection. Just click on extension icon to enable it on any page!    

» Read more

Installing 64 Bit Oracle Client : Windows 10 – 64 Bit

Scenario : You want to install Oracle Client and ODBC driver in Windows 10 – 64 Bit Files Required : Oracle Instant Client Basic : http://download.oracle.com/otn/nt/instantclient/122010/instantclient-basic-windows.x64-12.2.0.1.0.zip Instant Client Package – ODBC : http://download.oracle.com/otn/nt/instantclient/122010/instantclient-odbc-windows.x64-12.2.0.1.0.zip Step 1 : Download Above 2 Packages. Step 2: Copy all the contents to a single folder and name the folder as “oracle” Step 3: Now copy the folder to c:\ So now the content of c drive should like below Step 4: Now create a folder called tns inside c:\oracle => this folder will be used to save tnsnames.ora file Step 5 : Add TNS_ADMIN variable in Environment Variables TNS_ADMIN  => c:\oracle\tns\ Step 6: Add c:\oracle to the path variable Step 7 : Right click the file c:\oracle\ Step 8 : Now create a sample tns file and save in c:\oracle\tns\ PROD= (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=xxx.oracle.haneefputtur.com (PORT=1521) ) (CONNECT_DATA= (SERVER=dedicated) (SERVICE_NAME=xxx.haneefputtur.com ) ) …. Now your oracle client and odbc driver is ready to use. Step 9 : Create ODBC DSN as follows   Note For 32 Bit Clients Link  for 32 bit Instant Client : http://download.oracle.com/otn/nt/instantclient/122010/instantclient-basic-nt-12.2.0.1.0.zip Link for 32 Bit ODBC Driver : http://download.oracle.com/otn/nt/instantclient/122010/instantclient-odbc-nt-12.2.0.1.0.zip  

» Read more

Error Could not load file or assembly ‘System.Net. ASP.NET MVC C#

Error : Could not load file or assembly ‘System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.FileNotFoundException: Could not load file or assembly ‘System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified. Solution : To resolve this issue before you publish the file make sure you select Copy Local to True from False If the dll property of the file — copy local is  false means the file will not be copied to bin folder while publishing. Set it to true so that file will be copied to bin folder Screenshot before error:   Solution     This will copy the dlls while publishing to Bin folder      

» Read more

Rotativa :: HTTP Error 401.2 – Unauthorized You are not authorized to view this page

Scenario Using Rotativa as PDF convertor in ASP.NET MVC C# with Active directory login authentication Problem HTTP Error 401.2 – Unauthorized You are not authorized to view this page due to invalid authentication headers Cause : If you use Rotativa.ActionAsPDF it will not pass the header values related to authentication to the new page. So option is to use Rotativa.PartialViewAsPdf Sample Code:   public ActionResult ConvertToPDF(string stdId, string vid) { TestModel model = dbfunctions.GetTestValue(stdId, vid); // send model as partial View Pdf not return new Rotativa.PartialViewAsPdf(“TestPDF”, model); } public ActionResult TestPDF(TestModel model) // model with values { // PartialView(pdf) not View(pdf); return PartialView(model); }          

» Read more

Error installing NuGET Packages Visual Studio 2013 – already has a dependency defined for xxxx

When you install new nuget packages you receive error as below.     In order to resolve this follow this steps.   Close Visual Studio Download Latest version of NuGet Package Manage and Install https://marketplace.visualstudio.com/items?itemName=NuGetTeam.NuGetPackageManagerforVisualStudio2013 Step 3: After installation open the Visual Studio and try to install NuGet Package!!!    

» Read more
1 2 3 4 44