Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    12

    Unanswered: To retrieve the metadata of prepared statement parameter using OCI calls.

    Hi All,
    I am using Oracle 10g release2.
    To execute Insert statement function OCIStmtPrepare() is used.
    e.g "INSERT INTO BulkInsertTable(IndexName) VALUES(:M)".
    Now, I want to get the metadata(say its datatype, length, etc) of column IndexName or of place holder :M programatically. Is there any such method in OCI? Can OCIParamGet() function be of any help for the above said problem.
    Need help to proceed further.

    Thanks and regards
    ftil555

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
    SQL> desc all_tab_columns
     Name					   Null?    Type
     ----------------------------------------- -------- ----------------------------
     OWNER					   NOT NULL VARCHAR2(30)
     TABLE_NAME				   NOT NULL VARCHAR2(30)
     COLUMN_NAME				   NOT NULL VARCHAR2(30)
     DATA_TYPE					    VARCHAR2(106)
     DATA_TYPE_MOD					    VARCHAR2(3)
     DATA_TYPE_OWNER				    VARCHAR2(30)
     DATA_LENGTH				   NOT NULL NUMBER
     DATA_PRECISION 				    NUMBER
     DATA_SCALE					    NUMBER
     NULLABLE					    VARCHAR2(1)
     COLUMN_ID					    NUMBER
     DEFAULT_LENGTH 				    NUMBER
     DATA_DEFAULT					    LONG
     NUM_DISTINCT					    NUMBER
     LOW_VALUE					    RAW(32)
     HIGH_VALUE					    RAW(32)
     DENSITY					    NUMBER
     NUM_NULLS					    NUMBER
     NUM_BUCKETS					    NUMBER
     LAST_ANALYZED					    DATE
     SAMPLE_SIZE					    NUMBER
     CHARACTER_SET_NAME				    VARCHAR2(44)
     CHAR_COL_DECL_LENGTH				    NUMBER
     GLOBAL_STATS					    VARCHAR2(3)
     USER_STATS					    VARCHAR2(3)
     AVG_COL_LEN					    NUMBER
     CHAR_LENGTH					    NUMBER
     CHAR_USED					    VARCHAR2(1)
     V80_FMT_IMAGE					    VARCHAR2(3)
     DATA_UPGRADED					    VARCHAR2(3)
     HISTOGRAM					    VARCHAR2(15)
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2009
    Posts
    12
    How is that helpful in my case? Can you please throw some light on this?

    Thanks
    ftil555

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >How is that helpful in my case? Can you please throw some light on this?
    >Now, I want to get the metadata(say its datatype, length, etc) of column IndexName
    Code:
     COLUMN_NAME				   NOT NULL VARCHAR2(30)
     DATA_TYPE					    VARCHAR2(106)
     DATA_LENGTH				   NOT NULL NUMBER
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Apr 2009
    Posts
    12
    Hi,

    Thanks for your quick reply. In this case (as suggested by you), I will have to fire a select statement to the server then I can have the metadata of the column. This is not what I was looking for.

    I simply want the metadata of parameter of prepared statement (say of :m) using an OCI call(The metadata can be in SQLT type or typecodes).

    Thanks
    ftil555

  6. #6
    Join Date
    Apr 2009
    Posts
    12
    I haven't yet got any answer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •