Volusion的通用SQL文件夹,功能 [英] Volusion's generic SQL folder, functionality
问题描述
我发现这个反应非常有用
I found this response very helpful
<一个href=\"http://stackoverflow.com/questions/29114567/how-to-write-join-query-in-volusion-api/29134928#29134928\">how写加盟volusion API 查询
我正在寻找的是我自己的.SQL和xsd文件添加到/ vspfiles /模式/通用文件夹,并能够将参数传递给它的方法。有谁知道这是可能的。
What I'm looking for is a way to add my own .SQL and .XSD files to the /vspfiles/schema/Generic folder and be able to pass parameters to it. Does anyone know if that's possible.
在SQL的一个非常基本的例子是这样的事情...
A very basic example of the SQL would be something like this...
SELECT * FROM订单,其中的order_id =-ORDERID -
select * from Orders where order_id = "-ORDERID-"
...我想要能够在-ORDERID-传递作为一个变量。
...and I'd be able to pass in the "-ORDERID-" as a variable.
甚至更好的SQL文件将只是这个-SQL-,我可以在整个SQL字符串传递自己。谢谢!
Or even better the SQL file would just be this "-SQL-" and I could pass in the entire SQL string myself. Thanks!
推荐答案
感谢user357034你为我在这里(我上你的答案,但我是新和没有任何声望)。我想张贴code我情况下使用其他人遇到这种。如果你看到任何看起来傻傻的在这里也得到任何反馈。
Thanks user357034 for getting me here (I'd "up" your answer but I'm new and don't have any reputation). I wanted to post the code I used in case others run into this. And also get any feedback if you see anything that looks goofy here.
首先,我创建了一个ASP文件,像这样
First, I created an ASP file like so
Dim orderid
Dim status
orderid = Request.QueryString("orderid")
status = Request.QueryString("status")
sql = " update Orders " & _
" set OrderStatus = '" + status + "' " & _
" where Orderid in (" + orderid + ") " ;
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile(Server.MapPath("./MY_FILE.sql"),2,true)
f.WriteLine(sql)
f.Close
set f=Nothing
set fs=Nothing
我通过FTP,截至上Volusion的通用文件夹中。
I FTPed that up to the "generic" folder on Volusion.
其次,在PHP中,我把这个文件中,类似这样...
Next, in PHP, I call this file, similar to this...
$asp = file("http://MY_SITE/v/vspfiles/schema/generic/MY_FILE.asp?
orderid=11,12&status=Processing");
foreach ( $asp as $line )
{
echo ($line);
}
请注意:我已经通过FTP XSD文件到同一文件夹具有相同的名称,如MY_FILE.xsd
NOTE: I already FTPed an XSD file to the same folder with the same name, like MY_FILE.xsd.
最后,我做一个Web服务调用我的服务,像这样...
And finally, I make a web service call to my service, like this...
$url = "http://MY_SITE/net/WebService.aspx?
Login=XXXX&EncryptedPassword=YYYYY&API_Name=Generic\MY_FILE"
伟大工程。我进入Volusion管理站点,查看订单11和12,和他们进行了更新。我使用的Volusion几个方面他们的API缺少其中这些方法。谢谢!
Works great. I go into the Volusion admin site, look at the Orders 11 and 12, and they were updated. I'm using this method for several areas in Volusion where their API is lacking. Thanks!
这篇关于Volusion的通用SQL文件夹,功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!