USER>do $system.SQL.Schema.ImportDDL("c:\temp\updatequeries.txt","c:\temp\import.log","IRIS")
Importing SQL Statements from file: c:\temp\updatequeries.txt
Recording any errors to principal device and log file: c:\temp\import.log
SQL statement to process (number 1):
UPDATE Test2.Person Set Name='abc' where ID=1
Preparing SQL statement...
Executing SQL statement...
DONE
SQL statement to process (number 2):
UPDATE Test2.Person Set Name='efg' where ID=2
Preparing SQL statement...
Executing SQL statement...
DONE
SQL statement to process (number 3):
UPDATE Test2.Person Set Name='hij' where ID=3
Preparing SQL statement...
Executing SQL statement...
DONE
Elapsed time: .01458 seconds
USER>
go to post
You can convert with $SYSTEM.Util.UTCtoLocalWithZTIMEZONE().
https://cedocs.intersystems.com/ens20141/csp/documatic/%25CSP.Documatic.cls?&LIBRARY=%25SYS&CLASSNAME=%25SYSTEM.Util
USER>write $SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP) 66263,48361.382728 USER>write $ZTIMESTAMP 66263,15968.3579578 USER> USER>write $ZDATETIME($SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP),3) 2022-06-03 13:26:26 USER>write $ZDATETIME($ZTIMESTAMP,3) 2022-06-03 04:26:34 USER>
go to post
ImportDDL() method in %SYSTEM.SQL.Schema class can run multiple queries.
Documentation is https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GSQL_import#GSQL_import_cache
Step1: preparing import file like below:
You need to use "go" in end of each query. (c:\temp\updatequeries.txt)
Step2: running ImportDDL() method like below:
go to post
@Megumi Kakechi
I can get correct result on 2022.1!
I use iris 2022.1 container. (image lists :https://community.intersystems.com/node/511986)
go to post
I mistook attached file in previous comment.
Please refer downloadandzip-mojo-dojo_3.zip this attached file for mojo+dojo.
go to post
My samples is using 2 JavaScript libraries.
1) JSZip(http://stuk.github.io/jszip)
2) FileSaver.js(https://github.com/eligrey/FileSaver.js/).
These library can downloads some files from one path at once and save as one Zip file.
Simple samples is below:::
I attached sample for mojo+dojo.downloadandzip-mojo-dojo_1.zip
go to post
My samples is using 2 JavaScript libraries.
1) JSZip(http://stuk.github.io/jszip)
2) FileSaver.js(https://github.com/eligrey/FileSaver.js/).
These library can downloads some files from one path at once and save as one Zip file.
Simple samples is below:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://stuk.github.io/jszip/dist/jszip.min.js" charset="utf-8"></script>
<script src="FileSaver.min.js" charset="utf-8"></script>
</head>
<body>
<form name=f1 method=post>
<h2>Download+Zip Simple sample</h2>
Please set urlList variable correct file path in startDL() before testing.
<br>
<input type="button" name="b1" value="Download" onclick=startDL()>
</form>
<script type='text/javascript'>
function startDL(){
// urlListにはダウンロード用ファイルを直接指定しています。
// 【注意】日本語を含むファイル名はダウンロードできません。
var urlList = ["./ImageTest/IMG_3587.JPG","./ImageTest/IMG_3598.JPG"]
console.log(urlList);
zip = new JSZip();
deferreds = $.Deferred();
var promise = deferreds;
$.map(urlList,function(value,index) {
console.log('urlList:index='+index+' = '+value);
console.log('match() : '+value.match(".+/(.+?)([\?#;].*)?$")[1]);
promise = promise.then( function() {
var newPromise = new $.Deferred();
var xhr= new XMLHttpRequest();
xhr.open('GET',value,true);
xhr.responseType='arraybuffer';
xhr.addEventListener('load', function() {
// zipにレスポンスデータ追加
zip.file(value.match(".+/(.+?)([\?#;].*)?$")[1],xhr.response);
newPromise.resolve();
});
xhr.send();
return newPromise;
});
});
promise.then( function() {
zip.generateAsync({type:"blob"}).then( function(content){
saveAs(content,'test.zip');
});
});
deferreds.resolve();
}
</script>
</body>
</html>
I attached sample for mojo+dojo.