It's possible to use column names with embeded space, I believe any char is 
allowed.
the case with makearray I had in mind was like this. But that's how makearray 
works.

/* rexx */

tbl = .oosqliteconnection~new("mytest2.db",,.ooSQLite~OO_STEM_OF_STEMS)

sql = "CREATE TABLE TBL (A,B, 'My Column')"
tbl~exec(sql)
sql = "INSERT INTO TBL VALUES('A1','B1','My Col1');"
tbl~exec(sql)
sql = "INSERT INTO TBL VALUES('A2','B2','My Col2');"
tbl~exec(sql)
sql = "INSERT INTO TBL VALUES('A3','B3','My col3');"
tbl~exec(sql)

tblcols = .array~of('[My Column]','B','A')
rows. =tbl~exec("SELECT "tblcols~makestring('L',',') "FROM TBL;",.TRUE) 
do x = 1 to rows.0
    mycols = rows.x~makearray   -- give me column names, order will not match 
select order above

    arow.  = rows.x
    do col over mycols
       say arow.col
    end   
end


----- Ursprungligt Meddelande -----
Från: Mark Miesfeld <miesf...@gmail.com>
Till:<hexi...@users.sourceforge.net> , Open Object Rexx Users 
<oorexx-users@lists.sourceforge.net>
Kopia:
Datum: onsdag, 31 oktober 2012 23:32
Ämne: Re: [Oorexx-users] ooSQLite and OO_STEM_OF_STEMS
On Wed, Oct 31, 2012 at 12:33 AM, hakan <hexi...@users.sourceforge.net> wrote:

I like the rs.i.id style, I haven't used stems as output from oosqlite exec at 
all, so no code to change here either.
for me it's more OO_STEM_OF_ROWS (rs.0) than OO_STEM_OF_COLUMNS 



Yes, I like that style better.  It is really what I first intended to 
implement, and what I prefer.  Rather than change OO_STEM_OF_STEMS, I just kept 
it as is and added a fourth format.


Right now it is OO_CLASSIC_STEM.  I can easily change the name, but that seems 
adequate to me.  Unless there are some vocal opponents to that, I'll just keep 
it.






Regarding the risk of using a local variable with the same name as a table 
column, 
I think that's the programmer's responsibility to keep track of. That problem 
is always present regardless oosqlite.
So please no construct like, stem.0column or .!column



Yes, I don't like those constructs myself, so I haven't implemented that 
change.  Again, unless there are some vocal advocates for that construct, I'm 
not inclined to make a change here.




Another thing to maybe (I am not sure) consider is if a table column name have 
embedded space, like 'my column'.



Is that possible in SQL?  I certainly don't know much about the details here, 
but I was assuming a column name could not include spaces.


Also if using stem.~allIndexes/makearray, you get an array of all stem 
tails/indexes, but it's in an unspecified order and in the case that
this is table column names, it had been nice to have the same order as the sql 
select statement order.



Currently if you use:  do i = 1 to n you get the same order as the SQL select 
produces the order.  Not sure if this is just a statement of fact by you, or 
you have some meaning here I don't understand.  ;-)


--
Mark Miesfeld
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to