Re: [sqlite] Error while executing query: no such column: t1.*B.Switch-Tower-Sector

2015-01-09 Thread MikeSnow
I got it...so happy,
thanks guys



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Error-while-executing-query-no-such-column-t1-B-Switch-Tower-Sector-tp79905p79930.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error while executing query: no such column: t1.*B.Switch-Tower-Sector

2015-01-08 Thread Hick Gunter
Maybe you mean  (assuming there is not more than one record in t2 for  a given 
SSID-CELLID-SECTOR)

UPDATE t1 ...

-Ursprüngliche Nachricht-
Von: MikeSnow [mailto:michael.sab...@gmail.com]
Gesendet: Freitag, 09. Jänner 2015 00:12
An: sqlite-users@sqlite.org
Betreff: [sqlite] Error while executing query: no such column: 
t1.*B.Switch-Tower-Sector

I was wondering if anyone could let me know where I am going wrong. I am 
getting the error...
"Error while executing query: no such column: t1.*B.Switch-Tower-Sector"
but, the column,  t1.[*B.Switch-Tower-Sector], does exist.  I get results when 
I do select[*B.Switch-Tower-Sector] from t1; but an error when I do the UPDATE 
statement...

UPDATE t2
SET [*B.ANT_ORIENTATION] =
(SELECT t2.ANT_ORIENTATION
FROM t2
WHERE
t2.[*SSID-CELLID-SECTOR] = t1.[*B.Switch-Tower-Sector]);

Any help would be much appreciated.
thanks
mike



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Error-while-executing-query-no-such-column-t1-B-Switch-Tower-Sector-tp79905.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


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


Re: [sqlite] Error while executing query: no such column: t1.*B.Switch-Tower-Sector

2015-01-08 Thread RSmith


On 2015/01/09 01:12, MikeSnow wrote:

I was wondering if anyone could let me know where I am going wrong. I am
getting the error...
"Error while executing query: no such column: t1.*B.Switch-Tower-Sector"
but, the column,  t1.[*B.Switch-Tower-Sector], does exist.  I get results
when I do
select[*B.Switch-Tower-Sector] from t1;
but an error when I do the UPDATE statement...

UPDATE t2
SET [*B.ANT_ORIENTATION] =
(SELECT t2.ANT_ORIENTATION
FROM t2
WHERE
t2.[*SSID-CELLID-SECTOR] = t1.[*B.Switch-Tower-Sector]);


Hi Mike,

There are many things that might be improved here, and one thing that is 
definitely wrong.

In the Update Query, you are asking the DB to set a column named "*B.ANT_ORIENTATION" in a Table called "t2" to another value in a 
column called "ANT_ORIENTATION" selected from the same table "t2" which can be found in some row it has to look up by seeing where 
the "*SSID-CELLID-SECTOR" column equals a value that can be found in a column called "*D.Sqitch-Tower-Sector" in a Table called "t1" 
- But where is this table "t1" referenced in the query?  Nowhere - not in the UPDATE clause, not in the FROM clause, how must it 
know what t1 refers to?


Even if the table exists in the database, you cannot just reference some column from it without telling the query to scan that table 
in a FROM clause.


Even then, if you add that table to the from clause by means of a join or such, you still need to tell it explicitly which row to 
look up... The value for that column must be compared for which row?


Then, how must it distinguish between table t2 in the Update clause and t2 in 
the SELECT clause? You need a bit of an Alias I think.

I will try to re-write the query here to what I /THINK/ might be a pseudo-query 
of what you intended, but this is just a guess:

UPDATE t2 SET [*B.ANT_ORIENTATION] = (
  SELECT SS.ANT_ORIENTATION
FROM t2 AS S2
LEFT JOIN t1 AS S1 ON S2.[*SSID-CELLID-SECTOR] = S1.[*B.Switch-Tower-Sector]
  WHERE S2.[SOME_ID]=t2.[SOME_ID]  (...or perhaps 
S1.[SOME_COLUMN]=t2.[SOME_COLUMN]?)
);

If you give us the table layouts (schemata) and explain in simple terms what answer you need from the query, we'd be able to make a 
more accurate suggestion on best query to use.


PS: While The MS SQL SERVER type brackets [ and ] are allowed in SQLite because of niceness, it isn't best practice or correct SQL. 
The SQL standard calls for enclosing columns and table  object names in double quotes:  "column_name";  and values in single quotes: 
'value'.  Another less than optimal practice is using SQL-specific control characters in object names, such as the asterisk - or 
having columns or aliases that are reserved words for the specific engine. It should mostly work though.



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


Re: [sqlite] Error while executing query: no such column: t1.*B.Switch-Tower-Sector

2015-01-08 Thread Igor Tandetnik

On 1/8/2015 6:12 PM, MikeSnow wrote:

"Error while executing query: no such column: t1.*B.Switch-Tower-Sector"
but, the column,  t1.[*B.Switch-Tower-Sector], does exist.  I get results
when I do
select[*B.Switch-Tower-Sector] from t1;
but an error when I do the UPDATE statement...

UPDATE t2
SET [*B.ANT_ORIENTATION] =
(SELECT t2.ANT_ORIENTATION
FROM t2
WHERE
t2.[*SSID-CELLID-SECTOR] = t1.[*B.Switch-Tower-Sector]);


Before you can use a table name elsewhere, you must introduce it in a 
FROM clause (or INSERT INTO, UPDATE or DELETE clause).

--
Igor Tandetnik

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


Re: [sqlite] Error while executing query: no such column: t1.*B.Switch-Tower-Sector

2015-01-08 Thread Simon Slavin

On 8 Jan 2015, at 11:12pm, MikeSnow  wrote:

> UPDATE t2
> SET   [*B.ANT_ORIENTATION] = 
> (SELECT t2.ANT_ORIENTATION
> FROM t2
> WHERE 
> t2.[*SSID-CELLID-SECTOR] = t1.[*B.Switch-Tower-Sector]);

You do not mention a specific row of t1, so it doesn't know what value you're 
talking about.

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


[sqlite] Error while executing query: no such column: t1.*B.Switch-Tower-Sector

2015-01-08 Thread MikeSnow
I was wondering if anyone could let me know where I am going wrong. I am
getting the error...
"Error while executing query: no such column: t1.*B.Switch-Tower-Sector"
but, the column,  t1.[*B.Switch-Tower-Sector], does exist.  I get results
when I do 
select[*B.Switch-Tower-Sector] from t1;
but an error when I do the UPDATE statement...

UPDATE t2
SET [*B.ANT_ORIENTATION] = 
(SELECT t2.ANT_ORIENTATION
FROM t2
WHERE 
t2.[*SSID-CELLID-SECTOR] = t1.[*B.Switch-Tower-Sector]);

Any help would be much appreciated.
thanks
mike



--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/Error-while-executing-query-no-such-column-t1-B-Switch-Tower-Sector-tp79905.html
Sent from the SQLite mailing list archive at Nabble.com.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users