how to execute a cmd in sql?

限于喜欢 提交于 2019-12-14 04:12:51

问题


I am using sys_exec but not able to find the right way to execute in right way, Please Anyone helps me that's better for me. I am using Oracle sql

Following is my code.

CREATE or REPLACE TRIGGER sms_trigger
AFTER INSERT ON student
FOR EACH ROW
ENABLE
DECLARE lclcmd CHAR(255);
 res VARCHAR(255);
 BEGIN

   lclcmd := CONCAT('php C:/xampp/htdocs/sample/sms_send.php','something');
  res := sys_exec(lclcmd);

END;
/

回答1:


You may be simply missing a space between the .php file and the parameter. With your code, the invocation command line would look like this;

php C:/xampp/htdocs/sample/sms_send.phpsomething

I doubt you have a file with that name. Add a space after .php and see what happens:

lclcmd := CONCAT('php C:/xampp/htdocs/sample/sms_send.php ','something');

Do post the error messages you may be receiving.



来源:https://stackoverflow.com/questions/53707192/how-to-execute-a-cmd-in-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!