execute

vbscript Eval a string to a Variable in a loop?

那年仲夏 提交于 2019-11-30 09:41:36
问题 I am trying to use vbscript's Eval (or maybe I need Execute) to create some variables from the key names from an ini file. The ini file can have unlimited unknown key=val pairs. I need to create a variable based on the key name no matter what. Ini File contents: myPath=c:\test myExe=myapp.exe .... xxx=123 yyy=abc My code that reads the ini and returns the key and values to an object The code I am trying to get working is here: For each pair in objINI Eval("pair.key=pair.val") Next msgbox

Executing a Command from Java and Waiting for the Command to Finish

我与影子孤独终老i 提交于 2019-11-30 08:54:35
In my Java program, I create a process that executes a command to run a batch file like this: try { File tempFile = new File("C:/Users/Public/temp.cmd"); tempFile.createNewFile(); tempFile.deleteOnExit(); setContents(tempFile, recipe.getText()); //Writes some user input to file String cmd = "cmd /c start " + tempFile.getPath(); Process p = Runtime.getRuntime().exec(cmd); int exitVal = p.waitFor(); refreshActionPerformed(evt); } catch (InterruptedException ex) { Logger.getLogger(mainFrame.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(mainFrame.class

PostgreSQL - Writing dynamic sql in stored procedure that returns a result set

你。 提交于 2019-11-30 05:14:07
How can I write a stored procedure that contains a dynamically built SQL statement that returns a result set? Here is my sample code: CREATE OR REPLACE FUNCTION reporting.report_get_countries_new ( starts_with varchar, ends_with varchar ) RETURNS TABLE ( country_id integer, country_name varchar ) AS $body$ DECLARE starts_with ALIAS FOR $1; ends_with ALIAS FOR $2; sql VARCHAR; BEGIN sql = 'SELECT * FROM lookups.countries WHERE lookups.countries.country_name >= ' || starts_with ; IF ends_with IS NOT NULL THEN sql = sql || ' AND lookups.countries.country_name <= ' || ends_with ; END IF; RETURN

Execute procedure in a trigger

本秂侑毒 提交于 2019-11-29 20:32:03
问题 Is it possible to execute a stored procedure inside a trigger? Thank you 回答1: Yes, like this: create or replace trigger trg after insert on emp for each row begin myproc(:new.empno, :new.ename); end; 回答2: Yes you can fire a procedure from a Trigger. But, keep in mind that trigger & procedur e should not acess the same table. 回答3: Yes you can. Just keep in mind that a trigger can fire for every row affected with a DML trigger. So your stored procedure should be optimized or you could will run

vbscript Eval a string to a Variable in a loop?

倖福魔咒の 提交于 2019-11-29 16:33:10
I am trying to use vbscript's Eval (or maybe I need Execute) to create some variables from the key names from an ini file. The ini file can have unlimited unknown key=val pairs. I need to create a variable based on the key name no matter what. Ini File contents: myPath=c:\test myExe=myapp.exe .... xxx=123 yyy=abc My code that reads the ini and returns the key and values to an object The code I am trying to get working is here: For each pair in objINI Eval("pair.key=pair.val") Next msgbox myPath msgbox myExe But both msgbox's are showing empty And yes I am sure pair.key and pair.val have the

eclipse下android项目解决方法数id超过65535

你。 提交于 2019-11-29 09:25:45
java.lang.IllegalArgumentException: method ID not in [0, 0xffff]: 65536 你的应用中的Dex 文件方法数超过了最大值65536的上限,简单来说,应用爆棚了. 那么让我们看一下为什么会引起这种错误: 在 Android 系统中,一个 App 的所有代码都在一个 Dex 文件里面。 Dex 是一个类似Jar的存储了多有 Java 编译字节码的归档文件。因为 Android 系统使用 Dalvik 虚拟机,所以需要把使用 Java Compiler 编译之后的 class 文件转换成 Dalvik 能够执行的 class 文件。这里需要强调的是, Dex 和 Jar 一样是一个归档文件,里面仍然是 Java 代码对应的字节码文件。当 Android 系统启动一个应用的时候,有一步是对 Dex 进行优化,这个过程有一个专门的工具来处理,叫 DexOpt 。 DexOpt 的执行过程是在第一次加载Dex文件的时候执行的。这个过程会生成一个 ODEX 文件,即 Optimised Dex 。执行 ODex 的效率会比直接执行 Dex 文件的效率要高很多。但是在早期的Android系统中, DexOpt 有一个问题,也就是这篇文章想要说明并解决的问题。 DexOpt 会把每一个类的方法 id 检索起来,存在一个链表结构里面

how to get true or false using execute() in Java Statement [duplicate]

时光毁灭记忆、已成空白 提交于 2019-11-28 13:09:36
This question already has an answer here: Inserting preparedstatement to database - PSQL 1 answer I have Statement object called stmt , Connection object conn . stmt = conn.createStatement(); boolean b = stmt.execute("INSERT INTO employee VALUES('E001', 'Smith')") But this always produce false . I want true if above query executed successfully and false if the query fails executing. How can I achieve that result using execute() method. How can I achieve that result using execute() method. You can't. It will only return true if the result has a ResultSet . If there is a problem with your

Executing a vbs file with arguments created by python

懵懂的女人 提交于 2019-11-28 11:39:33
I would like to convert dozens of excel sheets to csv files at once. I have a working .vbs file which makes the conversion, and I would like to execute this .vbs file on the different sheets with the help of a python code. I have the following 2 versions of the python code: Version 1: import os import sys import subprocess FolderName=sys.argv[1] FileList=os.listdir(FolderName) NewList=[] for i in FileList: NewItem=i.split('.xls') NewXls=FolderName+"\\"+NewItem[0]+".xlsx " NewCsv=FolderName+"\\"+NewItem[0]+".csv" NewCommand="C:\\Users\\user\\XlsToCsv.vbs "+sys.argv[2]+" "+NewXls+NewCsv

Execute multiple semi-colon separated query using mysql Prepared Statement

巧了我就是萌 提交于 2019-11-28 11:10:18
I am trying to create a stored procedure in mysql which creates a new table on every request copies the content from another table and extracts the required data and finally drops the table. The stored procedure is quite large so I cant have EXECUTE after every query and thus I am trying to execute the query all together in a semicolon separated format. But on final execution I get Error Code: 1064. Is the approach I am trying possible, or is there a better approach. SET tableName = (SELECT CONCAT("table",(UNIX_TIMESTAMP(NOW())))); SET @tquery =CONCAT('CREATE TABLE `',tableName,'` (select pt.*

Copy a function in memory and execute it

丶灬走出姿态 提交于 2019-11-28 10:19:46
I would like to know how in C in can copy the content of a function into memroy and the execute it? I'm trying to do something like this: typedef void(*FUN)(int *); char * myNewFunc; char *allocExecutablePages (int pages) { template = (char *) valloc (getpagesize () * pages); if (mprotect (template, getpagesize (), PROT_READ|PROT_EXEC|PROT_WRITE) == -1) { perror ("mprotect"); } } void f1 (int *v) { *v = 10; } // allocate enough spcae but how much ?? myNewFunc = allocExecutablePages(...) /* Copy f1 somewere else * (how? assume that i know the size of f1 having done a (nm -S foo.o)) */ ((FUN