Can i run a sql command that runs on the server and then creates the output table in my local project in kirix? The results below are created in the SQL server db. I want to run the sql query in SQL but then create the table locally in kirix.

Sure. First, create a table in the local project that mirrors the output of the query structure in SQL Server. Then, read through the result set on SQL Server and for each record in the result set, insert it into the table on the local project.

I'm also adding a checkbox to this form. I have tried to use the line below to check the checkbox in my script but does not work...what is the correct syntax..checkbox.setValue("true");andcheckbox.setValue(-1);

Aaron wrote:Sure. First, create a table in the local project that mirrors the output of the query structure in SQL Server. Then, read through the result set on SQL Server and for each record in the result set, insert it into the table on the local project.

in the 2nd example..it shows how to create a table by hardcoding the field names...but I don't know ahead of time...is there a function that gives me the field info(name and type) to create the table? Or do i have to get that From sql server and then iterate thru a table with that info?

Will describetable() function work for tables in SQL server? remember, I am getting a sql table into a kirix table. So I need the structure of the sql table to create the table in kirix table and then import the data into that kirix table.

Yes, it will work on the SQL Server connection. However, it will turn the mapped column types and widths that are appropriate for importing rather than the native SQL Server column types and widths.

If you want the native SQL Server info, you need to create an appropriate SQL Server SQL statement for these, then iterate through the result set yourself. Then when importing, determine what you want to map to.

Your "While" is capitalized but should be lowercase. ECMAScript is case-sensitive. I think the problem you encountered is that the compiler reported a missing semi-colon, when really something else is wrong. This happened earlier with the ->.

Next time you get a missing semi-colon error when there shouldn't be a semi-colon, take a look at the rest of the line and see if you are using valid keywords and syntax. A good way to find the problem is to take the problem line and try to create the smallest test script using that line that will still fail; then compare that to known examples that work.

ok, i think i know what the problem is...what I need to know is how to dynamically reference the field name (in bold below) from a recordset (SQLTbl). I am getting the name of the field from (fname = info[e].name;). I am trying to feed that to SQLTbl so i can use that dynamically.

I found the answer to my question but now I need it for the other side(inserter.fname). fname is actually giving me value instead of the field name for inserter.fname. I think it has to be inserter.fieldname.

abenitez77 wrote:I found the answer to my question but now I need it for the other side(inserter.fname). fname is actually giving me value instead of the field name for inserter.fname. I think it has to be inserter.fieldname.

fname = info[e].name; inserter.fname = SQLTbl[fname];

remember..i don't know the name of the field ahead of time...this is why i am trying to do this dynamically.

in the example below that i found on the website, it uses the field name in quotes :