Using other column value through Python script
jean-rator
Posts: 19
Hello everybody,
I'm trying to set a column (bit) with the opposite of another one (bit, too) of the same table.
when one is true, the other has to be false and vice-versa.
The only choice - in my opinion - is to use a Python script.
I'm not an expert of this language, and I'm wondering if it si possible to use the value of other column in my code (as it could be done with Regexp generator : $[columnName]...)
Constraint : it is not possible to use an SQL Statement because an additional connection has to be defined in that case ; and I want to target any server/DB with only changing the connection at Project level.
Thanks in advance for any suggestion/advice.
Regards.
JL.
I'm trying to set a column (bit) with the opposite of another one (bit, too) of the same table.
when one is true, the other has to be false and vice-versa.
The only choice - in my opinion - is to use a Python script.
I'm not an expert of this language, and I'm wondering if it si possible to use the value of other column in my code (as it could be done with Regexp generator : $[columnName]...)
Constraint : it is not possible to use an SQL Statement because an additional connection has to be defined in that case ; and I want to target any server/DB with only changing the connection at Project level.
Thanks in advance for any suggestion/advice.
Regards.
JL.
using SQL data Generator 2.0
----
dedicated CRM Software build with dotNet WPF / SQLServer 2008R2
----
dedicated CRM Software build with dotNet WPF / SQLServer 2008R2
Comments
The Python generator won't give you access to generated data in other columns. There is an unsupported, third-party Ruby generator that you can use for this, discussed at http://www.simple-talk.com/dotnet/.net- ... generator/
I have a newer build that works with SQL Data Generator v2; if you email me, I can send it to you so you don't have to mess around with the v1 version Ben did so long ago that is not working with the current build.
Thanks!
ftp://support.red-gate.com/patches/sql_ ... .0.1.6.zip
Just to manage expectations, the Ruby Generator is unsupported and not a part of the SQL Data Generator software package. It's something I can do in my spare time.
I don't think you need to spend any time on it unless you think it would benefit the SDG user community at large. We are going to purchase this tool anyway and I am done with my testing.
The source code was not in the zip file. Just the .dll files. As a company, I think we would be interested in getting a working version of IronRuby, though, because we really have big need to reference other fields in the same row. Right now, we are doing all that kind of work in After scripts.
Thanks,
Scott
ftp://support.red-gate.com/patches/sql_ ... .0.3.1.zip
The source code is available from the original Simple-Talk article:
http://www.simple-talk.com/dotnet/.net- ... generator/
However, since Ben built this against an older version of MS DLR, I had to custom-build the older versions of MS-DLR, so if you wanted to recompile, you would have to replace references to the Microsoft.Scripting assemblies with the "Ruby" versions contained in the ZIP.