Tutorial by Examples: sql

1)Took backup of Machine.config from locations C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config 2)Copy them to different location and edit them as a)locate and add under <system.data> <DbProviderFactories> ...
The default encryption aes-128-ecb uses Electronic Codebook (ECB) mode, which is insecure and should never be used. Instead, add the following to your configuration file: block_encryption_mode = aes-256-cbc
Using PostgreSQLnpm module. install dependency from npm npm install pg --save Now you have to create a PostgreSQL connection, which you can later query. Assume you Database_Name = students, Host = localhost and DB_User= postgres var pg = require("pg") var connectionString = &q...
DataSource dataSource = ... // JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); String sql = "SELECT * FROM customer"; SqlRowSet rowSet = jdbcTemplate.queryForRowSet(sql); while(rowSet.next()) { String firstName = rowSet.getString("first_name"); String lastN...
The sqlite3 module was written by Gerhard Häring. To use the module, you must first create a Connection object that represents the database. Here the data will be stored in the example.db file: import sqlite3 conn = sqlite3.connect('example.db') You can also supply the special name :memory: to ...
The following example is tested on Windows 8 pro 64-bit operating system with python 2.7 and scrapy v 1.2. Let assume that we have already installed the scrapy framework. MySQL database that we will use in the following tutorial CREATE TABLE IF NOT EXISTS `scrapy_items` ( `id` bigint(20) UNSIGN...
Dependencies: GNU Make Version > 3.80 an ISO/ ANSI C-Compiler (e.g. gcc) an extractor like tar or gzip zlib-devel readline-devel oder libedit-devel Sources: Link to the latest source (9.6.3) Now you can extract the source files: tar -xzvf postgresql-9.6.3.tar.gz There are a large ...
CREATE [OR REPLACE] FUNCTION functionName (someParameter 'parameterType') RETURNS 'DATATYPE' AS $_block_name_$ DECLARE --declare something BEGIN --do something --return something END; $_block_name_$ LANGUAGE plpgsql;
Click on New Files --> Transformation once a new transformation is open, Click on views tab ,under views create two connections (source ) and (destination). source: table where data is available destination: table where you want to push your data. Once done. on the top bar you have tools -...
In Apache Spark while doing shuffle operations like join and cogroup a lot of data gets transferred across network. Now, to control the number of partitions over which shuffle happens can be controlled by configurations given in Spark SQL. That configuration is as follows: spark.sql.shuffle.partiti...
SQL Server 2012 / 2014 DECLARE @RowsPerPage INT = 10, @PageNumber INT = 4 SELECT OrderId, ProductId FROM OrderDetail ORDER BY OrderId OFFSET (@PageNumber - 1) * @RowsPerPage ROWS FETCH NEXT @RowsPerPage ROWS ONLY SQL Server 2005/2008/R2 DECLARE @RowsPerPage INT = 10, @PageNumber INT = ...
For getting the next 10 rows just run this query: SELECT * FROM TableName ORDER BY id OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY; Key points to consider when using it: ORDER BY is mandatory to use OFFSET and FETCH clause. OFFSET clause is mandatory with FETCH. You can never use, ORDER BY … FETC...
For querying all the data from table MachineName we can use the command like below one. $Query="Select * from MachineName" $Inst="ServerInstance" $DbName="DatabaseName $UID="User ID" $Password="Password" Invoke-Sqlcmd2 -Serverinstance $Inst -Databa...
For querying all the data from table MachineName we can use the command like below one. $Query="Select * from MachineName" $Inst="ServerInstance" $DbName="DatabaseName $UID="User ID" $Password="Password" Invoke-Sqlcmd2 -Serverinstance $Inst -Databa...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //the query or stored procedure name for the database string sqlQuery = "SELECT * FROM myTable"; //create a datatable DataTable dataTable = loadExternalDataSet(sqlQuery); //c...
Using a CASE statement, conditionally display an expression in the column based on values found in another column, a.k.a. “my kingdom for an OR”. In the example, the result is obtained when the status of the transaction is Pending Fulfillment or Partially Fulfilled: CASE DECODE( {status}, 'Pending ...
In a saved search formula, the possible values of mainline are designed to be useful in an HTML context. When mainline is true, the value of {mainline} is the 1-character string * (asterisk). When mainline is false, the value of {mainline} is the 6-character string   (non-breaking space, HT...
Requirement for Local development 1) MySQL server(I am Using XAMPP for MySQL server) 2) For Test API You can use Postman(optional) 3) Before run application,make sure MySQL server is running, properly prepare your application.properties file(DB_Name, Username,Password). 1.Add following depen...
Declare @userList Table(UserKey VARCHAR(60)) Insert into @userList values ('bill'),('jcom'),('others') --Declared a table variable and insert 3 records Declare @text XML Select @text = ( select UserKey from @userList for XML Path('user'), root('group') ) --Set the XML value from ...
CREATE TABLE mytable (number INT); INSERT INTO mytable VALUES (1); CREATE MATERIALIZED VIEW myview AS SELECT * FROM mytable; SELECT * FROM myview; number -------- 1 (1 row) INSERT INTO mytable VALUES(2); SELECT * FROM myview; number -------- 1 (1 row) REFRESH ...

Page 7 of 10