resides [yearlysalary] [float] NULL,--Customer Annual Income [Boughtcar] [bit] NULL,--whether the customer has purchased a car CONSTRAINT [Pk_customersboughtcarssurvey] PRIMARY KEY CLUSTERED ( [CustomerID] ASC) with(Pad_index= OFF, Statistics_norecompute= OFF, Ignore_dup_key= OFF, Allow_row_locks= on, Allow_page_locks= on) on [PRIMARY]) on [PRIMARY]Now if there are 10000 rows of records in this table, of which the [customerid],[name],[age],[sex],[nation],[city],[yearlysalary] column
;/** * * * @author 林计钦 * @version 1.0 201 3-7-25 am 10:33:37 */public class Locktest {public static void main (string[] args) {locktest test = new Locktes T (); Create a concurrent access account MyCount MyCount = test.new MyCount ("95599200901215522", 10000); Create a Lock object lock lock = new Reentrantlock (); Create a thread pool executorservice pool = Executors.newcachedthreadpool (); Create some concurrent access users, a credit card, save, take the take
; = 0And a. xusertype in (175,239,231,167)Open TBFetch next from TB into @ sWhile @ fetch_status = 0BeginExec (@ s)Fetch next from TB into @ sEndClose TBDeallocate TBEndGo-- Call exampleSp_msforeachdb 'up _ valuesearch ?, ''A '''
Other sorting
------------------ Method 1 ----------------------
Create proc sp_valuesearch@ Value SQL _variant, -- data to be searched@ Precision bit = 1 -- 1 = search for data columns of the corresponding type only based on the data type in SQL _variant. AsSet nocoun
creating a new dbml file, you can open Server Explorer, establish a database connection, and drag the new table to the dbml file. The result is as follows:
2. You can click the blank area of the dbml file and press F4 to display the dbml attribute. You can modify the context and generate object namespaces.
3. By now, vs2010 has created a method for adding, modifying, and deleting data tables to, corresponding to, object classes, and data table operations.
1) Add add
Static void add
Control Message Protocol) and other ports. The following describes TCP and UDP ports:(1) TCP portTCP port, that is, the transmission control protocol port, needs to establish a connection between the client and the server, this can provide * data transmission. Common include port 21 of the FTP service, port 23 of the Telnet service, port 25 of the SMTP service, and port 80 of the HTTP service.(2) UDP portUDP port, that is, the user data packet protocol port, does not need to establish a connect
redis_node.jsReply: OKReply: testauthorReply: worldNode. js implements redis's publish-subscribe
The Code is as follows:
var redis = require('redis');var redisclient = redis.createClient();var sub = function(c) { var c = c || 'chatchannel'; redisclient.subscribe(c, function(e) { console.log('subscribe channel : ' + c); });}sub();redisclient.on('message', function(error, response) { console.log(response);})
In addition, a redis-cli subscribe is started for comparison. The exec
. All its characters are expressed in two bytes, that is, English characters are also expressed in two bytes. The prefix n indicates Unicode characters, suchNchar, nvarcharThese two types Use the Unicode Character Set.
Based on the above two points to see the field capacity
Char, varchar
Up to 8000 English letters and 4000 Chinese Characters
Nchar, nvarchar
Sometimes you need to use dbms_output spool to generate some scripts, so it is very difficult to limit the length of characters, but later it was found that in the 10gr2 version, the buffer can be very long, the President can contain up to 32767 characters. Why is it not in PLSQL Dev? I have an experiment today.
First, open a command window in PLSQL Dev.
SQL> set serveroutput on size unlimited;SQL> declare2 x varchar2 (4000 );3 begin4 x: = rpad ('*',
First, let's look at the official definition of VARCHAR2 () and NVARCHAR2 () in Oralce.
The official documentation is defined as follows:
VARCHAR2 (Size [BYTE | CHAR])
Variable-length character string Having maximum length size bytes or characters. Maximum the size is 4000 bytes or characters, and minimum is 1 byte or 1 character. You are must specify size for VARCHAR2.Byte indicates that column would have byte length semantics. CHAR indicates that
"non-blocking mode" to read the file and processing.
To prevent the demo code from being coupled to business logic, use the delay function to simulate the asynchronous method, as follows
"Use strict";
Let callbacks = [
function () {
settimeout () => {
console.log (' 3000 ');
},3000);
},
function () {
settimeout () => {
console.log (' 1000 ');
},1000);
},
function () {
SetTimeout (() => {
console.log
open the Server Explorer, establish a database connection, and drag our newly created table to the dbml file. Results such as2. You can modify the context and the namespace of the generated entity by clicking the dbml file blank, pressing F4 to display the DBML property.3. So far, VS2010 has created a data table for us by tool. Add, change, and delete the method of adding, changing, and deleting the tables, and now start practicing1) Adding add?
123456789101112131415161718
stat
(@ text) -len (replace (@ text, @ str, '')/len (@ str) -- method 2 declare @ text varchar (1000) declare @ str varchar (10) set @ text = 'abbbcbbbdbbbe' set @ str = 'bbb' select len (replace (@ text, @ str, @ str + '_')-len (@ text)
2. Position of the nth occurrence of the same character/string
The character location function of SQL SERVER is CHARINDEX:
CHARINDEX ( expressionToFind , expressionToSearch [ , start_location ] )
You can start searching from the specified location, but cannot obtain
This article describes in detail the performance and space occupied by varchar (n) and nvarchar (n) in SQL. For more information, see.
This article describes in detail the performance and space occupied by varchar (n) and nvarchar (n) in SQL. For more information, see.
How to explain n in varchar (n) and nvarchar (n:Nvarchar (n) can store up to n characters, which are not distinguished between Chinese and English.Varchar (n) can store up to n Bytes. One Chinese character is two bytes.
Space o
Here we use the temporary performance of SQL to implement the database paging function. The benefits of this function can achieve mass data processing. For more information, see, if there is a better method for this method, please provide comments.
The Code is as follows:
Copy code
Alter procedure [dbo]. [sp_ SQL _Paging](@ SqlDataTable NVARCHAR (4000), -- table name@ PrimaryKey NVARCHAR (4
When an expdp statement is executed today, the following error is returned:
ORA-31626: job does not existORA-31633: unable to create master table "NEW. GWJOB"ORA-06512: at "SYS. DBMS_SYS_ERROR", line 95ORA-06512: at quot; SYS. KUPV $ FT quot;, line 1020ORA-00955: name is already used by an existing object
Since the command was manually killed before the command was executed when I last executed the expdp command, Oracle did not automatically clear the table gwjob.
If the table runs normally, o
accountMyCount MyCount =NewMyCount ("95599200901215522", 10000); //Create a Lock objectLock lock =NewReentrantlock (); //Create a pool of threadsExecutorservice pool =Executors.newcachedthreadpool (); //create some concurrent access users, a credit card, save, take the take, good lively ahUser u1 =NewUser ("Zhang San", MyCount,-4000, lock); User U2=NewUser ("Three Fathers", MyCount, 6000, lock); User U3=NewUser ("Three brothers", MyCount, 8000, lock)
.
Since varchar is a variable-length storage, many people will have questions, such as the Status field definition varchar (10) and varchar (1000) What is the difference, anyway, is longer, storage space is the same, after the province to be lengthened and change the definition of the field. Here's what I understand:
1, the length of the database is a constraint, can ensure that the data entered the database to meet the length requirements, the definition of a reasonable length of the field ca
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.