Subject Re: SQLDataset():new()
From Boris <>
Date Thu, 06 Dec 2018 05:13:21 +0000
Newsgroups sqlexpress

As per the docs:

:GetSQLColumn( xColumn ) -> oSQLColumn | NIL
Returns a reference to the base *SQLColumn* object.

Since the ad hock generated dataset contains no "SQLColumn" object, the return value is NIL.

Regards,
Boris


Osvaldo Ramirez Wrote:

> Hello guys
>
> I have the folloing code
>
> oCursor:= SQLDataSet():new()
> oCursor:AddColumn("barcode" ,  {||""}     )
> oCursor:AddColumn("marca"   ,  {||""}     )
> oCursor:AddColumn("descrip" ,  {||""}     )
> oCursor:AddColumn("cantidad",  {||0}     )
> oCursor:AddColumn("fecha"   ,  {||date()}     )
>
> nLen := oCursor:fcount()
>
> FOR i := 1 TO nLen // 5 columns
>
>
>     oCol := oCursor:GetSQLColumn(i) // return an object nill o null
>
> ...
>
>
> oCol is null
>
>
> But, If I use this code, all work fine.
>
> oCursor:= SQLDataSet():new("select field,field2,field from xxx")
>
> nLen := oCursor:fcount()
>
> FOR i := 1 TO nLen // 5 columns
>
>
>     oCol := oCursor:GetSQLColumn(i)
>
>
> So, my question is why those function produce diferents objects
> sqldataset():new() => sqldataset():new("select xx")
>
> Thanks in advance
> Osvaldo Ramirez
>


Recent messages in this thread
 
-# SQLDataset():new() Osvaldo Ramirez 05-Dec-2018 10:48 pm
.-# Re: SQLDataset():new() (Current message) Boris <> 06-Dec-2018 05:13 am
..\# Re: SQLDataset():new() Osvaldo Ramirez 06-Dec-2018 03:40 pm