Hi Bryan,

For both of your queries you can use the following code


void generateFile()
{
    Common          common;
    DictTable       dictTable;
    DictField       dictField;
    SysDictField    sysDictField;
    int             i, j;
    AsciiIo         myFile;
    str             writeString;
    ;

    myfile = new AsciiIo("c:\\Test.csv",'W');

        DictTable = new DictTable(tableId);

        if (dictTable)
        {
            for (i = 1 ; i <= dicttable.fieldCnt() ; i++)
            {
                dictField = new DictField(dictTable.id(),
dictTable.fieldCnt2Id(i));

                if(dictField && !dictField.isSystem())
                {
                    if (dictField.arraySize() > 1)
                    {
                        for( j = 1; j <= dictField.arraySize(); j++)
                        {
                            sysDictField = new SysDictField(dictTable.id(),
dictField.id(), j);
                            writeString += strfmt("%1",common.(
sysDictField.id()))+",";
                        }
                    }
                    else
                    {
                        writeString += strfmt("%1",common.(dictField.id
()))+",";
                    }
                }
            }
        }
        writeString += "\r";
    }

    myFile.writeRaw(writeString);
}
In case of query the additional code you need to write is

common = queryRun.get(tableId);

this will get the record in common table buffer then as shown above you can
get all the fields of a table and export to a file

Hope this is useful to you

Regards,
Sumit


On 6/27/07, bryanevil <[EMAIL PROTECTED]> wrote:
>
>
> Hi all,
>
> Thanks in advance for your help. two questions I have tried to solve
> for a long time, want post it here before i give up.
>
> Q1) this is my query:
>
> while Select CustTable{
>
> /* At here how can I refer all the fields' values from the row
> and write into a txt file?? Example COde please */
>
> }
>
> i dont want do it like :
>
> io.write( custTable.field1 + custTable.field2 + ........
>
> it will take me forever :/
>
> Q2) this is my another query:
>
> q.addDataSource(tbId);
> qq = new queryrun(q);
> if(qq.next()){
> /* How to retrieve individual field data from a unknown
> table??
> After that, because the table is unknown, how do i assign that
> unknown datatype value to an variable?*/
> }
>
> Thank You,
> Bryan
>
> 
>


[Non-text portions of this message have been removed]

Reply via email to