Without knowing anything about the DB interface you are using with
Ruby, sometimes DB vendor-specific commands are not supported by the
the DB interface. "describe <table_name" and "desc <table_name>"
might be an example of this. If I remember correctly, you can get the
same sort of information that "describe" produces by querying a system
table:
select COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION
from ALL_TAB_COLS
where TABLE_NAME = '<table_name>'
See this link for more info on this table:
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2093.htm#sthref1688
Cheers,
Daniel.
On 02/08/06, Nivetha Padmanaban <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> my requirement is like this - i need to execute couple of queries in
> different databases like, Oracle, DB2 and Teradata and i need to execute
> bunch of scripts based on the query results.
>
> today, i'm trying to execute simple queries against oracle database. but,
> i'm getting the below error again and again when i try to execute 'describe
> tabs' query.
>
> c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:557:in `execute':
> ORA-00900: invalid SQL statement (OCIError)
> from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:557:in
> `exec'
> from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:109:in
> `do_ocicall'
> from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:557:in
> `exec'
> from c:/ruby/lib/ruby/site_ruby/1.8/oci8.rb:178:in
> `exec'
>
> But, i'm able to execute ('select * from all_users where username = :1',
> 'System')
> i got the above query from the web.
>
> Any clues?
>
> Regards,
> Nivetha.
> Email - [EMAIL PROTECTED]
> Mobile - (0) 98807 17518
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general