Volusion 的通用 SQL 文件夹,功能 [英] Volusion's generic SQL folder, functionality

查看:21
本文介绍了Volusion 的通用 SQL 文件夹,功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现这个回复很有帮助

I found this response very helpful

如何在 Volusion API 中编写联接查询

我正在寻找一种将我自己的 .SQL 和 .XSD 文件添加到/vspfiles/schema/Generic 文件夹并能够将参数传递给它的方法.有谁知道这是否可能.

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 Orders where 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 让我来到这里(我会提出"你的答案,但我是新手,没有任何声誉).我想发布我使用的代码,以防其他人遇到这个问题.如果您在这里看到任何看起来很傻的东西,也可以得到任何反馈.

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 上的generic"文件夹.

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);
 }

注意:我已经将一个 XSD 文件通过 FTP 传输到同名文件夹,例如 MY_FILE.xsd.

NOTE: I already FTPed an XSD file to the same folder with the same name, like MY_FILE.xsd.

最后,我对我的服务进行网络服务调用,就像这样...

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆