Primary key in 11g - known problem 6894412 problem
Hello world:We are on JDeveloper 11.1.1.4 and JHeadstart 11.1.1.2.46. This thread was initially started on the JHeadstart forum and can be seen at: problem with 11 g LOV
We are converting our application of 10g and 11g. We have an established Oracle database that does not pre-filled primary keys that are the sequence number. Our database has composite keys and the integrity of these composite keys are established by foreign key constraints to edit tables. This approach has worked very well for us for more than a decade, the logic of the database has been designed so that the database protects itself through the elimination of cascading deletes, as appropriate, and cascade deletes as the precepts of business logic. This will not change.
In the tables of the database in which the application of 10g was posted in table format, after conversion to 11g, the pop - ups LOV don't work unless you have pressed the SAVE button (or refresh the browser). The first popup LOV will work, but as soon as you select a value in the it, pop ups LOV next will not run until the SAVE or REFRESH method is done. It is only in a tabular format. If the display format is form, our main work of LOV - keys very well. In 10g, this feature has worked as long as we use a button "Add a LINE" on a table format. The add a line button caused the primary key values be returned to the application, but may not display on the screen. A refresh would then show them.
Since the original investigation in the JHeadstart forum, I realize that we are hitting 'Primary keys of the model' 6894412 problem listed in the Release Notes 11.1.1.4. We spent many, many hours creating a reusable .jar file of all of the features of this very large database such as suggested by JDeveloper best practices (http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/bcadvgen007.htm). This has worked very well for set us in 10g - details of the entity in a place, once, and then each application can reuse. Productivity at its best. Therefore, we cannot make false columns in our database in order to correct this "limitation" in 11 g. We have several complex tables of child-parent/child to put in our application that will not work unless our entities have correctly defined primary keys. I tried to implement workaround was found in the release notes, but were unable to make it work.
I created a unit test with the HRSchema by adding a table to this pattern that I can provide the SQL commands, but I do not know in Oracle taking in charge of the to send to. Could someone provide me with information on who to contact please. I, I think, took all the measures contained in the release notes for this problem and have clearly documented the changes in the .jsff page, but the problem persists. Clearly, I do something wrong, or would like more information.
Thanks in advance
Mary
U
Hello
There is no "" one person in support to send it directly to. Apply you for Services using http://metalink.oracle.com/ report the problem and download your test scenario. Support then concludes the expert to analyze
Frank
Tags: Java
Similar Questions
-
When you call the function DB. The function performs its operation, but shows an exception. In JDev 11.1.2.3
And there is not another user. I'm testing alone.
ADF: addition of the JSF error message: another user has modified the line containing oracle.jbo.Key [185 primary key].
oracle.jbo.RowInconsistentException: Houston-25014: another user has modified the line containing oracle.jbo.Key [185 primary key].
The problem is that the function db has a commit and my code also. However the db function called once in a case.
Thanks a lot for your help.
-
Oracle 11g: problem with disable primary key
Hello
I have this problem:
I performed "EXECUTE IMMEDIATE"ALTER TABLE your table of KEY PRIMARY DISABLE";"
This operation returns an error
but when I did 'insert into table... ". »... Oracle returned ora-0001.
The operations are in the same stored procedure, so in the same session.
Database: Oracle 11.2.0.2
How is that possible?
All solutions?
Thanks in advance.
Best regards.
Alessandro ZenoniTry to add 'DROP INDEX' to your disable command.
not tested
alter table xy disable primary key drop index
-
Problem by setting the primary key: relaxation Assigned primary key in the sequence.
I have a table and a trigger for insert/update on the table. Trigger I get the game of the primary key of a sequence. I tested unit by inserting records in the table. It works very well. Kets primary key the next sequence number.
I use this table as an entity in my adf application. The primary key attribute is set to "DBSequence". But when inserted I do not receive the following sequence for the primary key. Instead it is inserting the temporary number - ve that assigns the adf.
I use JDeveloper 11 g.
Can someone tell me what could be the problem?Your trigger should be something like:
create or replace TRIGGER "SID_ASSIGN" before INSERT ON MY_TABLE FOR EACH ROW BEGIN if :new.SID is null or :new.SID < 0 then SELECT MASTER_SID_SEQUENCE.nextval into :new.SID from dual ; end if; END;
You can refer to the guide of Dev of 11g for more details on this...
Julian
-
Engineering problems the surrogate with Unique key primary key
SDDM 3.3.0.747 with 2 problems (at least so far). I hope that the problem comes from this recruit SDDM and I forgot a setting. PROBLEM 1 I don't want to start a religious debate on substitution vs natural keys but I'm having a problem correctly both the logic model of engineering. I'm a rookie when it comes to SDDM but have many years of experience with the Designer. By default, only I wish I had a natural UID (UK) and a surrogate mother based on a primary key UID (PK) which is used for foreign keys. The problem I have with engineering is I can successfully engineer the substitute PK, engineer of the FK with the PK, but cannot get the unique key to contain surrogate keys in the child table. If I check the identification property in relationships, the PK columns and the UK are included in the child PK and the United Kingdom contains no columns. The installation program, I've defined two reference entities, PROBABILITY and GRAVITY with unique keys natural defined. I also have a child entity RISK_ASSESMENT with links to entities of the PROBABILITY and SEVERITY and both have the "use surrogate keys:": check box selected. The unique key of the entity RISK_ASSESMENT includes links to PROBILITY and GRAVITY. None of the entities have a PK or replacement of the defined keys and they all have the checkbox "Create a surrogate key" checked. In addition the following preferences are defined: Data Modeling/model/logic NO checked - use and the first Unique key as primary key value NOT checked - name - Keep under the name of the from attribute Checked - entity carrier to create controlled key - use surrogate PROBLEM 2 key relationship when the foreign key columns are engineered I want names have a prefix 'FK_"but they don't. Models are defined as follows: Data Modeler/assignment of Standard/Templates Foreign Key name: FK_ {children} {parent} foreign key column: engineer FK_ {Ref column} relational model/General checked Options - translation name Marcus Bacon apply
Once more, I designed without removing anything and still no FK to the United Kingdom of the child.
There is a synchronization problem in DM 4.0 EA1. This will be fixed for the production version.
Philippe
-
Potential problems for tables without primary keys and unique keys
GoldenGate 11.2.1.0.3/Solaris 10
DB: Oracle for Oracle (Source and target is 11.2.0.3)
Topology: unidirectional
In our one-way configuration GG, little of the tables being replicated is not a primary key or a Unique key.
Last week when we have implemented GG for the test, we received warnings for these table below.
Replication seems to work very well for these tables.GGSCI > add trandata WMHS_UD.crtn_dtl 2013-01-12 11:34:33 WARNING OGG-00869 No unique key is defined for table 'CRTN_DTL'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key. Logging of supplemental redo data enabled for table WMHS_UD.crtn_dtl.
Googling, I think that there may be performance degradation when you replicate tables without PK or the United Kingdom.
But are there other potential problems such as data of a certain kind not replicated to the lack of PK/UK?It really depends on the data.
By default, GG is combining all columns as a virtual primary key but don't no conflict control by default. So when you can be sure that the record you insert into the table is unique, then it will work.
BUT as soon as you insert the same record, which is already inserted, then you will encounter problems.Let me show what happens when you use an initial charge because it makes it easier to describe:
We start at 10:00 the capture for a table. Now, you insert a record at 10:00 in the tables. When you now start an initial charge to 10.02, then check you have inserted in the database to 10.01 will be repeated two times. During the IPL as the initial charge is made to 10.02 and it includes data of 10.01 AND it will be replicated again through the process of capture/replicate. -
Constraint primary key turn off - turn on problem solution
Hello
recently I truncate a table. during the truncation process I face with problem and solve below the track.
SQL > TRUNCATE TABLE USER_STATE;
TRUNCATE TABLE USER_STATE
*
ERROR on line 1:
ORA-02266: permit to unique/primary keys in table referenced by foreign keys
Then I find the related CONSTRAINT on the table according to the truncate table ORA-02266
SQL > ALTER TABLE USER_STATE_PARAMETER disable the CONSTRAINT FK1_USR_SES_ST_PAR;
Modified table.
SQL > ALTER TABLE USER_STATE disable the CONSTRAINT SYS_C0030849;
Modified table.
Then successfully truncate the table as below
SQL > TRUNCATE TABLE USER_STATE;
Table truncated.
then I activate the CONSTRAINT
SQL > ALTER TABLE USER_STATE allow CONSTRAINT SYS_C0030849;
Modified table.
SQL > ALTER TABLE USER_STATE_PARAMETER allow FK1_USR_SES_ST_PAR of CONSTRAINT;
Modified table.
-My Question is, after you disable the CONSTRAINT, I did the truncate operation, and then enable the CONSTRAINT. I do who will trust me to do not face any problem in the database of the DML OPERATION? I also found there is no CONSTRAINT to disable in my database.>
I do
>
Nope - you would not enable foreign key constraints, if the tables had given them that reference the you truncated.So if the constraints are enabled and valid, you will have no problem.
You can (and should) always test certain simple dml to confirm there is no problem.
-
Primary key cause problem in the meantime Partition Exchange
DB: 11.2.0.2
OPERATING SYSTEM: AIX 6.1
I get the problem when exchanging data with range partitioned table. I have a partitioned table of interval and a regular intermediate table with data to be uploaded.
Here are the steps that I did.
Now, if I turn off and drop the primary key constraint, it works without any problem.SQL> CREATE TABLE DEMO_INTERVAL_DATA_LOAD ( ROLL_NUM NUMBER(10), CLASS_ID NUMBER(2), ADMISSION_DATE DATE, TOTAL_FEE NUMBER(4), COURSE_ID NUMBER(4)) PARTITION BY RANGE (ADMISSION_DATE) INTERVAL (NUMTOYMINTERVAL(3,'MONTH')) ( PARTITION QUAT_1_2012 VALUES LESS THAN (TO_DATE('01-APR-2012','DD-MON-YYYY')), PARTITION QUAT_2_2012 VALUES LESS THAN (TO_DATE('01-JUL-2012','DD-MON-YYYY')), PARTITION QUAT_3_2012 VALUES LESS THAN (TO_DATE('01-OCT-2012','DD-MON-YYYY')), PARTITION QUAT_4_2012 VALUES LESS THAN (TO_DATE('01-JAN-2013','DD-MON-YYYY'))); Table created. SQL> ALTER TABLE DEMO_INTERVAL_DATA_LOAD ADD CONSTRAINT IDX_DEMO_ROLL PRIMARY KEY (ROLL_NUM); Table altered. SQL> SELECT TABLE_OWNER, TABLE_NAME, COMPOSITE, PARTITION_NAME, PARTITION_POSITION, TABLESPACE_NAME, LAST_ANALYZED FROM DBA_TAB_PARTITIONS WHERE TABLE_OWNER='SCOTT' AND TABLE_NAME='DEMO_INTERVAL_DATA_LOAD' ORDER BY PARTITION_POSITION; TABLE_OWNER TABLE_NAME COM PARTITION_NAME PARTITION_POSITION TABLESPACE_NAME LAST_ANAL ------------------------------ ------------------------------ --- ------------------------------ ------------------ ------------------------------ --------- SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_1_2012 1 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_2_2012 2 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_3_2012 3 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_4_2012 4 USERS SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (10,1,'12-MAR-2012',1000,90); 1 row created. SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (11,5,'01-JUN-2012',5000,80); 1 row created. SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (12,9,'12-SEP-2012',4000,20); 1 row created. SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (13,7,'29-DEC-2012',7000,10); 1 row created. SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD VALUES (14,8,'21-JAN-2013',2000,50); ---- This row will create a new interval partition in table. 1 row created. SQL> commit; SQL> SELECT TABLE_OWNER, TABLE_NAME, COMPOSITE, PARTITION_NAME, PARTITION_POSITION, TABLESPACE_NAME, LAST_ANALYZED FROM DBA_TAB_PARTITIONS WHERE TABLE_OWNER='SCOTT' AND TABLE_NAME='DEMO_INTERVAL_DATA_LOAD' ORDER BY PARTITION_POSITION; TABLE_OWNER TABLE_NAME COM PARTITION_NAME PARTITION_POSITION TABLESPACE_NAME LAST_ANAL ------------------------------ ------------------------------ --- ------------------------------ ------------------ ------------------------------ --------- SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_1_2012 1 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_2_2012 2 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_3_2012 3 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_4_2012 4 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO SYS_P98 5 USERS SYS_P98 partition is added to table automatically. SQL> CREATE TABLE DEMO_INTERVAL_DATA_LOAD_Y ( ROLL_NUM NUMBER(10), CLASS_ID NUMBER(2), ADMISSION_DATE DATE, TOTAL_FEE NUMBER(4), COURSE_ID NUMBER(4)); Table created. SQL> INSERT INTO DEMO_INTERVAL_DATA_LOAD_Y VALUES (30,3,'21-MAY-2013',2000,12); 1 row created. SQL> commit; Commit complete. Since, i need a partition in DEMO_INTERVAL_DATA_LOAD table, which can be used in partition exchange, so i create a new partition as below: SQL> LOCK TABLE DEMO_INTERVAL_DATA_LOAD PARTITION FOR (TO_DATE('01-APR-2013','DD-MON-YYYY')) IN SHARE MODE; Table(s) Locked. SQL> SELECT TABLE_OWNER, TABLE_NAME, COMPOSITE, PARTITION_NAME, PARTITION_POSITION, TABLESPACE_NAME, LAST_ANALYZED FROM DBA_TAB_PARTITIONS WHERE TABLE_OWNER='SCOTT' AND TABLE_NAME='DEMO_INTERVAL_DATA_LOAD' ORDER BY PARTITION_POSITION; TABLE_OWNER TABLE_NAME COM PARTITION_NAME PARTITION_POSITION TABLESPACE_NAME LAST_ANAL ------------------------------ ------------------------------ --- ------------------------------ ------------------ ------------------------------ --------- SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_1_2012 1 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_2_2012 2 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_3_2012 3 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO QUAT_4_2012 4 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO SYS_P98 5 USERS SCOTT DEMO_INTERVAL_DATA_LOAD NO SYS_P102 6 USERS SQL> ALTER TABLE DEMO_INTERVAL_DATA_LOAD EXCHANGE PARTITION SYS_P102 WITH TABLE DEMO_INTERVAL_DATA_LOAD_Y INCLUDING INDEXES WITH VALIDATION; ALTER TABLE DEMO_INTERVAL_DATA_LOAD * ERROR at line 1: ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
Please suggest.SQL> alter table DEMO_INTERVAL_DATA_LOAD disable constraint IDX_DEMO_ROLL; Table altered. SQL> alter table DEMO_INTERVAL_DATA_LOAD drop constraint IDX_DEMO_ROLL; Table altered. SQL> ALTER TABLE DEMO_INTERVAL_DATA_LOAD EXCHANGE PARTITION SYS_P102 WITH TABLE DEMO_INTERVAL_DATA_LOAD_Y INCLUDING INDEXES WITH VALIDATION; Table altered. SQL> select * from DEMO_INTERVAL_DATA_LOAD partition (SYS_P102); ROLL_NUM CLASS_ID ADMISSION TOTAL_FEE COURSE_ID ---------- ---------- --------- ---------- ---------- 30 3 21-MAY-13 2000 12 SQL> select * from DEMO_INTERVAL_DATA_LOAD_Y; no rows selected
First of all, thanks for posting the code that allows us to reproduce your test. It is essential for such problems.
Because the primary key is global you will not be able to use
INCLUDING INDEXES WITH VALIDATION;
And you need to add the primary key to the temporary table
ALTER TABLE DEMO_INTERVAL_DATA_LOAD_Y ADD CONSTRAINT IDX_DEMO_ROLL_Y PRIMARY KEY (ROLL_NUM);
The Exchange will work. You must rebuild the primary key after the Exchange.
-
Dear all,
I have a table of database with a field called "SrNo" as the primary key.
I'm the doDml() substitution in the implementation of the entity class that I call a storedprocedure for insert/update.
I dragged the VO of the table to the form to create a form of the ADF.
The problem is that the update works well, but when I try to insert it gives me mandatory error on "Srno" and recording is not inserted. How do I fix the problem, because the user is not supposed to enter the primary key.
I also tried to change the property validation of the attributes of the entity but its readonly.
-Thank youHello
Set the type to 'SrNo"to DBSequenze when you create the ID via a DB-Trigger/Sequenze...
or false 'Required' to 'SrNo"in the area of occurrence. -
Problem with the primary key and indexes
Hi all
I'm looking a mess on one of our main tables.
One of the developers here added an index on 3 columns in the table, thinking that it would speed up (not noticing that it had not a PK).
Subsequently another developer has noticed there do not have a primary on key. So they added a touch of primry on the single column.
The problem is that now the index created on 3 columns is bein used as the primary key index. As when the primary key is created a new index was not created.
Is there anyway to get rid of this index/change it correct?
This table is related to many many other tables, so when we tried to remove the index we could not due to the primary key and foreign key violations with other tables.
Thanks in advanceOracle, as you found, is quite capable to use a column enformce multi index a single column primary key, as long as the pk column is the leader in the index. This should not cause performance issues for a search of PK and if the three indexed columns are often selected only may benefit from these types of queries.
The only way to change that now, would be to drop all CF, drop and add the PK constraint and then add all the FK constraints. A long time and potentially dangerous (if you miss to add back of the FKs) endeavour. Certainly not worth the risk in my opinion.
John
-
Performance problem on the SQL query that does not use the primary key index
Hello!
I have some performance issues on a single SQL query (Oracle 10 g).
I could solve the problem by using the INDEX indicator, but I would like to know WHY this is happening.
* Tables *.
create table jobs)
ID number (5) not null,
name varchar2 (100),
primary key constraint Job_PK (id)
)
/
-Record count: 298
create table Comp)
integer ID not null,
name varchar2 (100),
primary key constraint Comp_PK (id)
)
/
-Record count: 193
-Relation m: n
create table JobComp)
integer ID not null,
id_job integer not null,
id_comp integer not null,
primary key constraint JobComp_PK (id),
unique key constraint JobComp_UK (id_job, id_comp),
Constraint JobComp_FK_Job foreign key (id_job) refers to Job (id),
Constraint JobComp_FK_Comp foreign key (id_comp) makes reference Comp (id)
)
/
create index JobComp_IX_Comp on JobComp (Cod_Comp)
/
create index JobComp_IX_Job on JobComp (Cod_Job)
/
-Record count: 6431
* Ask *.
When I run this query, the execution plan shows the index using (JobComp_PK and JobComp_IX_Comp).
No problem.
Select JobComp.*
of JobComp
Join jobs
on Job.id = JobComp.id_job
where JobComp.id_comp = 134
/
-runs in 0.20 sec
But when I add the field 'name' of the work table the plan uses full access table to the table of work
Select JobComp.*, Job.name
of JobComp
Join jobs
on Job.id = JobComp.id_job
where JobComp.id_comp = 134
/
-runs in the 2.70 dry
With the help of the index
Select / * + INDEX (Job Job_PK) * /.
JobComp.*, Job.name
of JobComp
Join jobs
on Job.id = JobComp.id_job
where JobComp.id_comp = 134
/
-runs in 0.20 sec
* Doubt *.
This behavior is correct?
PS. : I tried to recalculate the statistics, but nothing changes:
analyze the job calculation table statistics.
/
change the statistical calculation of index Job_PK reconstruction;
/
Start
dbms_utility.analyze_schema (sys_context ('userenv', 'current_schema'), 'CALCULATE');
end;
/
[of]
Gustavo EhrhardtGus.EHR wrote:
Hello.
I'm sorry for the plan unformatted.
The execution time of the querys "without field name' and 'with the field name with suspicion" are equal.
He has no problem caching, because I get the plans of the sequence different from the querys and repeated the performance. The result is always the same.I don't think that there is no problem with oracle crossing LOOP IMBRIQUEE to the HASH JOIN when you include the field name and this should be the expected behavior. But it seems that your WORKING table has a degree of parallelism set against what is causing the query to run in parallel (as JOB table is now available with full table scan, instead of indexed access earlier). It could be that the parallel execution is contributor to extra Runtime.
(a) do you know why the degree of parallelism on the WORK table has been defined? Do you need it?You can see if the following query provides a better response time?
select /*+ NOPARALLEL(JOB) */ JobComp.*, Job.Name from JobComp join Job on Job.id = JobComp.id_job where JobComp.id_comp = 134
-
Primary key several columns with Date - parameter problem
All,
I'm having a problem where I can not find the answer to. I looked upstairs and down nothing helps. Help, please.
The issue is that I have a table that has a primary key of several columns and a column is a date, and the other is a string. I have a simple search and I want a picture update of the results table that users can click on and go to another page to update this record. The question is when I launch an appeal based on the updated image, I also want to define the settings based on the record that I have selected. So I put the string parameter and that works very well. The problem is with the date. When I put the setting date this market but he chops off the coast of the timestamp. Later when I try to access this setting "("dateParameter") pageContext.getParameter"; that it will bring a date as December 15, 2008 but I need the whole date and time stamp (i.e., December 15, 2008 10:20:33) to properly identify the record.
Help, please!
Thank you
Colby JHello
because each parameter go into url as a format string, so you will never get the full date with timestamp setting, the solution would be to
1.) set a fire on the photo update action, give his name to the event as "update."
(2.) by clicking Update photograph fires this event.
(3.) processFormrequest in the controller method
OAApplicationModule am = pageContext.getApplicationModule (webBean);
If ("update".equals (pageContext.getParameter ("event")))
{
This will give you the select line when you click UpdateString rowReference = pageContext.getParameter (OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
Line VORowImpl = (EmployeeSummaryVORowImpl) am.findRowByRef (rowReference);
Timestamp sdateVal = (String) row.getAttribute ("Date value");This will transfer the values to the next page
pageContext.putTransactionTransientValue ("transferdvalue", sdateVal);}
and in the next page, you can get the value as follows
timestamp getDateVal = pageContext.getTransactionTransientValue ("transferdvalue" l);
hope this will solve your problem, please let me know if you face any problem
thanx
Pratap -
Problems with the primary key of the query string
Moving from asp to php, to work with David Power's book: The Essential Guide to Dreamweaver CS4 with CSS, AJAX, and PHP. Recycling of my brain, so starting from scratch in the learning process.
Everything was going perfectly until I tried to add the primary key of a record in a query string. I compared my code with the example code for the book, and everything matches. When previewing the page in my browser and hover over the link which must pass the main code on the next page, the query string does not appear correctly. It shows user_id = but no figure shows, as it is supposed to. www.webpage.com/update_user.php?user_id=
Here is my code: (Please note, <>have been removed, as I was unable to find a way view the code in the correct way here (copy/paste was doesn't work do not, nor insert syntax))
? PHP {?}
? PHP echo $row_listUser ['family_name'];? PHP echo $row_listUser ["FirstName"];?
? PHP echo $row_listUser ['username'];? ? PHP echo $row_listUser ["admin_priv"];?
a href = "update_user.php? user_id =? php echo $row_listUser ['user_id'];?" "Edit / has
a href = "delete_user.php? user_id =? php echo $row_listUser ['user_id'];?" ' Delete / has
? PHP} while ($row_listUser = mysql_fetch_assoc ($listUser));?
Any ideas that could help me understand why this part does not in particular would be greatly appreciated. Writing to the database worked perfectly, I see that there are numbers in the database as user_id, and it is defined as my primary key in the configuration database. Such a simple process that is causing me headaches!
Thank you
You have the code to request a copy in your folder:
$query_listUser = 'SELECT user_id, username, first_name, family_name, admin_priv from users ORDER BY family_name ASC';
$listUser = mysql_query ($query_listUser, $connSCFDIR) or die (mysql_error ());
$row_listUser = mysql_fetch_assoc ($listUser);
$totalRows_listUser = mysql_num_rows ($listUser);
$query_listUser = 'SELECT username, first_name, family_name, admin_priv from users ORDER BY family_name ASC';
$listUser = mysql_query ($query_listUser, $connSCFDIR) or die (mysql_error ());
$row_listUser = mysql_fetch_assoc ($listUser);
The $listUser table will contain the results of the second query, which does not include the field user_id. delete the redundant code.
-
Hi all
I have a table with the same data repeat 2 times. I mean that the lines are depating twice. so now, I create a primary key for the table. He throws me an error saying voilation key primary. I'll give you the clear script.
create table employee)
ID VARCHAR2 (4 BYTE) NOT NULL,
First name VARCHAR2 (10 BYTE),
VARCHAR2 (10 BYTE) last_name,
START_DATE DATE,
End_date DATE,
Number (8.2) of salary.
City VARCHAR2 (10 BYTE),
Description VARCHAR2 (15 BYTE)
)
insert into employee values ('01', 'Jason', 'Martin', to_date('19960725','YYYYMMDD'), to_date('20060725','YYYYMMDD'), 1234.56, 'Toronto', 'Program');
insert into employee values ('02', "Alison", "Mathews', to_date('19760321','YYYYMMDD'), to_date('19860221','YYYYMMDD'), 6661.78, 'Vancouver', 'Tester');
insert into employee values ('03', 'James', 'Smith', to_date('19781212','YYYYMMDD'), to_date('19900315','YYYYMMDD'), 6544.78, 'Vancouver', 'Tester');
insert into employee values ('04', 'Celia', 'Rice', to_date('19821024','YYYYMMDD'), to_date('19990421','YYYYMMDD'), 2344.78, "Vancouver", "Manager");
insert into employee values ('05', 'Robert', 'Black', to_date('19840115','YYYYMMDD'), to_date('19980808','YYYYMMDD'), 2334.78, 'Vancouver', 'Tester');
insert into employee values ('07', 'David', 'Larry', to_date('19901231','YYYYMMDD'), to_date('19980212','YYYYMMDD'), 7897.78, 'New York', 'Manager');
insert into employee values ('06', 'Linda', 'Green', to_date('19870730','YYYYMMDD'), to_date('19960104','YYYYMMDD'), 4322.78, 'New York', 'Tester');
insert into employee values ('08', 'James', 'Cat', to_date('19960917','YYYYMMDD'), to_date('20020415','YYYYMMDD'), 1232.78, 'Vancouver', 'Tester')
insert into employee values ('07', 'David', 'Larry', to_date('19901231','YYYYMMDD'), to_date('19980212','YYYYMMDD'), 7897.78, 'New York', 'Manager');
insert into employee values ('06', 'Linda', 'Green', to_date('19870730','YYYYMMDD'), to_date('19960104','YYYYMMDD'), 4322.78, 'New York', 'Tester');
The table is now with 10 columns
ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION
---- ---------- ---------- --------- --------- ---------- ---------- ---------------
Jason Martin 25 July 96 01 25 July 06 1234.56 Toronto programmer
02 Alison Mathews 21 March 76 February 21, 86 6661.78 Vancouver Tester
03 James Smith December 12, 78 March 15, 90 6544.78 Vancouver Tester
04 Celia rice 24 October 82 21 April 99 2344.78 Vancouver Manager
Robert Black 05 January 15, 84 8 August 98 2334.78 Vancouver Tester
Linda Green 06 July 30, 87 January 4, 96 4322.78 tester of New York
Manager of New York 07 David Larry 31 December 90 February 12, 98 7897.78
08 James Cat 17-AUG-96 April 15 02 1232.78 ester of Vancouver
Create a primary key for the table
"Employee to ALTER TABLE PRIMARY KEY (ID, First_Name, Last_Name, start_date, end_date,
Salary, city, Description); »
I get error voilation primary key
IS IT POSSIBLE TO CREATE THE KEY PRIMARY ON THE TABLE WITH ON THE DELETION OF THE DATA?
Is IT POSSIBLE CREATING PRIMARY KEY USING 'GROUP BY' FUNCTION or OTHER FUNCTIONS?
Published by: user11872870 on September 23, 2010 17:41Primary key columns cannot contain NULL values. If you tried to create a primary key constraint, you will get an error like this:
ERROR at line 1: ORA-01449: column contains NULL values: cannot alter to NOT NULL
However, you can add a unique constraint by doing something like the following:
ALTER TABLE test ADD CONSTRAINT test_unq UNIQUE (column1, column2);
I still wonder why you take the approach you take. I have a vague feeling that're missing us the key pieces of information to recommend the correct solution.
-
updated primary key of the problem 10 gr 2 (10.1.2.0.1)
Primary key can be updated... How to protectiloveoracle wrote:
Primary key can be updated...Yes - longer updating does not violate constraint primary key
How to protect
Trigger.
Maybe you are looking for
-
reading is not supported on this device
I did face the problem of reading as many times, sometimes video is supported, but sometimes not.please solve my problem.
-
It has no red firefox icon more on my screen and no bookmarks - simply disappeared.
Last night my internet came out and today when I turned on my computer there are no Favorites and no firefox in firefox button. I can't go to firefox and go to such or such, because there is no firefox button.
-
Urgent! reading problems in area v5 UB DDF files, copper
Hello I have a very strange problem with Ultiboard. When you read an old DDF (v5) file, it is opened and converted to ewprj... I have no schema file (paper only version) and no netlist... Traces of not obsolete should be changed to the more recent...
-
Acer Iconia tab upgrade 10 (A3 - A20)
I received a notification to upgrade my tablet, after the upgrade, it is still on KitKat, thought that it would be upgraded to lollipop as mentioned on: http://www.pcadvisor.co.uk/reviews/tablets/3601426/acer-iconia-tab-10-review/
-
Successful installation message appears after installation. KB2604111 also appears in Add/Remove programs in Control Panel. So why the feature automatic updates keep asking to download?