Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    6

    Unhappy Unanswered: Pro*C compile problem

    Hi All,

    i'm trying to comile this simple code on Linux m/c
    I get errors regarding varables not defined....

    *************Code********************************* ******
    #include "./sqlca.h"
    #include "./oraca.h"
    #include "./sqlcpr.h"

    EXEC SQL BEGIN DECLARE SECTION;
    char dbid[] = "myid/pass@mystr";
    int limit;
    EXEC SQL END DECLARE SECTION;

    main()
    {
    char tbl_CustomerMaster[] = "TBL_CUSTOMERMASTER\0";
    EXEC SQL CONNECT :dbid;

    EXEC SQL SELECT COUNT(*) INTO :limit FROM tbl_CustomerMaster;

    printf("\n %d ",limit);
    }

    ************************Errors******************** ***
    Pro*C/C++: Release 8.1.7.0.0 - Production on Fri Apr 16 14:24:13 2004

    (c) Copyright 2000 Oracle Corporation. All rights reserved.

    System default option values taken from: /u01/oracle/product/8.1.7/precomp/admin/pcscfg.cfg

    Error at line 16, column 2 in file count.pc
    EXEC SQL SELECT COUNT(*) INTO :limit FROM tbl_CustomerMaster;
    .1
    PLS-S-00201, identifier 'TBL_CUSTOMERMASTER' must be declared
    Error at line 16, column 2 in file count.pc
    EXEC SQL SELECT COUNT(*) INTO :limit FROM tbl_CustomerMaster;
    .1
    PLS-S-00000, SQL Statement ignored
    Semantic error at line 16, column 2, file count.pc:
    EXEC SQL SELECT COUNT(*) INTO :limit FROM tbl_CustomerMaster;
    .1
    PCC-S-02346, PL/SQL found semantic errors
    ************************************************** ********************

    It says TBL_CUSTOMERMASTER is not defined where as it has been defined and also exists in DB.

    any help will be appriciated.

    regards
    Kuldeep

  2. #2
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Re: Pro*C compile problem

    If the table exists in the database check that myid has access to select from it. I would suspect that this grant is missing.

    HIH

  3. #3
    Join Date
    Apr 2004
    Posts
    6

    Re: Pro*C compile problem

    Originally posted by carloa
    If the table exists in the database check that myid has access to select from it. I would suspect that this grant is missing.

    HIH
    Thanks for your reply...

    now i have given all the privilages to myid, but still same error...... that table identifier must be declared.....

    any idea why this problem occuring..... i'm frustrated coz of it and totally stuck up.....

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    go to http://asktom.oracle.com
    do a keyword search on "Pro*C"
    He has many examples of working code there.
    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 2003
    Location
    NY
    Posts
    208

    Pro*C compile problem

    Does myid own the table TBL_CUSTOMERMASTER. If not, and there is no public synonym, you will need to preface the tablename with the schema name. Ie if the table is owned by PROD then your could should be using table PROD.TBL_CUSTOMERMASTER.

    Before embedding the SQL code into Pro C, test all your commands in Sql-Plus to ensure you have them correct, and the necessary privileges are there.

    HIH

Posting Permissions

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