August 8th, 2003, 01:32 AM
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???????
August 8th, 2003, 09:36 AM
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?
PostgreSQL, it's what's for dinner...
August 11th, 2003, 02:22 AM
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??
waiting for the reply
August 11th, 2003, 08:53 AM
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.
August 12th, 2003, 04:48 AM
kalanjali=> \d archive_special_catgory
Did not find any relation named "archive_special_catgory".
kalanjali=> \d archive_special_category;
Column | Type |
num_splcatarc_slno | integer | not null default nextval(
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:::::::::
August 12th, 2003, 08:42 AM
ok, these are the variables I took cut_n_paste from your first post:
these are the vars from your table:
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...
August 12th, 2003, 08:56 AM
the tables are diff table and for the both the tables it is getting
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 ?????
August 12th, 2003, 09:14 AM
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.