[req] How to check if given oracle table exist or no + c#

Hello
All.

Actually I m creating a program using c# that connects to the database (oracle) and checks the table given 'OPC_GROUP '. If the table does not exist, then it creates the table otherwise it updates all the field with values provided

code

cmd.CommandText = "SELECT tNom tab where tNom ="OPC_GROUP "";

cmd.CommandType = CommandType.Text;
int length is cmd. ExecuteNonQuery());
If (cmd. ExecuteNonQuery()) > 0)
{
MessageBox.Show ("Table exists");
}
on the other
MessageBox.Show ("Table does not exist");



But this return code "TABLE DOESN'T EXIST" even if the table is already created

What I m hurt?

Help, please...

Thnx in advance

Try this...

cmd.CommandText = "SELECT count (*) tab where tNom ="OPC_GROUP "";

cmd.CommandType = CommandType.Text;
String STRID = cmd. ExecuteScalar(). ToString();
If (STRID! = '0')
{
MessageBox.Show ("Table exists");
}
on the other
MessageBox.Show ("Table does not exist");

It will be useful,
Greg

Tags: Database

Similar Questions

  • How to check for optional Oracle 10 g 2 installed components?

    Hello

    How can I get a list of oracle all optional components/functions installed database (some of them may require additional license)? I was going through a list of the directory objects in a database and I spotted "ORACLE_OCM_CONFIG_DIR" in one of the databases (others don't have it). When I checked, it turned out to be a directory required for Oracle Configuration Manager (it's maybe even a completely separate installation).

    I have to configure a new oracle database server where I have to install everything that is installed on an existing one.

    Oracle 10 g 2 - RHEL 5.8

    Please advise!

    Best regards

    Hello

    http://docs.Oracle.com/CD/E11882_01/server.112/e24448/statviews_4208.htm

    DBA_REGISTRY displays information about all of the components in the database that are loaded in the registry of the component.

    If this view lists the components loaded into the database... Well according to the docs of Oracle anyway.

    How to check to see if the CMO is installed must:

    http://docs.Oracle.com/CD/E12482_01/doc.103/e12481/ccrqs.htm

    Navigate to the ccr/bin directory and locate the emCCR file. If emCCR exists, the CMO has been configured.

    Don't think that you can get this information from a view.

  • How dermine if one a DB Table exist or not exist?

    That is the question, I need determine if a 'X' DB Table exists, if the table is to run a 'Y' VI, if it not exist, create it and determine its column properties...

    If the Table exists go to TRUE and make the next step, if the Table doesn't exist pass false and.

    I want is to know how to determine if the table exists or does not exist because if I make tha code in the current image and the Table exists VI showme error, if the Table exists, avoid the code, then continue with the normal process, and I want to avoid this problem.

    I have some ideas to solve this the most logical problem is to use the DB tables.VI list but how I can change the result of a Boolean check (this is to select the case in the picture).

    Close!

  • How canI check the installed Oracle software architecture?

    Is there a way to check if I have 32-bit or 64-bit version of the Oracle software of in Oracle?

    I want the script in a check to see if the Oracle Home where this database is running is 32-bit or 64-bit. There is not enough good to check the architecture of the BONES, as some systems I have 64-bit OS but a combination of houses Oracle 32-bit and 64-bit.

    I watched parameter $ v and found nothing directly. SELECT platform_name v database $ shows architecture, but it works only on 10g and, possibly, 9i. On 8i, I can't find any similar columns.

    Select * from v$ version also indicates whether or not a system is 64-bit (32-bit only shows no banner string to indicate 32 - bit)

    But the two methods above are a bit vague: I don't know if they are simply greping the architecture of the operating system or if they are examing the oracle binary?

    finite9 wrote:
    Is there a way to check if I have 32-bit or 64-bit version of the Oracle software of in Oracle?

    Came to $ORACLE_HOME/bin and run
    Oracle file

    On the database, check session of v$, if saddr columns is raw (4), db is 32 bits (4 * 8), if it is raw (8), db is 64 bits (8 * 8).

    Nicolas.

  • How to load data from Oracle tables into essbase?


    Hello

    I'm fairly new to essbase. We are working on essbase 11.1.2.2.

    I want to build size & load data using pre-existing data warehouse which is built on Oracle.

    I try to use "Open SQL". I use OIC.  It is gicing me connection error (1021001).

    The following log shows:

    [Sea 14 Aug 14:15:06 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Info (1021097)
    EssOCI Initializes the connection to the Oracle database on the server [tmdwtst1]

    [Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Info (1021099)
    EssOCI could not connect to the Oracle database with error message [ORA-12154: TNS: could not resolve the connect identifier specified]
    ]

    [Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Error (1021001)
    Cannot establish a connection to the SQL database server.  See the log for more information

    [Sea 14 Aug 14:15:25 2013] Local/SA_EB_1/MIS_FIN/SA0053580@Native Directory/10868/Warning (1080014)
    Transaction [0 x 2650001 (0x520b4392.0x69b68)] abandoned due to the State [1021001].

    Help, please.

    Thank you

    Sam

    You use the correct format for the OIC:

    Host: port / Oracle_service_name

    See you soon

    John

    http://John-Goodwin.blogspot.com/

  • How to find if a table exists in a particular backup?

    Hi Experts,

    How to find if a particular table exists in a specific export dump file? and also is it possible to find the same RMAN backup?

    Thank you

    Hello

    Sorry, above is not possible. My bad,

    You can use below,

    Impdp directory = 'EXPDP"dumpfile = scott.dmp sqlfile = happy test.sql = metadata_only

    and the test.sql contain instructions ddl for tables in the dumpfile.

    Tested on 11.2.0.4

  • How to check the table have are all views in oracle

    Hello
    How to check the table have are all views in oracle
    SELECT * FROM user_dependencies
    WHERE type='VIEW'
    AND referenced_type='TABLE'
    AND referenced_name ='Your_Table_Name' 
    

    You can use dba_dependencies to find views in the different schema.

  • How to check the value of the space of the tablespaces and tables when errors occur?

    Hi Experts,

    For example, lets say we get ORA-01653: unable to extend table of error. How to check the size of the table and a tablespace? And how understanding is full?

    Thanks for your help

    Hello

    Select df.tablespace_name "Tablespace"

    totalusedspace 'Used MB',

    (df.totalspace - tu.totalusedspace) "MB free.

    DF. TotalSpace 'Total MB. "

    round (100 * ((df.totalspace-tu.totalusedspace) / df.totalspace))

    "PCT free."

    Of

    (select nom_tablespace,

    Round (Sum (bytes) / 1048576) TotalSpace

    from dba_data_files

    Group by tablespace_name) df,.

    (select round (sum (bytes) /(1024*1024)) totalusedspace, nom_tablespace)

    from dba_segments

    you group by tablespace_name)

    where df.tablespace_name = tu.tablespace_name

    and df.tablespace_name = "";

    For example, lets say we get ORA-01653: unable to extend table of error. How to check the size of the table and a tablespace? And how understanding is full?

    Is to say clearly to the question (you can let us know what you have understood so we can fix)

    [oracle@machine1 ~] $01653 oerr ora

    01653, 00000, "impossible to extend %s.%s table by %s in %s tablespace»

    * Cause: Failed to allocate a certain measure the required number of blocks for

    a segment of the table in the specified tablespace.

    * Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more

    storage of files indicate.

    -Thank you

    Pavan Kumar N

  • How to check if a table exists in the database or not?

    People,

    Hello. I use the server of Oracle 11 GR 1 material with Oracle Linux 5 database.

    My instance of database is named HRCS90, which the user access Id is MyName, and his identification of user SYS system.

    I have a few questions about user ID to access the PSRECDEL and PSROLEDEFN table in the HRCS90 database as below:

    SQL > select * from PSRECDEL;

    His output under the SYS user: table or view does not exist.

    His output under user myName: no selected lines. This means that the table THAT PSRECDEL exists, and myName user can access.

    SQL > select * from PSROLEDEFN;

    His output under SYS and MyName: table or view does not exist.

    My questions are:

    How to check if a table really exists in the instance of database HRCS90 or not?

    Thanks in advance.


    If a table is present in the database, it must be present in DBA_OBJECTS. If he fell, he would be present in the TRASH. If he fell purged, it is not available in the database, Cant it confirm you this object is not in the database? See a little test here

    SQL > CREATE TABLE TESTTAB (ID);

    Table created.

    SQL >

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB.

    OBJECT_NAME OWNER

    ------------------------------ ---------------------------------------------

    SCOTT TESTTAB

    SQL >

    -Drop table (without purging. So now, it will be in the recyclebin)

    SQL > DROP TABLE TESTTAB;

    Deleted table.

    SQL >

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    OBJECT_NAME ORIGINAL_NAME OWNER

    ------------------------------ ------------------------------ --------------

    SCOTT BIN$ 8LKloIv3SYWA0WJ33GS + Aw == $0 TESTTAB

    Now see this case when you use PURGE. If it won't move the table to the trash. First of all I am clear the existing dba_recyclebin to the user entries. Then I'm falling table using purge.

    SQL > PURGE TABLESPACE USERS USER SCOTT.

    Purged tablespace.

    SQL >

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    no selected line

    SQL > CREATE TABLE TESTTAB (ID);

    Table created.

    SQL >

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB;

    OBJECT_NAME OWNER

    ------   ----------

    SYS TESTTAB

    SQL > DROP TABLE TESTTAB PURGE;

    Deleted table.

    SQL > SELECT * FROM DBA_RECYCLEBIN WHERE ORIGINAL_NAME = "TESTTAB;

    no selected line

    SQL > SELECT MASTER, OBJECT_NAME FROM DBA_OBJECTS WHERE OBJECT_NAME = 'TESTTAB;

    no selected line

    Since there is no entry to both DBA_OBJECTS and DBA_RECYCLEBIN. So that means that the particular object is not in the database.

  • How to check if you have installed Oracle Wallet

    Hi all

    11.2.0.3.8

    I inherited this database.

    I check the sqlnet.ora and I see the oracle wallet folder path here.

    But I do not know if the portfolio has been installed and configured or installation. And I don't know the password to open the database of portfolio with it.

    Can you help me how to check if the portfolio is installed? Is there a data dict views for her?

    Thank you

    pK

    As you can check sqlnet.ora, I guess you can also consult other parts of the file system, if you see if there is a portfolio at the location given (by the sqlnet.ora)?

    A more graphical approach could use owm (Oracle Wallet Manager).

    However we need the password in the portfolio, if you want to do something with this portfolio.

  • How to check the status of the statistics on a table?

    Hello
    I started the statistics collection on a few large tables in my database.
    How to check the status of statistics about a table? Are there views of data dictionary or tables to monitor the progress of the collection of statistics.


    Regds,
    Malika

    Hi all

    You can check with this little script.
    It lists details of sid for long as running session
    When he started
    What last update
    How long still to the left
    "ACTIVE/INACTIVE" session state etc.

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    -Author: James Syed_
    -Script_name: sid_long_ops.sql
    -Description: list details of sid for long running the session as when it began when the last update how long still to the left.

    fixed lines 200
    Neck LESS to a25

    Select
    a.SID,
    a.Serial #.
    b.Status,
    a.opname,
    TO_CHAR (a.START_TIME,' DD-me-AAAA HH24:mi:ss) START_TIME,
    TO_CHAR (a.LAST_UPDATE_TIME,' DD-me-AAAA HH24:mi:ss) LAST_UPDATE_TIME,.
    a.time_remaining as 'time remaining dry. "
    a.time_remaining/60 as "Min remaining time."
    a.time_remaining/60/60 as 'remaining time in HR.
    V $ session_longops a, v$ session b
    where = select a.sid
    a.sid = & sid
    And time_remaining > 0;

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------

    The sample output:
    --------------------

    SQL > @sid_long_ops
    Enter the SID value: 474
    13 old: a.sid = & sid
    13 News: and a.sid = 474

    SID, SERIAL # STATUS START_TIME LAST_UPDATE_TIME remaining time LESS dry time remaining minutes remaining HR time
    --------------------------------
    474 2033 ACTIVE collection schema statistics June 6, 2012 20:10:49 June 7, 2012 01:35:24 572 9.53333333.158888889

    Thank you & best regards

    Syed James.
    Oracle Apps DBA
    Mobile: + 91 9966270072
    E-mail: [email protected]

  • How to check that all the options enabled in Oracle Database EE

    Hello

    I'm new on OTN.

    How to check that all the options enabled in Oracle Database EE?

    Thank you
    Vincent

    Hello

    Select decode(detected_usages,0,2,1) nop,
    name, version, detected_usages, currently_used,
    to_char(first_usage_date,'DD/mm/YYYY') first_usage_date,
    to_char(last_usage_date,'DD/mm/YYYY') last_usage_date
    of dba_feature_usage_statistics
    order by nop, 1, 2
    Or

    v$ option view

    Thank you
    LaserSoft

  • How to check the internal operations, Manager of competitor status in Oracle Apps R12 of en

    Step by step how to check the internal operations, Manager of competitor status in Oracle Apps R12 of front end and how to start their.

    Richa says:
    Step by step how to check the internal operations, Manager of competitor status in Oracle Apps R12 from front end

    Simultaneous treatment - platform generic competitor Manager Questions / answers [ID 105133.1]

    and how to start the

    (1) using the adcmctl.sh (from the backend)
    (2) using the button Activate (from front) - http://docs.oracle.com/cd/E18727_01/doc.121/e12893/T174296T174302.htm#4334248

    Thank you
    Hussein

  • How to check the index, on the number of columns in the table is created

    How to check on the number of columns in the table the index has been created. ??

    OR

    How check index, on the number of columns in the table that it is been created?

    890306 wrote:
    How to check on the number of columns in the table the index has been created. ??

    >

    OR

    How check index, on the number of columns in the table that it is been created?

    query USER_IND_COLUMNS

    SQL> desc user_ind_columns
     Name                            Null?    Type
     ----------------------------------------- -------- ----------------------------
     INDEX_NAME                             VARCHAR2(30)
     TABLE_NAME                             VARCHAR2(30)
     COLUMN_NAME                             VARCHAR2(4000)
     COLUMN_POSITION                        NUMBER
     COLUMN_LENGTH                             NUMBER
     CHAR_LENGTH                             NUMBER
     DESCEND                             VARCHAR2(4)
    

    Handle: 890306
    Status level: Beginner
    Join date: October 8, 2011
    Messages total: 13
    Total Questions: 5 (5 open)

    Why all the question still pending?

    Published by: sb92075 on December 3, 2011 17:21

  • How to import the XML file into an oracle table using a BPEL process

    Hi friends

    How can I import XML file in the db oracle table using a BPEL process

    (1) I have generated an XML file in my local system with a field
    (2) I created a temporary table in my oracledb with the same field in the XML file
    (3) that I want to import these XML files which is the local host to my db oracle using a BPEL process
    (4) for that what steps should I me fallow please suggest me if there is no document for this?

    Thanks in advance
    AT

    Hi to

    Here you go...

    http://blogs.Oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html

    I hope that helps!

    Thank you
    AJ

Maybe you are looking for

  • I wrote this question: chrome 503420 question and it seems to affect Thunderbird only.

    This problem of chrome and they were the research seeks an answer.So far no joy. I haveI use a script for bookmarks chrome to send a link and when he turns open Thunderbird with To: / / / in the field.Don't know where it comes from or if it is import

  • Mail de Mac with Verizon email problem

    On my iMac running OS 10.6.8 I suddenly receive emails from verizon.  E-mail works fine on my MacBook with OS 10.9.4. Frequently, I'm unable to receive emails.  During this haplpens, I can still send email if I'm connected to the Internet. It is not

  • Acer ES 11 iso

    I have my partitions formatted and did backup not my operating system.  Please can someone tell where I can download the iso from the factory so that I can make a bootable usb drive to reinstall the windows operating system? Thank you Mark

  • 19 '' touch screen 380w RMS juke box on wheels

    Hi all I hope you can help I built a mobile jukebox and I adapted a button volume control on the face of it it works fine, I can see the master volume increase and falls in windows, but it is Windows media player 11 volume isn't controlled by the vol

  • How to clear the cache of the browser using the Blackberry API

    Hello Can someone help me. How to clear the browser cache? Is it have any API?