MizzGail
85 pts. | Apr 17 2008 3:42PM GMT
AH. yes. forgot the ON statement. It is there. I am joining the first two on customer code.
I can do two joins in succession?
Let me try.
MizzGail
85 pts. | Apr 17 2008 3:50PM GMT
I got the 2nd join to work and its giving me the location name.
I tried using the column command as the first line in my query as
column locationname format A10 and it says its an invalid sql statement.
Dwaltr
900 pts. | Apr 17 2008 4:14PM GMT
It is only valid inside of SQL*Plus. Are you using SQLPlus or are you using something else like SQL Developer or TOAD?
MizzGail
85 pts. | Apr 17 2008 5:05PM GMT
I am using sqlplus from a unix server client server connecting to the oracle server.
Dwaltr
900 pts. | Apr 17 2008 5:45PM GMT
OK, at this point I am only guessing. The COLUMN command works using a column name or the alias. If you are using an alias, you must use the alias in the COLUMN statement. If you post your query, I may be able to do better.
MizzGail
85 pts. | Apr 17 2008 5:53PM GMT
1 column div.location.locname format A10
2* select locname from div.location
3 ;
column div.location.locname format A10
*
ERROR at line 1:
ORA-00900: invalid SQL statement
SQL>
I went back to just trying the one column to see if i can get this one peice to work.
Dwaltr
900 pts. | Apr 17 2008 6:19PM GMT
Couple of things I see:
1.) You are missing the semicolon at the end of the column statement. It is its own statement.
2.) You only specify the column name, not the owner, table, etc.
column locname format A10;
MizzGail
85 pts. | Apr 17 2008 6:59PM GMT
I thought the format was database.table.fieldname ? thats how I’ve been writing the queries. Everthing works but this one thing. I did try the semicol but it didn’t work either.
BUT…
I put in set linesize to 132 and now it doesn’t wrap. :0)
Thanks!
Dwaltr
900 pts. | Apr 17 2008 7:14PM GMT
That’s fine in the query (and it’s actually owner.table.column because with Oracle it’s one database per instance, unlike SQL Server and Sybase).
But the column command it is only the column or the alias if provided.






