Posts

Reloading image in Word Document automatically.

Image
There are certain instances where a single picture is used in multiple documents. When this picture changes, all the documents has to be updated manually every time. The purpose of the document is to list down the steps to upload a picture and import it from a specified location. Whenever there is a change in the picture, the same will be reflected into all the documents automatically when the document is opened. The below are the steps to be followed Upload a picture in a specified location. For ex: - Sharepoint. Open a word document where the picture has to be inserted. Navigate to Insert--> Quick Parts--> Field as shown below Once the field is clicked, the below options are displayed. a.        On the right hand side, select “IncludePicture” b.       Enter the URL where the image is uploaded. c.        Check the checkbox “Data not stored with Document”. Click Ok. Now the image will display in the document. Save and close the document. Now, try

PL/SQL Block Structure

Image
The smallest meaningful grouping of code is known as a block. A block is a unit of code that provides execution and scoping boundaries for variable declarations and exception handling. PL/SQL allows you to create anonymous blocks (blocks of code that have no name) and named blocks, which may be packages, procedures, functions, triggers, or object types. A PL/SQL block has up to four different sections, only one of which is mandatory: Example:- --Header Section PROCEDURE myFirstProcedure(NAME IN Varchar2) IS --Declaration Section SALARY NUMBER; JOINING_DATE DATE; BEGIN --Execution Section INSERT INTO EMPLOYEE (emp_name, salary, joining_date) VALUES (name, salary, joining_date); EXCEPTION --Exception Section WHEN DUP_VAL_IN_INDEX THEN DBMS_OUTPUT.PUT_LINE ("Duplicate Value, Cannot Insert."); END; /

SQL*Plus Tasks - SPOOL command

You want to save output from a SQL*Plus session to a file to get record of your actions, or because you are dynamically generating commands to execute later. This can be done in SQL*Plus with the help of SPOOL command: SQL> SPOOL report.txt SQL> @run_report.sql ...output scrolls past and gets written to the file report.txt... SQL> SPOOL OFF The first command, SPOOL report, tells SQL*Plus to save everything from that point forward into the file report.txt. The file extension of .lst is the default and can be overridden by supplying your own extension in the SPOOL command like specified above. SPOOL OFF tells SQL*Plus to stop saving the output and to close the file.

SQL*Plus Tasks - DEFINE Keyword

SQL*Plus can also create and manipulate its own in-memory variables, and it sets aside a few special variables that will affect its behavior. Actually, there are two separate types of variables in SQL*Plus: DEFINEs and bind variables. To assign a value to a DEFINE variable, you can use the DEFINE command: SQL> DEFINE X = "UMASARATH" To view the value of x, specify: SQL> DEFINE X DEFINE X               = "UMASARATH" (CHAR) SQL> You would refer to such a variable using an ampersand (&). SQL*Plus does a simple substitution before sending the statement to the Oracle database, so you will need single-quote marks around the variable when you want to use it as a literal string. SQL> select '&x' from dual; old   1: select '&x' from dual new   1: select 'UMASARATH' from dual 'UMASARAT --------- UMASARATH SQL>

The javax.servlet Package

The javax.servlet package contains a number of interfaces and classes that establish the framework in which servlets operate. The most significant of these is Servlet. All servlets must implement this interface or extend a class that implements the interface Interface Description Servlet Declares life cycle methods for a servlet. ServletConfig Allows servlets to get initialization parameters ServletContext Enables servlets to log events and access information about their environment. ServletRequest Used to read data from a client request. ServletResponse Used to write data to a client response. The following table summarizes the core classes that are provided in the javax.servlet package: Class Description GenericServlet Implements the Servlet and ServletConfig interfaces. ServletInputStream Provides an input stream for reading requests from a client.

Servlet API

Two packages contain the classes and interfaces that are required to build servlets. javax.servlet javax.servlet.http These packages are the standard extensions provided by Tomcat. Hence, these are not included in Java 6. Please follow the links for more information.

Apache Maven - How To Enable Proxy Setting

There might be a chance in your company is that a firewall is set up a and an HTTP proxy server to stop user to connect to internet directly. If you are behind a proxy, Maven will fail to download any dependencies. To make it work, you have to declare the proxy server setting in Maven configuration file settings.xml .  It can be found in conf directory, i.e.,  {M2_HOME}/conf/settings.xml. {M2_HOME}/conf/settings.xml <! -- proxies | This is a list of proxies which can be used on this machine to connect to the network. | Unless otherwise specified ( by system property or command-line switch ) , the first proxy | specification in this list marked as active will be used. | -- > < proxies > <! -- proxy | Specification for one proxy, to be used in connecting to the network. | < proxy > < id > optional </ id > < active > true </ active > < protocol > http </ protocol