Is there a way I can write a query to check if columns A, B, and C only
exist in table T? If table T contains columns A, B, C, and D then I
want the query to fail or return some appropriate result. I am using
JDBC so if the query throws an error, that will let me know there the
table that deoes not contain the specified columns.
I am using Oracle 8.1.7 for Solaris and JDK 1.3.
Thanks for the advice, - Dave
nioTo - 25 Jan 2005 21:12 GMT
Le 25/01/2005 20:39, laredotornado@zipmail.com a écrit :
> Is there a way I can write a query to check if columns A, B, and C only
> exist in table T? If table T contains columns A, B, C, and D then I
[quoted text clipped - 4 lines]
> I am using Oracle 8.1.7 for Solaris and JDK 1.3.
> Thanks for the advice, - Dave
the best way to check columns is to use the method getColumns( ... )
of class java.sql.DatabaseMetaData
nioTo
Thomas Kellerer - 25 Jan 2005 21:20 GMT
laredotornado@zipmail.com wrote on 25.01.2005 20:39:
> Is there a way I can write a query to check if columns A, B, and C only
> exist in table T? If table T contains columns A, B, C, and D then I
[quoted text clipped - 4 lines]
> I am using Oracle 8.1.7 for Solaris and JDK 1.3.
> Thanks for the advice, - Dave
<http://java.sun.com/j2se/1.4.2/docs/api/java/sql/DatabaseMetaData.html#getColumn
s(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)>