#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Chennai
    Posts
    160
    Rep Power
    11

    Angry attribute doesn't exits


    i am getting a problem when i try to insert in postgres

    "insert into special_category (var_splcat_name, var_splcat_desc, var_splcat_prodlist, dat_splcat_fmdate, dat_splcat_todate, dat_splcat_reminderdate, num_splcat_addedby ) values ('vbc', 'vb', '20in|Small|', '2003-08-25', '2003-
    08-26', '2003-08-28', '2');

    ERROR: Relation 'special_category' does not have attribute 'var_splcat_desc'"

    even if the field in the db is same

    i am facing this problem in postgres !!!!!!

    any one can help me???????
  2. #2
  3. Me likey breadsticks...
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jan 2003
    Location
    Los Angeles
    Posts
    1,189
    Rep Power
    18
    If you're sure it's spelled correctly, are you sure there aren't any capital letters in that field name? If so, you need to enclose it in double quotes. When you connect to your database in psql and do a \d special_category do you see your field listed?

    HTH,
    -b
    PostgreSQL, it's what's for dinner...
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Chennai
    Posts
    160
    Rep Power
    11

    Question still its is giving probs


    Warning: pg_query() query failed: ERROR: Relation 'archive_special_category' does not have attribute 'dat_splcatarc_todate' in /var/www/html/kalanjali/controlpanel/classes/clsSpecialCategory.php on line 269
    Insert into archive_special_category (var_splcatarc_name, var_splcatarc_desc, var_splcatarc_productlist, dat_splcatarc_fmdate, dat_splcatarc_todate, dat_splcatarc_reminderdate, num_splcatarc_addedby, num_splcatarc_archby, dat_splcatarc_archdate) values ('fg', 'gh', '|STMDBUD001', '2003-08-19', '2003-08-26', '2003-08-25', '2', '2', '2003-08-11')delete from special_categories where num_splcat_slno = '5'

    this is the error what i am getting.

    first time when i tried to insert the date format was wrong
    ie instaed of yyyy-mm-dd i gave diff format.

    second time i made it to yyyy-mm-dd format.
    whether in postgres if first time if it is wrong whther that filed is corrupted???????????
    after that i am not able to slect that filed in command promt also??

    plesae reply

    waiting for the reply

    chandar
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    373
    Rep Power
    11
    perhaps you could show what the table looks like from psql, by doing

    psql> \d special_category


    I know this was already mentioned I just wanted to show it more straightforward.

    you could try dumping the data using pg_dump then recreate the relation if you think that it is giving you problems because the "field was corrupted", although this is extremely unlikely. You may be running into some issues with date formatting, but that seems unlikely as well, most probably it is a spelling error or a single- or double-quotes issue.
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Chennai
    Posts
    160
    Rep Power
    11

    reply


    kalanjali=> \d archive_special_catgory
    Did not find any relation named "archive_special_catgory".
    kalanjali=> \d archive_special_category;
    Table "archive_special_category"
    Column | Type |
    Modifiers
    ----------------------------+------------------------+--------------------------
    -------------------------------------------
    num_splcatarc_slno | integer | not null default nextval(
    '"archive_speci_num_splcatarc_seq"'::text)
    var_splcatarc_name | character varying(100) |
    var_splcatarc_desc | character varying(50) |
    var_splcatarc_productlist | character varying(100) |
    dat_splcatarc_fmdate | date |
    dat_splcatarc_todate | date |
    dat_splcatarc_reminderdate | date |
    num_splcatarc_addedby | integer |
    num_splcatarc_archby | integer |
    dat_splcatarc_archdate | date |
    Unique keys: archive_speci_num_splcatarc_key

    this the table structure:::::::::

    chandar
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    373
    Rep Power
    11
    ok, these are the variables I took cut_n_paste from your first post:

    var_splcat_name
    var_splcat_desc
    var_splcat_prodlist
    dat_splcat_fmdate
    dat_splcat_todate
    dat_splcat_reminderdate
    num_splcat_addedby


    these are the vars from your table:

    num_splcatarc_slno
    var_splcatarc_name
    var_splcatarc_desc
    var_splcatarc_productlist
    dat_splcatarc_fmdate
    dat_splcatarc_todate
    dat_splcatarc_reminderdate
    num_splcatarc_addedby
    num_splcatarc_archby
    dat_splcatarc_archdate


    It's important that when you're stuck you relax, and take a good look at what you're coding. The scientific method can really help in these situations, and can especially work when you are frustrated or emotional about a problem. Also, you have to learn to look carefully at the queries that you're performing to assure that you're right on. That's why a lot of DBA's are jerks about letting db users perform ad-hoc queries on the database...
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Chennai
    Posts
    160
    Rep Power
    11

    Post the tables are diff table and for the both the tables it is getting


    hi

    the both the tables what u have highlighted are diff tables and for the two tables also it was giving problrm?????????


    so plzzz can u reply ?????
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    373
    Rep Power
    11
    back up, bud. what we want to do explicitly is look at the table that was originally giving you problems with the insert. Then we can say whether that table at least appears to be correct for the query you're trying to execute. Leave other tables out of it until you're sure of the first problem. From what I was looking at, it seemed that you got the names of the attributes confused when building the insert.

IMN logo majestic logo threadwatch logo seochat tools logo