RE: desc: invalid sql statement



'desc' is a Plus command in Oracle. It is not valid SQL.

--
Ron Reidy
Lead DBA
Array BioPharma, Inc.

-----Original Message-----
From: listmail [mailto:listmail@xxxxxxxxxxxx]
Sent: Tuesday, December 27, 2005 12:36 PM
To: dbi-users@xxxxxxxx
Subject: desc: invalid sql statement


I believe a describe statement is Oracle DDL, but I still failed for
both of the ways that I know of to execute sql. There must be something

that I am not considering.

#!/usr/local/bin/perl
#script to demonstate execution failure
use strict;
use warnings;

use DBI;
use DBD::Oracle;

my $username='';
my $password='';
my $dbsid='';
my $cont;

eval {
$cont = DBI->connect('dbi:Oracle:' . lc($dbsid), $username,
$password,
{
RaiseError => 1,
AutoCommit => 0,
ora_session_mode => 0
}
);
};

die "problem" if ($@);

my $sth;

#1
eval {
$sth = $cont->prepare("desc user_tables");
};

if ($@) {
print "$DBI::errstr";
#exit;
} else {
eval {
$sth->execute;
};

if ($@) {
print "$DBI::errstr";
#exit;
}
}

#2
eval {
$cont->do("desc user_tables");
};

if ($@) {
print "$DBI::errstr";
#exit;
}

# Windows XP
# DBI 1.48
# DBD-Oracle 1.16
# ActivePerl 5.8.7 build 813

DBD::Oracle::st execute failed: ORA-00900: invalid SQL statement (DBD
ERROR: OCIStmtExecute) [for Statement "desc user_tables"] at
C:\DATA\SESS_KILL\DBD-DBI_testing.pl line 37.
ORA-00900: invalid SQL statement (DBD ERROR: OCIStmtExecute) <--print
output DBD::Oracle::db do failed: ORA-00900: invalid SQL statement (DBD
ERROR:
OCIStmtExecute) [for Statement "desc user_tables"] at
C:\DATA\SESS_KILL\DBD-DBI_testing.pl line 48.
ORA-00900: invalid SQL statement (DBD ERROR: OCIStmtExecute) <--print
output Issuing rollback() for database handle being DESTROY'd without
explicit
disconnect().

This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended
to be for the use of the individual or entity named above. If you are not the
intended recipient, please be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. Please notify the
sender of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.

.



Relevant Pages

  • Re: Limit of 1050 columns for ANSI joins
    ... comprehensive than Oracle SQL. ... I'm trying not to have any auto-generated SQL on my system, ... Index your schema properly and think about the proper design. ...
    (comp.databases.oracle.server)
  • Re: I cant find a SETUP.EXE in the SQL Plus Client ??
    ... someone else's server for testing some SELECT statements I'm ... free client because I don't own the Oracle license. ... SQL statements. ... There is no documentation with that download. ...
    (comp.databases.oracle.tools)
  • Re: How to convince my customer to use SQL2005 instaed of Oracle10g
    ... the old Sql versus Oracle debate. ... If I were you I would focus one SQL Server 2005 clearest advantages ... You mentioned Availability, so I assume your looking into HA (high ...
    (microsoft.public.sqlserver)
  • Re: How to convince my customer to use SQL2005 instaed of Oracle10g
    ... migration to Sql 2005 would be direct & straight forward, quick, and ... If I were you I would focus one SQL Server 2005 clearest advantages ... would need a 4 processor license but for Oracle you would need a 16 ... You mentioned Availability, so I assume your looking into HA (high ...
    (microsoft.public.sqlserver)
  • Re: MS SQL Server - a plethora of limitations...
    ... > Most of your objections are that MS-SQL is not Oracle. ... according to the standards. ... > There is no such syntax or concept in Standard SQL. ... Partitioning shouldn't be done automatically by the DB, ...
    (microsoft.public.sqlserver.programming)