RE: AW: [sqlite] sqlite3_column_tablename

2005-01-23 Thread mike cariotoglou

What do you want if the user types "SELECT (t0.x || t1.x) FROM table0,
table1 ."?

I would like to second that request. Ok, sure, there are cases where the
info is meaningless (like above), and should be blank.
But in most cases, it IS meaningful, and extremely useful for tools (not so
much perhaps for hard-coded situations, but do consider
A report generator, or a visual query builder, for example)



Re: AW: [sqlite] sqlite3_column_tablename

2005-01-22 Thread Dan Kennedy

--- "Plenert, Joerg" <[EMAIL PROTECTED]> wrote:

> Yes that function points into the right direction !
> But I need something like that:
>  
> SELECT t0.x as col0, t1.x as col1 from table0 as t0, table1 as t1 where t0.y 
> = t1.y;
>  
> Now I want the following information about the colums:
>  
> 1: column name = col0
> original column name = x
> table name = t0
> original table name = table0
>  
> 2: column name = col1 
> original column name = x
> table name = t1
> original table name = table1

What do you want if the user types "SELECT (t0.x || t1.x) FROM table0, table1 
."?





__ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail


Re: AW: [sqlite] sqlite3_column_tablename

2005-01-22 Thread Ulrik Petersen
Hi Joerg,
Plenert, Joerg wrote:
Hi Ulrik,
picture this:
A user types a query with output of fields from 
two ore more tables. Now, before you output the
data, you'll check if the user has the right to
see the data in the fields. 

So I check if the columns name is in my
"allowed" list. Because two tables may have
a column with the same name I need the table
name to make it unique.
But SQLite does not deliver the table name to
the column returned.
MySQL for example delivers this information in MYSQL_FIELD
struct. Here you'll get the name, original name of column and
table of each coulumn in result set.
 

OK, I think I get it.  For example:
SELECT ET.x, MT.y
FROM ET employee_table, MT manager_table
WHERE ET.id = MT.id;
So you want to know that column x comes from table employee_table and 
column y comes from table manager_table.

Sorry, I can't help you any more than helping clarify what you want.  I 
don't know whether you can do what you want already, or whether it's a 
real feature-request.

Regards,
Ulrik P.
--
Ulrik Petersen, MA, B.Sc.
University of Aalborg, Denmark