Exec master .. xp_mongoshell 'bcp "select dd FROM ggg .. Table1" queryout "C: \ authors.xls"-C-Q-U "sa"-P "111111 "'
Using the stored procedure to export data to excel has the disadvantage that field names cannot be exported.
Excel can be generated as follows:Set @ cmd = 'bcp' + database + '. DBO. '+ data table name + 'out' + export path + export file name
');SelectF_update ('Test','and id=1','{Name,gen_time}','{ssqhan,2017-08-20}');--The following results are obtained:--The data inside is a bit different, it doesn't affect everyone.--=======================================================================-- I don't know if you're not aware that although gen_time is a date type, when you enter the time format at Update ,-- The system automatically turns into date format--does this mean that the time form
DB2 needs to insert data using stored procedures: insert three fields (ID, GROUPID [Group id], USERID [user ID]) in a table (TESTMV). To generate multiple groups, the following code is used to calculate the number of persons in each group based on the data of multiple persons in each group:
[Html] delete testmv; create procdedure insertdb () language SQL begin d
Procedure:
Enter the correct database connection configuration and use the connection button to connect to the database. Select the database, table name, and index field, and click the read data button to obtain the paging data, if your database does not contain the getrecordfrompage paging stored procedure, create it first. For details, see getrecordfrompage in
Mysql uses the stored PROCEDURE to CREATE test DATA [SQL] DELIMITER $ DROP PROCEDURE IF EXISTS message_insert_procedure; CREATE PROCEDURE 'test '. 'message _ insert_procedure '(loop_times INT) begin declare var int default 0; WHILE var
Oracle Stored Procedure + cursor processing select data
Create or replacePROCEDURE UPDATE_RECORDCODE is cursor location_data is select * from location where remark in ('20160301', '20160301', '20160301'); -- declare the cursor serviceCode NUMBER: = 1; BEGIN for l in location_data loop -- traverse cursor BEGIN -- business processing UPDATE SERIAL_CODE SET CUR_NUMBER = CUR_NUMBER + 1 where AREA_CODE = l. are
Function 1: dynamically call the execution method based on the method name stored in the data table in the framework.
Unit unit1;
Interface
UsesWindows, messages, sysutils, variants, classes, graphics, controls, forms,Dialogs, stdctrls;
TypeTform1 = Class (tform)Button1: tbutton;Procedure formcreate (Sender: tobject );PublishedProcedure test (Sender: tobject );End;
VaRForm1: tform1;
Implementation
{$
Mysqldump-u database user name-p-n-t-d-R--triggers=false database name > FileNameThis allows you to export stored procedures and functions separatelyThen import the forward MySQL settings under
The code is as follows
Copy Code
Set global log_bin_trust_function_creators=true;
Otherwise the error
The code is as follows
Copy Code
ERROR 1418 (HY000) at line 31:this function has none of th
comparison | stored Procedure | pagination | data
Create proc Sp_publicturnpagewebsite (
@TBName nvarchar (100) = ',--table name, such as pinyin
@PageSize int=10,--Number of records per page, defaults to 10
@CurPage Int=1,--Represents the current page 1
@KeyField nvarchar = ' id '--key field name, default ID, which requires an index in a table or a field that is not repeated and not empty
@KeyAscDesc nvarch
) + "" " --datetime when @xtype= - Then "" "+convert (char),'+@name+', +) + "" " --smalldatetime when @xtype= $ Then "" "+convert (char),'+@name+')+ "" " --uniqueidentifier Else @name End End End Fetch Next fromSyscolumns_cursor into @name,@xtype End CloseSyscolumns_cursordeallocateSyscolumns_cursorSet @sql='SET NOCOUNT ON select"'Insert into'+@tablename+'('+@column+') VALUES ("' as"'--"','+@columndata+',"')"
This is often the case in daily development workProject A, you need to use RedisProject B, you also need to use Redis......The original silly on the server to install a few redis, through a different port number to useIn fact, Redis can be used with 16 databasesWhen using different projects, make a separate database for your own use.egDifferent applications share Redis apps, but data is stored in sub-databa
@ @fetch_status BeginIf @ @fetch_status BeginIf @xtype not in (189,34,35,99,98)--timestamp does not need to be processed, image,text,ntext,sql_variant temporarily does not processBeginSet @[email protected]+case when Len (@column) =0 then ' Else ', ' [email protected]Set @[email protected]+case when Len (@columndata) =0 then ' Else ', ' ', ' ', 'End+case when @xtype into (167,175) then "" "" + "[email protected]+ ' + '" "" "--varchar,charWhen @xtype in (231,239) then "N" "+" [email protected]+
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.