Re: [sqlite] unique id for table

2013-06-23 Thread e-mail mgbg25171
Yes thanks for the advice...I've already combined the "raw" data i.e.
vectors straight out of the annual reports and the calculated vectors e.g..
"noplat" derived from it which I've given a type "calcd" in the type field
of the same table "itms".
There is some market wide data however, which might not fit into this
vector table Even though the individual items are stored as individual
records.I'm just at the stage of integrating SQLITE with forth and
everything's up for grabs at the moment.



On 23 June 2013 12:42, Simon Slavin  wrote:

>
> On 23 Jun 2013, at 12:26pm, e-mail mgbg25171 
> wrote:
>
> > The "table as a number" idea is necessary to fit my model
> > where word definitions are stored as streams of code pointers (NUMBERS)
> > that just get called.
> > i.e. EVERYTHING has to be a number
>
> That makes perfect sense.
>
> If these tables all have the same fields in you might want to refactor
> your SQLite schema so that these tables are actually all one big table.
>  The thing you currently consider to be a table name would just be a field
> in the big table.
>
> This would give you a single rowid which would indicate both the table and
> the (currently) row in that table.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] unique id for table

2013-06-23 Thread Simon Slavin

On 23 Jun 2013, at 12:26pm, e-mail mgbg25171  wrote:

> The "table as a number" idea is necessary to fit my model
> where word definitions are stored as streams of code pointers (NUMBERS)
> that just get called.
> i.e. EVERYTHING has to be a number

That makes perfect sense.

If these tables all have the same fields in you might want to refactor your 
SQLite schema so that these tables are actually all one big table.  The thing 
you currently consider to be a table name would just be a field in the big 
table.

This would give you a single rowid which would indicate both the table and the 
(currently) row in that table.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] unique id for table

2013-06-23 Thread e-mail mgbg25171
I'm writing a variation of forth (It's got an IDE and 3-level stepping
debugger already)
that's actually a company valuation programming language (Can't get on with
spreadsheets hiding everything)
It accomodates words that are financial report line items (vectors) and
their manipulation
and I'm using SQLITE to store such vectors scraped from pdfs
at various stages i.e. until they fit a standard form allowing comparison
between companies.
The "table as a number" idea is necessary to fit my model
where word definitions are stored as streams of code pointers (NUMBERS)
that just get called.
i.e. EVERYTHING has to be a number
I'm therefore proposing to get at line items and any other piece of
financial info using a number for the table and one for the first row-id
from which you can get the name and type to search for the other values in
the vector.
That's about it and thanks for your interest!







On 23 June 2013 10:06, RSmith  wrote:

> There is of course no straight-forward way to do this, as I've noted Simon
> said already. But my curiosity is very piqued - Mind sharing what kind of
> application requires number-only calling? You using this on a calculator of
> sorts? - If so (or otherwise), some details would be interesting to know.
> (I do some embedded systems, never tried SQLite on it but might, hence the
> interest).
>
> I reply On-list as others might be interested, but will take the
> discussion off-list as it may not really be in the scope of the list (I
> think) if your awaited reply prompts further discussion.
>
> Have a great day!
>
> On 2013/06/22 20:27, e-mail mgbg25171 wrote:
>
>> I need to access a row just using numbers.
>> The row id's fine but can I specify the table using a numeric id too?
>> If not I'll just create a look-up table so there's no problem.
>> I'm just wondering...
>> Any help much appreciated.
>> __**_
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>>
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] unique id for table

2013-06-23 Thread RSmith
There is of course no straight-forward way to do this, as I've noted Simon said already. But my curiosity is very piqued - Mind 
sharing what kind of application requires number-only calling? You using this on a calculator of sorts? - If so (or otherwise), some 
details would be interesting to know. (I do some embedded systems, never tried SQLite on it but might, hence the interest).


I reply On-list as others might be interested, but will take the discussion off-list as it may not really be in the scope of the 
list (I think) if your awaited reply prompts further discussion.


Have a great day!

On 2013/06/22 20:27, e-mail mgbg25171 wrote:

I need to access a row just using numbers.
The row id's fine but can I specify the table using a numeric id too?
If not I'll just create a look-up table so there's no problem.
I'm just wondering...
Any help much appreciated.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] unique id for table

2013-06-22 Thread e-mail mgbg25171
Thanks very much Simon
Looks like plan B then.


On 22 June 2013 19:40, Simon Slavin  wrote:

>
> On 22 Jun 2013, at 7:27pm, e-mail mgbg25171 
> wrote:
>
> > I need to access a row just using numbers.
> > The row id's fine but can I specify the table using a numeric id too?
>
> This command can be used to get tables numbered:
>
> SELECT rowid,name FROM sqlite_master WHERE type='table'
>
> However, if you have tables A, B and C and delete one of them, the numbers
> for other tables can change.  Even creating or deleting indexes can change
> rowids.  So it’s valid only until your schema changes in some way.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] unique id for table

2013-06-22 Thread Simon Slavin

On 22 Jun 2013, at 7:27pm, e-mail mgbg25171  wrote:

> I need to access a row just using numbers.
> The row id's fine but can I specify the table using a numeric id too?

This command can be used to get tables numbered:

SELECT rowid,name FROM sqlite_master WHERE type='table'

However, if you have tables A, B and C and delete one of them, the numbers for 
other tables can change.  Even creating or deleting indexes can change rowids.  
So it’s valid only until your schema changes in some way.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users