Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. primary key field

primary key field

Scheduled Pinned Locked Moved C / C++ / MFC
c++databaseoraclequestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Try
    wrote on last edited by
    #1

    Hi All, I am using VC++ 2003 and Oracle 10. I have created a table in Oracle. The table has ten fields including a primary key (field). Is there any function in VC++ to know the extracted field (from database) is primary key? I am using ODBC..

    L 1 Reply Last reply
    0
    • T Try

      Hi All, I am using VC++ 2003 and Oracle 10. I have created a table in Oracle. The table has ten fields including a primary key (field). Is there any function in VC++ to know the extracted field (from database) is primary key? I am using ODBC..

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Can't you just execute SQL command "DESCRIBE tablename"? -David Delaune

      D 1 Reply Last reply
      0
      • L Lost User

        Can't you just execute SQL command "DESCRIBE tablename"? -David Delaune

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        How would that work?

        "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        L 1 Reply Last reply
        0
        • D David Crow

          How would that work?

          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I have not used oracle in some years, I just remember there was a command 'DESCRIBE' table **Update** Found some old code! I think he can do this: SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME = "table" AND CONSTRAINT_TYPE = 'P';

          D 1 Reply Last reply
          0
          • L Lost User

            I have not used oracle in some years, I just remember there was a command 'DESCRIBE' table **Update** Found some old code! I think he can do this: SELECT CONSTRAINT_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME = "table" AND CONSTRAINT_TYPE = 'P';

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Randor wrote:

            I have not used oracle in some years, I just remember there was a command 'DESCRIBE' table

            True, but I couldn't find where it populated anything regarding a primary key.

            "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups