Describe command problem

Hi,
I need to know the structure of a table in a Java program, I try to do this by executing the query "describe tablename", but it shows me the error: ORA 00900 invalid SQL statement. This is the code:
Connection conn = null;
Statement st = null;
ResultSet rs = null;
ResultSetMetaData rsmd = null;
String msg = "";
try {
conn = Conexion.getODS().getConnection(getUsr(), getPwd());
st = conn.createStatement();
rs = st.executeQuery("DESCRIBE empleados");
while(rs.next()){
msg += "<br>" + rs.getString(1);
st.close();
conn.close();
catch( SQLException e ) {
null

right. "Describe' is an Oracle SQL-PLUS command, which it
internall alters to some calls it sends to the DBMS to get
the data it displays. "Describe" is not a Java/JDBC call, and
the DBMS itself also knows nothing about it. In java you
should get a DatabaseMetaData object form your connection,
and make some of it's method calls to get the information
you need.
Joe Weinstein at BEA Systems

Similar Messages

  • Exporting Describe command output.

    I am doing data dictionaries for our small dept database. About 40 tables and 1000 variables. I will be doing this on Excel. The columns that I will be using are:
    Name | Description | Var type | Null?| Label | Constrains
    as you can see some of those are the output of the Describe command so to make my life easier, does anyone know how to put that into Excel? at least whatever is possible, the rest, I will have to type manualy unless someone has any suggestions?
    by the way, I can borrow ER/Studio, Rapid SQL, DBArtisan or TOAD (in case someone knows how to do this with those tools.
    thanks so much guys

    The problem with staying with DVCProHD is that that codec may not be available at the post house.
    You don't need millions+ because there aren't any alpha channels.
    Might want to consider 8-bit uncompressed, but the files will be huge
    But talk first to the post house. If they can CC DVCProHD, stay with it.
    Or ask what it prefers.
    As to the questions, I believe it's codecs. And the HVX200 does shoot anamorphic.
    The files are actually 1280x720. it's a matter of square vs rectangular pixels

  • SQL describe command not running in JSP

    Hello All,
    i hope u all will be enjoying ur lives :)
    i have a problem that when i run the SQL describe command it gives me the error that Invalid SQL Statement...
    the command syntax is
    desc tablename; OR describe tablename;
    and i am doing it like that
    ResultSet rs = stmt.executeQuery("describe CF");
    where CF is the name of table..
    actually what i want to do is get the columns and its datatypes dynamically.. means that i want i get all the tables first from database then whichever table i select i can display its records and also add delete and modify the records...
    if anyone have already code of this ..please email me at
    [email protected]
    i will be very very thank ful for that..
    otherwise tell me the solution of the above problem :(
    thanx in advance
    RANA

    You can get all the information about the table using the meta data. Run a dummy query (I don't think it even needs to return any results), and then grab the meta data
    from the result set:
    ResultSet rs = null;
    ResultSetMetaData rsmd;
    int numcolumns = 0;
    Vector field = new Vector();
    rs = statement.executeQuery( "select * from mytable where field='nevermatchme'");
    rsmd = rs.getMetaData();
    numcolumns = rsmd.getColumnCount();
    for ( int i = 1 ; i <= numcolumns ; i++ ) {
    field.add( rsmd.getColumnName(i) );
    You now have a Vector with one element per database field, each containing a String of that fields name. I believe it is also possible to get field
    type, etc also the MetaData.

  • I am having a problem with the FireFox browser. I have attached two files that best describe the problem. I have labeled them A & B. A is the way it should lo

    I am having a problem with the FireFox browser. I have attached two files that best describe the problem. I have labeled them A & B. A is the way it should look and B is what happens after I have I opened several tabs. I can get it back to normal if I click on VIEW than click on customize. When the customize window appears FireFox returns to its normal state. I than click on the done box and go back to what I have been doing. I tried resetting FireFox back to default settings, but that did not correct the problem.
    This began happening about a month ago. Is there a way I can fix this problem? Thanks for your help.I don't know how to attach my 2 attachments that shows the problem I am having.
    [email address removed to protect your privacy and security]
    <! [email protected] -->

    I found the images here: https://support.mozilla.org/en-US/questions/977542#answer-501598

  • Alternative of Describe command in DB2 Database

    Hi
    Mates
    Recently i have been shifted from Oracle9i to IBM DB2 Database.The first and foremost thing i want to know from u Gurus is ..Wats the substitute of Describe command of Oracle Sql in DB2 becoz i tried number of times using Desc <Tablename>, but each and every time it throws an error message.
    In addition to this if nebody knows ne web site which will help me to learn the basics of Db2 Database then plz put it down in ur reply.
    Ur help id highly appreciated & expected too.
    Thanks
    Vineet

    hi,
    I wonder what kind of logic makes you ask a DB2 question on the Oracle Database General Forum.
    I strongly suggest you to try on a DB2 forum.
    or try to get lucky here:
    http://www.google.be/search?hl=en&q=DB2+describe+tables&btnG=Search&meta=
    The first hits looks very good for me

  • SQL Command problem in Application Express 3.2.0.00.27

    To Oracle Application Express Development Team,
    Yesterday I installed Oracle Application Express 3.2.0.00.27.
    While doing my r&d, I came across one problem in SQL Command.
    For example I wanted to run sql "select * from tab"
    When I checked "Autocommit" checkbox it worked fine.
    But when I unchecked the "Autocommit" checkbox it gave me following error:
    ORA-01003: no statement parsed
    Please check post
    http://www.oraclebrains.com/2009/03/sql-command-problem-in-application-express-3200027/ for more details.
    Cheers

    I can't find the log file (a good indication that something went wrong)
    Here's the transcript of the session...
    SQL> startup upgrade
    ORACLE instance started.
    Total System Global Area 599785472 bytes
    Fixed Size 1288820 bytes
    Variable Size 264242572 bytes
    Database Buffers 331350016 bytes
    Redo Buffers 2904064 bytes
    Database mounted.
    Database opened.
    SQL> @apxpatch.sql
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Wrote file apxset.sql
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    SQL>
    SQL> @apxldimg.sql
    PL/SQL procedure successfully completed.
    Enter value for 1: C:\Documents and Settings\jtench\Desktop\My Downloads\Oracle\apex_3.2.1
    old 1: create directory APEX_IMAGES as '&1/apex/images'
    new 1: create directory APEX_IMAGES as 'C:\Documents and Settings\jtench\Desktop\My Downloads\Oracle\apex_3.2.1/apex/images'
    Directory created.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    Commit complete.
    timing for: Load Images
    Elapsed: 00:03:30.03
    Directory dropped.
    SQL>

  • ICloud, Calendar, and app store unresponsive. What can I do? (This is a second attempt to describe my problem(s); the first was very unclear).

    After upgrade to 10.9.1, iCloud, Calendar, and app store are  unresponsive. What can I do? (This is a second attempt to describe my problem(s); the first was very unclear).
    - Clicking Calendar brings up nothing but the banner "moving calendar to server account", a message that does not change.
    - Clecking the App Store (dock symbol or Application list) brings up a message: "Cannot connect to App Store".
    - Softare Update is unresponsive.

    Hello Wyodor,
    thanks for your reply on my question.
    You are wright the index file is 308 KB.
    And offcourse that I delete my files and documents is not an Iweb problem, but because my English is not that good, that I thougt I try to tell the whole story, and hope people can read trough the lines.
    Why I didn't use Iweb to upload to the server is because the server company recommanded to use file zilla. And I am a nobody with this kind of things, so I did exactly what they tell me to do.
    No, i did not make a backup of Iweb and the domain file, but reading other messages on this forum showed me that I can maybe try to make empty the cashfile (?)
    and otherwise I have bad luck and have to make my website again. Offcourse I have a lot of examples from all the pages (copied from the local map to my USB stick) and my website is aprox. 15 Mb, (not so big) so it will cost me a few nigths.
    But I'm still hoping on a miracle :-)
    greetings Lasource

  • DESCRIBE command

    Hi
    I am using oracle 10g and facing this problem. I want to overcome this problem.
    desc empName Null? Type
    empno not null number
    The name column is too long so that I have to move a cursor long time to right side.
    what changes should i made to display my describe table command to look like as follows: Permantely
    desc empName Null? Type
    empno not null number
    Thnx.

    Unfortunately this is a limitation of SQL*Plus - DESCRIBE helpfully expands to fit linesize which it presumably thinks you have set to match your terminal, even though
    1. You may have set a larger linesize to fit a wide report, and
    2. Since we are not restricted to 80 character dumb terminals any more we often use a much larger size
    and DESC output becomes hard to read.
    I'm not aware of any settings that allow you to adjust DESC output width independently of LINESIZE (the manual says "To control the width of the data displayed, use the SET LINESIZE command.")
    I use a script called desc.sql which contains:
    set term off
    store set sqlplus_settings.sql replace
    set lines 80 term on
    set define "&"
    desc &1
    undef 1
    set term off
    @sqlplus_settings.sql
    host del sqlplus_settings.sql
    set term on(Windows version - adjust for *nix.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Describe Command error

    Hi all,
    I've a P4/2.8ghz ht /512MB ram / 80 gb machine running on windows XP prof with service pack2 .
    When i start oracle 9i sqlplusw and type the command describe emp twice i get a memory read error and sqlpus crashes.. would do i resolve or identity the problem.
    regards
    Charles

    What happens if you run something else like for e.g. select or any dml statement. If the problem exists with any sqlplus operation then i would reccommend reinstalling oracle binaries. Also check your other applications. If there is no problem with them, that means its not a resource problem and there is some problem with your oracle binaries. All the best.
    Thanks,
    http://askyogesh.com

  • PL/SQL Procedure Calling Java Host Command Problem

    This is my first post to this forum so I hope I have chosen the correct one for my problem. I have copied a java procedure to call Unix OS commands from within a PL/SQL procedure. This java works well for some OS commands (Eg ls -la) however it fails when I call others (eg env). Can anyone please give me some help or pointers?
    The java is owned by sys and it looks like this
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ExecCmd" AS
    //ExecCmd.java
    import java.io.*;
    import java.util.*;
    //import java.util.ArrayList;
    public class ExecCmd {
    static public String[] runCommand(String cmd)
    throws IOException {
    // set up list to capture command output lines
    ArrayList list = new ArrayList();
    // start command running
    System.out.println("OS Command is: "+cmd);
    Process proc = Runtime.getRuntime().exec(cmd);
    // get command's output stream and
    // put a buffered reader input stream on it
    InputStream istr = proc.getInputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(istr));
    // read output lines from command
    String str;
    while ((str = br.readLine()) != null)
    list.add(str);
    // wait for command to terminate
    try {
    proc.waitFor();
    catch (InterruptedException e) {
    System.err.println("process was interrupted");
    // check its exit value
    if (proc.exitValue() != 0)
    System.err.println("exit value was non-zero: "+proc.exitValue());
    // close stream
    br.close();
    // return list of strings to caller
    return (String[])list.toArray(new String[0]);
    public static void main(String args[]) throws IOException {
    try {
    // run a command
    String outlist[] = runCommand(args[0]);
    for (int i = 0; i < outlist.length; i++)
    System.out.println(outlist);
    catch (IOException e) {
    System.err.println(e);
    The PL/SQL looks like so:
    CREATE or REPLACE PROCEDURE RunExecCmd(Command IN STRING) AS
    LANGUAGE JAVA NAME 'ExecCmd.main(java.lang.String[])';
    I have granted the following permissions to a user who wishes to run the code:
    drop public synonym RunExecCmd
    create public synonym RunExecCmd for RunExecCmd
    grant execute on RunExecCmd to FRED
    grant javasyspriv to FRED;
    Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/bin/env','execute');
    commit
    Execute dbms_java.grant_permission('FRED','java.io.FilePermission','/opt/oracle/live/9.0.1/dbs/*','read, write, execute');
    commit
    The following test harness has been used:
    Set Serverout On size 1000000;
    call dbms_java.set_output(1000000);
    execute RunExecCmd('/bin/ls -la');
    execute RunExecCmd('/bin/env');
    The output is as follows:
    SQL> Set Serverout On size 1000000;
    SQL> call dbms_java.set_output(1000000);
    Call completed.
    SQL> execute RunExecCmd('/bin/ls -la');
    OS Command is: /bin/ls -la
    total 16522
    drwxrwxr-x 2 ora9sys dba 1024 Oct 18 09:46 .
    drwxrwxr-x 53 ora9sys dba 1024 Aug 13 09:09 ..
    -rw-r--r-- 1 ora9sys dba 40 Sep 3 11:35 afiedt.buf
    -rw-r--r-- 1 ora9sys dba 51 Sep 3 09:52 bern1.sql
    PL/SQL procedure successfully completed.
    SQL> execute RunExecCmd('/bin/env');
    OS Command is: /bin/env
    exit value was non-zero: 127
    PL/SQL procedure successfully completed.
    Both commands do work when called from the OS command line.
    Any help or assistance would be really appreciated.
    Regards,
    Bernard.

    Kamal,
    Thanks for that. I have tried to use getErrorStream and it does give me more info. It appears that some of the commands cannot be found. I suspected that this was the case but I am not sure about how this can be as they all appear to reside in the same directory with the same permissions.
    What is more confusing is output like so:
    SQL> Set Serverout On size 1000000;
    SQL> call dbms_java.set_output(1000000);
    Call completed.
    SQL> execute RunExecCmd('/usr/bin/id');
    OS Command is: /usr/bin/id
    exit value was non-zero: 1
    id: invalid user name: ""
    PL/SQL procedure successfully completed.
    SQL> execute RunExecCmd('/usr/bin/which id');
    OS Command is: /usr/bin/which id
    /usr/bin/id
    PL/SQL procedure successfully completed.
    Regards,
    Bernard

  • Custom command problems on Mac OS X

    I am seeing a problem with custom context commands in our custom connector that is also reproducible with the sample FTP connector shipped with the SDK.  I am using Adobe Drive 3.2.0.41 on Mac OS X 10.8.2
    For my test I am connecting to a FTP server and attempting to run the "File Properties" command from a file's Adobe Drive menu in Finder.  When I first start Drive and connect, the command works and the "File Properties" dialog appears as expected.  However, if I disconnect, reconnect, then browse back to the file and attempt the command again, the File Properties dialog does not appear.  The Finder window does kind of "grey out" as if another dialog is about to be shown, but it never is. I don't see any kind of error messages in the CS5ServiceManager logs. 
    If I disconnect, close Drive, kill the AdobeDriveCS5 and CS5ServiceManager processes with Activity Monitor, and then restart Drive and reconnect, the custom commands work again.
    Has anyone else experienced these kinds of problems with custom commands on Mac OS after a disconnect/reconnect cycle?
    Thanks,
    Brian

    Our only other environment we could set up was on Mac OS 10.7.5, and we could not reproduce the issue.  Based on that it would appear to be something new with Mac OS 10.8.

  • Host Command Problems on 9i Unix

    I am using web froms 9i running on a Unix server with 9iasr2. I am trying to manipulate files on the server not the client. I have tried:
    host('rm -f /mypath/filename.txt')
    host('rm -f /mypath/filename.txt',NO_SCREEN)
    host('touch /mypath/filename.txt')
    host('touch /mypath/filename.txt', NO_SCREEN)
    host('mv /mypath/file1.txt /mypath/file2.txt')
    The file I am trying to delete is one that was transfered using the webutil file transfer.
    I have tried to check the status with:
    IF NOT Form_Success THEN
         Message('Error -- Message not sent.');
    ELSE
         Message('Message Sent.');
    END IF;
    I always get back 'Error...'
    The directories have permission open to everyone. Therefore I would of expected no problems with doing a touch to create a file.
    Any ideas?

    Thanks Ino. That was it, the full path for the unix command itself was missing. I knew it was something simple. =)

  • InDesign command problems

    I work with Adobe CS 5. Using Configurator 3, I have created a panel in InDesign for the commands I use most often. However, I have run into the following problems:
    Some commands (e.g., Margins and Columns or Span Columns and some others) give me only a split-second flash of (presumably) a dialogue box but then nothing more.
    Some commands don't ever respond.
    Some commands work at first, but then, if I edit or recreate the panel, some of the previously working commands (e.g., Insert Hair Space, Clear Overrides, and some others) simply
    stop working.
    Also, I have tried to use some Widgets, but they never show up (e.g., the horizontal rule or the rectangular container). No color adjustments seem to be available for the panel, and nothing adjusts automatically.
    Some commands that I find inside InDesign -- such as the Balance Columns or Unbalance Columns commands that should be available on the control panel -- don't show up in searches on either word.
    I can edit a panel and sometimes get some of the previously working functions back, by removing them and placing them again. But that doesn't work every time (and is annoying to have to do), and even this does not help the commands that have never responded or which only flash me and then are gone. Nor does completely trashing the original panel and recreating from scratch fix the latter condition, though sometimes when I do this, some of the commands that have occasionally worked will again work in the new panel. But usually, some others that worked previously, now won't.
    SUMMARY: It seems the commands that WILL work, won't work consistently. And the ones that never worked yet, never will.
    Configurator 3 seems to be a great idea -- I was very happy to find it the other day, and the presentation video I watched about its upgrades for CS6 seemed encouraging. But so far, it does not seem like an idea whose time has come ... unless there is something I'm doing wrong or some reason why some commands don't work in CS5. If this is the case, please let me know. I also use Photoshop extensively and wanted to create a panel for it, but I'm not going to bother if Configurator 3 is truly so inconsistent as it seems.
    Does anyone have any thoughts, advice or experience with the program along the above lines?

    I'm sorry to hear that. If possible, could you send you panel to [email protected]? I will have a look.
    Do you make sure that you selected InDesign CS5/CS5.5 when creating panel for InDesign CS5?

  • Tux Commander Problem

    Hi,
    i have a problem with tux commander, while browsing my system directories works just fine, whenever i try to click on the application menus i get an error that says:
    An Unhandled exception has occured
    invalid floating point operation
    and my entire desktop locks. I use GNOME if that helps and i installed tuxcmd from community version 0.5.70-1.
    Can anyone help?

    I'm running LXDE with openbox.
    Same error (i think) with doublecmd-git from AUR when clicked on configuration - options:
    [eee@701 ~]$ doublecmd
    Start watching
    [WARNING] Out of OEM specific VK codes, changing to unassigned
    [WARNING] Out of unassigned VK codes, assigning $FF
    Double Commander 0.4.6 alpha
    Revision: 2753M
    Build: 2010/04/26
    Lazarus: 0.9.29-23335
    Free Pascal: 2.4.0
    Platform: i386-Linux-gtk2
    This program is free software released under terms of GNU GPL 2
    (C)opyright 2006-2009 Koblov Alexander ([email protected])
    and contributors (see about dialog)
    Executable directory: /opt/doublecmd/
    Loading configuration...
    Loading icon theme DCTheme
    Theme hicolor not found.
    Creating TFileSystemFileSource
    TColumnsFileView.Create components
    TColumnsFileView.Create components
    frmMain.frmMainShow
    Language dir: /opt/doublecmd/language/
    TApplication.HandleException Access violation
    Stack trace:
    $B744A1FE
    $082AE9AC
    $081D997B
    $081D8BEA
    $0819796C
    $08197565
    $081984DA
    $08197A61
    $08197565
    $081984DA
    $08196601
    $08273985
    $0823FB2E
    $0823EEDC
    $0823EE4F
    $08197565
    $081984DA
    frmMain.Destroy
    Destroying TFileSystemFileSource when refcount=0
    WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?
    [eee@701 ~]$

  • Jdk1.2.2 java commands problem on win98, win2000 and XP

    To Whom It May Concern:
    I have just bought a new PC and made 3 partitions on the hard drive, each of them has 10G space, to installed 3 operation systems on each of these partitions, win98se, win2000 and XP. Then I installed jdk1.2.2 on each of these operation systems. However, when I go into the �\jdk1.2.2\bin directory and run the executable commands, eg. javac and java etc., get the following different error messages on different operating systems. I have spent a lot of time on trying to fix these problems, however, no any luck. It will be very appreciated if you super expert can have some help on them.
    win98se
    After run the javac command, get the following error message displayed on a prompt with a Close and a Details buttons.
    This program has performed an illegal operation and will be shut down.
    If the problem persists, contact the program verdor.
    After click the Details button, get the following message:
    JAVA caused an invalid page fault in
    module SYMCJIT.DLL at 019f:500bf974.
    Registers:
    EAX=00000e03 CS=019f EIP=500bf974 EFLGS=00010206
    EBX=006539a0 SS=01a7 ESP=0063f894 EBP=00000e7f
    ECX=0000009f DS=01a7 ESI=00000e7f FS=3557
    EDX=00000003 ES=01a7 EDI=05110010 GS=0000
    Bytes at CS:EIP:
    f3 a5 ff 24 95 48 42 0c 50 8d 49 00 8d 74 31 fc
    Stack dump:
    500bf8c7 0000027f 500c42b0 5007cc24 05110010 00000e7f 0000027f 007608c0 00000283 006a81a8 006539a0 0063f940 006539e8 05110010 006539a0 00000e7f
    win2000
    After run the javac command, get the following error message displayed on a prompt with a OK button.
    java.exe has generated errors and will be closed by Windows. You will need to restart the program.
    An error log is being created.
    XP
    After run the javac command, get the following error message displayed on a prompt with a Send Error Report and Don't Send buttons.
    java.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
    If you were in the middle of something, the informaiton you were working on might be lost.
    Please tell Micorsoft about this problem.
    We have created an error report that you can send to us. We will treat this report as confidential and enonymous.
    To see what this error report contains, click here.
    thanks and regards!
    ZhiCheng

    http://java-virtual-machine.net/tech-faq.html
    is a great link.
    It claims to have a newer, fixed version of problem DLL, SYMCJIT.DLL . Try that.
    The page has an Intel link that is out-of -date. The current Intel link is
    http://support.intel.com/support/processors/pentium4/sb/CS-007990.htm
    "CPUID detection for Intel� Pentium� 4 processor system"
    In two lines, they recommend:
    dir /s SYMCJIT.DLL
    ren SYMCJIT.DLL SYMCJIT.OLD
    Of course, Java will run slower, but JIT is a machine-specific concept and this *.DLL was coded to fail if it did not recognize the CPU type. Maybe not a great decision, but there you are.

Maybe you are looking for

  • Lack of replies in this section

    I'm some of you thread authors are noticing that you are getting no or very few replies from other people in the forum. I'm bringing to your attention that you are not giving enough information when you post a problem. I refer you to Rules of the For

  • URGENT - HELP ME! Kernel Panic MacBook Pro Mac OX X v10.7.5

    Please HELP ME! I am having this kernel panic three/four times per day on my laptop! I don't know what to do, it never happened before and i don't understand why it's starting now! any way to fix it?? Interval Since Last Panic Report:  2381880 sec Pa

  • H.264 not playing in Windows Media Player

    OK, so I've exported a 720p video to H.264 format. The resultant .mp4 plays just fine on my Mac where it was created, in both QuickTime and the VLC Player. It also plays on another person's Mac (I'm assuming QuickTime) just fine. But two people who h

  • My wish list doesn't have an option to buy?

    I don't have an option to 'buy' against one or more items in my wish list.  I can share, gift etc but not actually buy..anyone else had the same problem?

  • Provide me with a simple tar file

    I have just started prepairing for Weblogic Admin Cert Exam. I am using Weblogic Server 10 on Red Hat Linux. Can someone please provide me with a simple tar/gz file which I can deploy using the weblogic console and see how weblogic works (i am not a