Error 00904 trying to alter table ... ?!
I'm running a script to create a table, the primary key of that table will then be used in an Alter Table command to make it a foreign key in an already exisiting table. Code:
CREATE TABLE Category
CATCODE VARCHAR2(3),
CatDesc VARCHAR2(11) NOT NULL,
CONSTRAINT Category_CATCODE_pk PRIMARY KEY(CATCODE)
INSERT INTO Category(CATCODE, CatDesc) VALUES('BUS','Business');
INSERT INTO Category(CATCODE, CatDesc) VALUES('CHN','Children');
INSERT INTO Category(CATCODE, CatDesc) VALUES('COK','Cooking');
INSERT INTO Category(CATCODE, CatDesc) VALUES('COM','Computer');
INSERT INTO Category(CATCODE, CatDesc) VALUES('FAL','Family Life');
INSERT INTO Category(CATCODE, CatDesc) VALUES('FIT','Fitness');
INSERT INTO Category(CATCODE, CatDesc) VALUES('SEH','Self Help');
INSERT INTO Category(CATCODE, CatDesc) VALUES('LIT','Literature');
ALTER TABLE books ADD CONSTRAINT books_Category_fk FOREIGN KEY (CATCODE) REFERENCES Category(CATCODE);
And the error:
Error starting at line 20 in command:
ALTER TABLE books ADD CONSTRAINT books_Category_fk FOREIGN KEY (CATCODE) REFERENCES Category(CATCODE)
Error report:
SQL Error: ORA-00904: "CATCODE": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
I have no idea what is wrong with my code. I successfully make my table and insert the data, why is it telling me CatCode is an invalid identifier?...
( I originally posted it in the wrong section whoops )
Zombnom wrote:
There isn't, I'm trying to ADD a column with CatCode being a foreign key in the books table.Well there's your problem. Column and foreign key are two seperate things. You can combine the two operations though:
ALTER TABLE books ADD catcode CONSTRAINT books_category_fk REFERENCES category(catcode);
Similar Messages
-
Error in Timesten While Alter table in oracle
Hello DB experts,
I am getting below error while my application statrtup.
"Exception while caching Rating System Parameter Details.[TimesTen][TimesTen 11.2.2.2.0 ODBC Driver][TimesTen]TT0871: Column VALUE cannot be set to null "
We have perfomed below activities.
1) Not null constraint is created on one table which is in oracle.
2) My applicaiton is up with timesten
3) Not null constraint is removed from oracle.
4) null data are inserted in that column ,
Please not that the table on which constraint is created/removed was not cached in timesten . its oracle table only.
Now my question is we wanted to know how timesten will work in above situation.The DSN definition from sys.odbc.ini file
[ocsdev]
Driver=/u02/app/TimesTen/tt1122/lib/libtten.so
DataStore=/u031/odbcqa/ttTest
PermSize=1000
TempSize=400
PLSQL=1
DatabaseCharacterSet=WE8MSWIN1252
OracleNetServiceName=orcl
Passthrough=1
UID=crestelxxxdevg5
PWD=crestelxxxdevg5
OracleId=crestelxxxevg5
OraclePwd=crestelxxxdevg5
2. Details of any cache groups you do have defined in TimesTen.
CREATE asynchronous writethrough CACHE GROUP CUST_PACKAGE
FROM TBLCUSTOMERPACKAGE
CUSTOMERPACKAGEID NUMBER ,
VALIDFROMDATE DATE,
VALIDTODATE DATE,
CUSTOMERID NUMBER,
SERVICEID NUMBER,
PRIORITY NUMBER,
PACKAGEID NUMBER,
PRIMARY KEY ("CUSTOMERPACKAGEID"))
UNIQUE HASH ON (CUSTOMERPACKAGEID) PAGES = 4000 ;
3 ) Details of the Oracle table that was altered (table name, column for which the NULL/NOT NULL constraint was changed, any primary/foreign key relationship between this table/column and any cached table/column).
CREATE TABLE "TBLMRATINGCONFIG"
"RATINGCONFID" CHAR(7 BYTE) CONSTRAINT "NN_RATINGCONFIG_RATINGCONFID" NOT NULL ENABLE,
"NAME" VARCHAR2(50 BYTE) CONSTRAINT "NN_RATINGCONFIG_NAME" NOT NULL ENABLE,
"ALIAS" VARCHAR2(50 BYTE) CONSTRAINT "NN_RATINGCONFIG_ALIAS" NOT NULL ENABLE,
"DESCRIPTION" VARCHAR2(2000 BYTE),
"VALUE" VARCHAR2(100 BYTE) CONSTRAINT "NN_RATINGCONFIG_VALUE" NOT NULL ENABLE,
"PARAMETERTYPEID" CHAR(5 BYTE) CONSTRAINT "NN_RATINGCONFIG_ID" NOT NULL ENABLE,
"PARAMETERVALUESOURCE" VARCHAR2(255 BYTE),
"COMMONSTATUSID" CHAR(5 BYTE) CONSTRAINT "NN_RATINGCONFIG_COMMONSTATUSID" NOT NULL ENABLE,
"SYSTEMGENERATED" CHAR(1 BYTE) CONSTRAINT "NN_RATINGCONFIG_SYSGEN" NOT NULL ENABLE,
"CREATEDATE" DATE CONSTRAINT "NN_RATINGCONFIG_CREATEDATE" NOT NULL ENABLE,
"LASTMODIFIEDDATE" DATE CONSTRAINT "NN_RATINGCONFIG_LASTMODIFIEDT" NOT NULL ENABLE,
"CREATEDBYSTAFFID" CHAR(7 BYTE) CONSTRAINT "NN_RATINGCONFIG_CRSTAFF" NOT NULL ENABLE,
"LASTMODIFIEDBYSTAFFID" CHAR(7 BYTE) CONSTRAINT "NN_RATINGCONFIG_MODIFIEDSTAFF" NOT NULL ENABLE,
"STATUSCHANGEDATE" DATE,
"SERVICEID" CHAR(8 BYTE) CONSTRAINT "NN_RATINGCONFIG_SERVICEID" NOT NULL ENABLE,
"JAVASCRIPTREGEX" VARCHAR2(255 BYTE),
"SYSTEMPARAMETERGROUP" NUMBER,
"DISPLAYORDER" NUMBER(3,0),
"ALERTMSG" VARCHAR2(200 BYTE),
CONSTRAINT "PK_RATINGCONFIG" PRIMARY KEY ("RATINGCONFID")
In above script i am removing constraint on "value" column which is having not null constraint.
4) column "value" having such data like 'null'
5) Error
"Exception while caching Rating System Parameter Details.[TimesTen][TimesTen 11.2.2.2.0 ODBC Driver][TimesTen]TT0871: Column VALUE cannot be set to null " -
Error when trying to truncate table from within PL/SQL
Hello.....
Does anyone know why I get an error when trying to execute the following command from within PL/SQL?
truncate table event;
The error is as follows:
ORA-06550: line 20, column 14:
PLS-00103: Encountered the symbol "TABLE" when expecting one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "TABLE" to continue.And as a DDL, it does a COMMIT just before it runs. Whether you want a COMMIT or not.
And with all the locking and serialization issues associated with a DDL. -
Error while trying to access table using DB Link
Hi All,
I had to access a table in another instance using a DB link. As there was no DB link, I was asked to create one and then access the table.
The below query was used to create DB link on my current instance FDEV:
CREATE PUBLIC DATABASE LINK to_link CONNECT TO apps IDENTIFIED BY appsdev USING 'ABCD';
The DB link gets created successfully and when I query select * from all_db_links on my current instance FDEV, I see the DB link name.
However, when I try to access the table, select * from x_stg@to_link on my current instance FDEV, this is resulting in an error as shown below:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from TO_LINK
The TNS entry looks something like this:
ABCD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = abc.xx.com)(PORT = 1234))
(ADDRESS = (PROTOCOL = TCP)(HOST = abc.xyz.com)(PORT = 1234))
(CONNECT_DATA =
(SID = ABCD)
Can someone help me in this regard?
Thanks in Advance!!
Regards,
ABYou are trying to get 2 databases connected... so, you need to insure that FDEV can find and connect to ABCD.
So, from your FDEV database server, you can do 2 things (from command prompt):
1* tnsping ABCD (this will validate that the entry exists in your tnsnames.ora on your FDEV server, and that a valid listener can be found on remote server)
when above command succeeds:
2* sqlplus apps/appsdev@ABCD;
when you have established the connection, then you are SURE that your can connect ABCD database from FDEV database server. It will also validate the username / password combination, create session privilige, account not locked, etc.....
Please check the above, and post here the results.
HTH,
Thierry -
OMB05602 Error when trying to Deploy Table to an Environment.
Hi
I am trying to deploy a table to a development environment from OWB Repository .
My script contains the following commands and the error I am facing.
*1. OMB+>* {color:#0000ff}OMBCONNECT user/pwd@host:port:schema{color}
Connected.
*2. OMB+>* {color:#0000ff}OMBCC '/DQ/DC_STAGING'
{color}Context changed.
*3. OMB+>* {color:#0000ff}OMBCONNECT CONTROL_CENTER user/pwd@host:port:erpdev1 USE REPOSITORY 'repository'{color}
Control Center connected.
*4. OMB+>* {color:#0000ff}OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'TREX_DEPLOY_PLAN' ADD ACTION 'TREX_COLL_PLAN' SET PROPERTIES (OPERATION) VALUES ('REPLACE') SET REFERENCE TABLE 'TREX_INV_CUST_ITEMS_CLN2'
Action plan MY_DEPLOY_PLAN created.
{color}*{color:#000000}5. OMB+>{color}* OMBDEPLOY DEPLOYMENT_ACTION_PLAN 'MY_DEPLOY_PLAN'
{color:#ff0000}OMB05602: An unknown Deployment error has occured for Object Type PUB03201 : An
error has occured with Location EDSDEV9_STAGE_LOCATION. This location is require
d to be registered by EDSDEV9_STAGE_LOCATION. Please ensure that both are correc
tly configured..{color}
{color:#000000}I am not sure where the EDSDEV9 is being picked up.
The Control Center setup is something like as follows
- DQ{color}
- - EDSDEV1_STAGE_LOCATION
- - - DC_STAGING
- - - - Tables
- - - - - TABLE1
{color:#000000}My guess is that after step 3, I have to do something to change the context to the locations defined in the EDSDEV1 control center.
(Something like step 2, but I am not sure what.)
Appreciate any help.
Thanks and Regards
Sameer{color}Hi David
I tried the following. It is giving the same error again.
OMB+> OMBCONNECT --[xxtrex_cnv_rep/[email protected]:1526:TEREXDC2|mailto:xxtrex_cnv_rep/[email protected]:1526:TEREXDC2]--
OMB+> OMBCC '/DQ/DC_STAGING'
OMB+> OMBCONNECT CONTROL_CENTER --[xxtrex_dc_rep/[email protected]:1522:erpdev1|mailto:xxtrex_dc_rep/[email protected]:1522:erpdev1]-- USE REPOSITORY 'xxtrex_dc_rep'
OMB+> OMBREGISTER LOCATION 'EDSDEV1_STAGE_LOCATION' REUSE
OMB+> OMBCREATE CONNECTOR 'STAGE_LOCATION/DEV1CONN' SET PROPERTIES (DESCRIPTION, BUSINESS_NAME) VALUES ('this is a connector', 'connector') SET REFERENCE LOCATION 'EDSDEV1_STAGE_LOCATION'
OMB+> OMBCREATE TRANSIENT DEPLOYMENT_ACTION_PLAN 'TREX_DEPLOY_PLAN' ADD ACTION 'TREX_COLL_PLAN' SET PROPERTIES (OPERATION) VALUES ('REPLACE') SET REFERENCE CONNECTOR 'EDSDEV1_LOCATION/DEV1CONN'
OMB+> OMBALTER DEPLOYMENT_ACTION_PLAN 'TREX_DEPLOY_PLAN' ADD ACTION 'TREX_TBL_PLAN' SET PROPERTIES (OPERATION) VALUES ('REPLACE') SET REFERENCE TABLE 'TREX_INV_CUST_ITEMS_CLN2'
OMB+> OMBDEPLOY DEPLOYMENT_ACTION_PLAN 'TREX_DEPLOY_PLAN'
{color:#ff0000}OMB05602: An unknown Deployment error has occured for Object Type PUB03201 : An
error has occured with Location EDSDEV9_STAGE_LOCATION. This location is require
d to be registered by EDSDEV9_STAGE_LOCATION. Please ensure that both are correc
tly configured..
{color}
Basically I want to deploy a table from the repository (STAGE_LOCATION) to the Dev1 Environment (EDSDEV1_STAGE_LOCATION).
Did I miss something or there is some other setting which is pointing to EDSDEV9_STAGE_LOCATION ?
Thanks and Regards
Sameer -
Error when trying to create tables using "asant create-db_common"
Hi,
I'm attempting to run asant create-db_common to use a .sql file to create a table in Pointbase. However I keep getting this error:
Buildfile: build.xml
init:
create-db_common:
[java] java.lang.NoClassDefFoundError: com/pointbase/tools/toolsCommander
[java] Exception in thread "main"
BUILD SUCCESSFUL
Total time: 1 secondWhich means I need to include the classpath, I presume! But I don't know what file to add it to or where to begin.
Can anyone help?
Thanks.Still haven't solved this problem.
Can anyone guide me at all?
Many thanks. -
PL/SQL throwing errors! trying to alter dates
the following code keeps throwing errors, I was wondering if it is due to me getting confused when to use ":" before a variable and also ":=" when setting values?
Can anyone see what I am doing wrong?
Here is the code, at the moment it is throwing an error on line 44
ORA-06550: line 44, column 1:
PLS-00103: Encountered the symbol "" when expecting one of the following:
CODE.....
DECLARE
QNStart DATE;
QNFinish DATE;
Q1Start DATE;
Q1Finish DATE;
Q2Start DATE;
Q2Finish DATE;
Q3Start DATE;
Q3Finish DATE;
Q4Start DATE;
Q4Finish DATE;
Q5Start DATE;
Q5Finish DATE;
QNT NUMBER;
Q1T NUMBER;
Q2T NUMBER;
Q3T NUMBER;
Q4T NUMBER;
QNR NUMBER;
Q1R NUMBER;
Q2R NUMBER;
Q3R NUMBER;
Q4R NUMBER;
BEGIN
case current_date
when current_date between to_date('01-JAN', 'DD-Mon') AND to_date('31-MAR', 'DD-Mon') then
QNStart := to_date('01-JAN', 'DD-Mon');
QNFinish := to_date('31-MAR', 'DD-Mon');
when current_date between to_date('01-APR', 'DD-Mon') AND to_date('30-JUN', 'DD-Mon') then
QNStart := to_date('01-APR', 'DD-Mon');
QNFinish := to_date('30-JUN', 'DD-Mon');
when current_date between to_date('01-JUL', 'DD-Mon') AND to_date('30-SEP', 'DD-Mon') then
QNStart := to_date('01-JUL', 'DD-Mon');
QNFinish := to_date('30-SEP', 'DD-Mon');
when current_date between to_date('01-OCT', 'DD-Mon') AND to_date('31-DEC', 'DD-Mon') then
QNStart := to_date('01-OCT', 'DD-Mon');
QNFinish := to_date('31-DEC', 'DD-Mon');
End Case
:Q1Start := ADD_MONTHS(:QNStart,-3);
:Q1Finish := ADD_MONTHS(:QNFinish,-3);
:Q2Start := ADD_MONTHS(:QNStart,-6);
:Q2Finish := ADD_MONTHS(:QNFinish,-6);
:Q3Start := ADD_MONTHS(:QNStart,-3);
:Q3Finish := ADD_MONTHS(:QNFinish,-3);
:Q4Start := ADD_MONTHS(:QNStart,-4);
:Q4Finish := ADD_MONTHS(:QNFinish,-4);
:Q5Start := ADD_MONTHS(:QNStart,-5);
:Q5Finish := ADD_MONTHS(:QNFinish,-5);
select COUNT(COUNT(*)) INTO :Q1T from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN :Q1Start AND :Q1Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :Q2T from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN :Q2Start AND :Q2Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :Q3T from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN :Q3Start AND :Q3Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :Q4T from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN :Q4Start AND :Q4Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :QNT from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN :QNStart AND :QNFinish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :Q1R from FF_ACTIONS a
WHERE a.DATE_ENTERED BETWEEN Q1Start AND Q1Finish
AND a.COMPANY_NAME IN
(select f.COMPANY_NAME from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN Q2Start AND Q2Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME)
GROUP BY a.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :Q2R from FF_ACTIONS a
WHERE a.DATE_ENTERED BETWEEN Q2Start AND Q2Finish
AND a.COMPANY_NAME IN
(select f.COMPANY_NAME from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN Q3Start AND Q3Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME)
GROUP BY a.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :Q3R from FF_ACTIONS a
WHERE a.DATE_ENTERED BETWEEN Q3Start AND Q3Finish
AND a.COMPANY_NAME IN
(select f.COMPANY_NAME from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN Q4Start AND Q4Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME)
GROUP BY a.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :Q4R from FF_ACTIONS a
WHERE a.DATE_ENTERED BETWEEN Q4Start AND Q4Finish
AND a.COMPANY_NAME IN
(select f.COMPANY_NAME from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN Q5Start AND Q5Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME)
GROUP BY a.COMPANY_NAME;
select COUNT(COUNT(*)) INTO :QNR from FF_ACTIONS a
WHERE a.DATE_ENTERED BETWEEN QNStart AND QNFinish
AND a.COMPANY_NAME IN
(select f.COMPANY_NAME from FF_ACTIONS f, FF_ACTION_TYPE_LOV a
WHERE f.DATE_ENTERED BETWEEN Q1Start AND Q1Finish
AND a.ACTION_SCORE = 'Y'
AND f.INPUT_TYPE = a.ACTION_NAME
GROUP BY f.COMPANY_NAME)
GROUP BY a.COMPANY_NAME;
EXECUTE
Cheers
SimonDave had given you already some good advice.
Your code is not only too complicated, but you have also probably a bug in it. You have for instance a QNstart as to_date('01.01, 'dd.mm') and a corresponding QNfinish as to_date('31.03', 'dd.mm'). As this means, it is the time portion at 00:01, you are missing the complete last day of this interval. So you better do:
declare
l_QNstart date;
l_Q1start date;
l_Q1finish date;
l_q1t number
begin
l_QNstart := trunc(sysdate, 'Q');
l_Q1start := add_months(l_QNstart, -3);
l_Q1finish := l_QNstart;
-- your condition is now
select count(count(*))
into l_q1t
from ff_actions f, ff_action_type_lov a
where f.date_entered >= l_Q1start and f.date_entered < l_Q1finish
and a.action_score = 'y'
and f.input_type = a.action_name
group by f.company_name;
end;
/Message was edited by:
Leo Mannhart
btw: what is the difference between Q1Start / Q3 Start and Q1Finish / Q3Finish resp.? -
Getting Error while trying to create table using entity beans
This is the output on console.
javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean; neste
d exception is: javax.ejb.EJBException: nested exception is: java.sql.SQLExcepti
on: [Oracle][ODBC][Ora]ORA-00942: table or view does not exist
javax.ejb.EJBException: nested exception is: java.sql.SQLException: [Oracle][ODB
C][Ora]ORA-00942: table or view does not exist
java.sql.SQLException: [Oracle][ODBC][Ora]ORA-00942: table or view does not exis
t
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3104)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedState
ment.java:214)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(JdbcOdbcPrepared
Statement.java:89)
at com.sun.ejb.persistence.PersistenceManagerImpl.primaryKeyExists(Persi
stenceManagerImpl.java:289)
at com.sun.ejb.persistence.PartitionImpl.afterEjbCreate(PartitionImpl.ja
va:640)
at CallerBean_PM.ejbCreate(CallerBean_PM.java:96)This is the output on console.
javax.ejb.TransactionRolledbackLocalException:
Exception thrown from bean; neste
d exception is: javax.ejb.EJBException: nested
exception is: java.sql.SQLExcepti
on: [Oracle][ODBC][Ora]ORA-00942: table or view does
not exist
javax.ejb.EJBException: nested exception is:Look at what the bolded text is telling you. This could be because:
1. The table/view actually does not exist in the oracle instance that you've connected to
2. OR, the user id that you used to connect to the db does not have the right permissions granted to it. -
To Whom it may Concern,
I am attempting to add two columns Comm_id and Ben_id to a table in SQL Developer (Oracle).
Here is the syntax I am using:
ALTER TABLE ACCTMANAGER
ADD (Comm_id NUMBER(10)),
Ben_id VARCHAR(2);
The spool file I'm getting as a result of the script above:
Error starting at line 1 in command:
ALTER TABLE ACCTMANAGER
ADD (Comm_id NUMBER(10)),
Ben_id VARCHAR(2)
Error report:
SQL Error: ORA-01735: invalid ALTER TABLE option
01735. 00000 - "invalid ALTER TABLE option"
*Cause:
*Action:
DESC acctmanager
Thank you in advance.4b60e01f-2ea5-40fe-a161-fc12d38d09e5 wrote:
To Whom it may Concern,
I am attempting to add two columns Comm_id and Ben_id to a table in SQL Developer (Oracle).
Here is the syntax I am using:
ALTER TABLE ACCTMANAGER
ADD (Comm_id NUMBER(10)),
Ben_id VARCHAR(2);
The spool file I'm getting as a result of the script above:
Error starting at line 1 in command:
ALTER TABLE ACCTMANAGER
ADD (Comm_id NUMBER(10)),
Ben_id VARCHAR(2)
Error report:
SQL Error: ORA-01735: invalid ALTER TABLE option
01735. 00000 - "invalid ALTER TABLE option"
*Cause:
*Action:
DESC acctmanager
Thank you in advance.
try as below instead
ALTER TABLE ACCTMANAGER
ADD (Comm_id NUMBER(10), Ben_id VARCHAR(2)); -
Alter table FACT CLUSTER DIM PACK returns -5015 during heterog migrat
Hi
We are performing a heterogeneous migration from Oracle to MaxDB (NW70 SR1}. The Database load is failing on the SAPDFACT fact tables. It appears that the SQL engine is not aware of the enhancements delivered in the BW performance Pack (I'm assuming this from reading between the lines in the OSS notes - according to the online docs this alter table option doesn't exist..) . We are running 7.6.xx
We are performing this on a test system & this is our second attempt at migrating our Test BI system. The first attempt was successful. The SAP and MaxDB instances were deleted (SDBUNINST -all) and the system rebooted. I have performed the 2nd sttempt several times with the same result each time.
The load from R3load (R3LOAD_WL=1) is below:
E:\usr\sap\BIT\SYS\exe\nuc\NTAMD64\R3load.exe: START OF LOG: 20080321211224
E:\usr\sap\BIT\SYS\exe\nuc\NTAMD64\R3load.exe: sccsid @(#) $Id: //bas/700_REL/src/R3ld/R3load/R3ldmain.c#6 $ SAP
E:\usr\sap\BIT\SYS\exe\nuc\NTAMD64\R3load.exe: version R7.00/V1.4
Compiled Apr 2 2006 22:45:33
E:\usr\sap\BIT\SYS\exe\nuc\NTAMD64\R3load.exe -i SAPDFACT.cmd -dbcodepage 1100 -k 17egf5M50TL01eqtd1Ax3A17 -l SAPDFACT.log -nolog -c 0
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\bitadm\Application Data
CLIENTNAME=H1704688
ClusterLog=C:\WINDOWS\Cluster\cluster.log
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
COMPUTERNAME=CMSAPDEV5
ComSpec=C:\WINDOWS\system32\cmd.exe
DBMS_TYPE=ada
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\bitadm
JAVA_HOME=C:\java_32
LOGONSERVER=
CMDC13
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=E:\usr\sap\BIT\SYS\exe\nuc\NTAMD64;e:\sapdb\programs\bin;e:\sapdb\programs\pgm;C:\Program Files (x86)\Legato\nsr\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;e:\sapdb\programs\bin;e:\sapdb\programs\pgm;C:\Program Files (x86)\Legato\nsr\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\usr\sap\BIT\SYS\exe\nuc\NTAMD64
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=EM64T Family 15 Model 6 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0608
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
R3LOAD_WL=1
SAPEXE=E:\usr\sap\BIT\SYS\exe\nuc\NTAMD64
SAPINST_EXEDIR_CD=I:/MAXDB/IM_WINDOWS_X86_64
SAPLOCALHOST=CMSAPDEV5
SAPSYSTEMNAME=BIT
SECUDIR=E:\usr\sap\BIT\DVEBMGS00\sec
SESSIONNAME=RDP-Tcp#1
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\WINDOWS\TEMP
TMP=C:\WINDOWS\TEMP
USERDNSDOMAIN=CSENERGY.COM.AU
USERDOMAIN=CSENERGY
USERNAME=bitadm
USERPROFILE=C:\Documents and Settings\bitadm
windir=C:\WINDOWS
(BUF) INFO: trying to allocate 1024 kB memory
(DB) INFO: connected to DB
(DB) INFO: The MaxDB logwriter is switched off#20080321211232
(TFH) INFO: Trying to open SAPDFACT.cmd
(TFH) INFO: SAPDFACT.cmd opened
(BUF) INFO: trying to allocate 1024 kB memory
(TFH) INFO: Trying to open
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.TOC
(TFH) INFO:
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.TOC opened
(TFH) INFO: Trying to close
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.TOC
(TFH) INFO:
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.TOC closed
(BUF) INFO: trying to allocate 1 kB memory
(RFF) INFO: loading table [HEADER]
(TFH) INFO: Trying to open
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.001
(TFH) INFO:
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.001 opened
(RFF) INFO: entering fread
(RFF) INFO: leaving fread
(RFF) INFO: end of data for table [HEADER]
(GSI) INFO: dbname = "BIT "
(GSI) INFO: vname = "ADABAS D "
(GSI) INFO: hostname = "CMSAPDEV5 "
(GSI) INFO: sysname = "Windows NT"
(GSI) INFO: nodename = "CMSAPDEV5"
(GSI) INFO: release = "5.2"
(GSI) INFO: version = "3790 Service Pack 2"
(GSI) INFO: machine = "2x AMD64 Level 15 (Mod 6 Step 8)"
(TFH) INFO: Trying to open C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\DDLADA.TPL
(TFH) INFO: C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\DDLADA.TPL opened
(TSK) INFO: Trying to open C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK
(TSK) INFO: C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK opened
(TSK) INFO: Trying to close C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK
(TSK) INFO: C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK closed
(TSK) INFO: Trying to rename C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK to C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK.bck
(TSK) INFO: C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK renamed to C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK.bck
(TSK) INFO: Trying to open C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK
(TSK) INFO: C:\Program Files\sapinst_instdir\NW04S\LM\COPY\ADA\SYSTEM\CENTRAL\AS-ABAP\SAPDFACT.TSK opened
(TFH) INFO: Trying to open
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.STR
(TFH) INFO:
cmsapdev2\export_bit\ABAP\DATA\SAPDFACT.STR opened
(DB) INFO: /BI0/E0BWTCFC1 dropped#20080321211232
(SQL) INFO: Searching for SQL file DFACT.SQL
(SQL) INFO: Searching for SQL file
cmsapdev2\export_bit\ABAP\DB/ADA/DFACT.SQL
(SQL) INFO: Trying to open
cmsapdev2\export_bit\ABAP\DB/ADA/DFACT.SQL
(SQL) INFO:
cmsapdev2\export_bit\ABAP\DB/ADA/DFACT.SQL opened
DbSl Trace: EXECUTE on connection 0, rc=-5015 (POS(35) Missing keyword:DROP,MODIFY,COLUMN,ADD,NOT,SET,SAMPLE,FOREIGN,FACT,DYNAMIC,DIMENSION,BWHIERARCHY,ALTER)
(DB) ERROR: DDL statement failed
( ALTER TABLE "/BI0/E0BWTCFC1" CLUSTER ("KEY_0BWTCFC1T") PACKED )
DbSlExecute: rc = 99
(SQL error -5015)
error message returned by DbSl:
(DB) INFO: /BI0/E0BWTCFC2 dropped#20080321211232
etc
etcThanks for the reply Markus.
I am getting the same error with the latest R3load (and library) as well.
I updated the DB.SAR files on the CD and received the error. Thinking there maybe a version mismatch somewhere, I reverted to the original DB.SAR files. Got the same error and captured the log above.
I have logged a OSS call as well.
Regards
Doug -
Hi all,
The following instruction, in an update script provided by a software editor, returns me a ORA-00907 error (missing right parenthesis) :
alter table TABLE_NAME add C1 VARCHAR2(10 byte) ;
I ran it on a 8i database.
If I remove the "byte" between parenthesis, the scripts runs OK.
What is the "byte" option for ?
Is it only available from 9i version for example ?
thanks for your help
AntoineI think it is from 10g onwards only (not sure though).
It means the size of the column is specified in bytes instead of characters. In 8i there is no difference, but in 10g you can/should use multibyte charsets like AL32UTF8.
That simply means certain characters need more than one byte to store it (Euro-Sign for example). It would not be possible to add 10 Euro-Signs to your VARCHAR2(10 byte) column, but it would work with a VARCHAR2(10 char) column.
This explanation is not very good, a better one can be found in the [url http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch6unicode.htm#CACHJHDJ]Oracle 10 Globalization Guide
Just remove the "byte" from the script and you are doing fine. -
Organization index clause in alter table
Hi all! I have some tables and i'd like to modify them in order to add the organization index clause. What is the statement to do this? I've tried this:
alter table table_name organization index;
Thank you!hi,
better use a create table ... organization index as select
then drop the old table and rename the new one.
rgds -
Error -00904 when trying to load from teradata into oracle
Hi all,
We are trying to bring some data from a teradata table into an oracle table. We have followed the correct naming conventions for all staging and target tables.
We always seem to get this error:
error -00904 invalid identifier
I know it relates to a tablename issue. But we cannot seem to find any such errors.
Does it matter the source tablename(in teradata) is pretty long?
We are using IKM SQL control append for this.
The same interface used to work when the source was a text file instead.
We have tested the teradata connections from ODI, are able to see data in the model for the tables.
Thanks.This is the error in operator:
3707 : 42000 : com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 12.00.00.110] [Error 3707] [SQLState 42000] Syntax error, expected something like an 'UDFCALLNAME' keyword between '.' and the 'Dec' keyword.
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC 12.00.00.110] [Error 3707] [SQLState 42000] Syntax error, expected something like an 'UDFCALLNAME' keyword between '.' and the 'Dec' keyword.
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:277)
at com.teradata.jdbc.jdbc_4.statemachine.ReceiveInitSubState.action(ReceiveInitSubState.java:102)
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.subStateMachine(StatementReceiveState.java:285)
at com.teradata.jdbc.jdbc_4.statemachine.StatementReceiveState.action(StatementReceiveState.java:176)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.runBody(StatementController.java:108)
at com.teradata.jdbc.jdbc_4.statemachine.StatementController.run(StatementController.java:99)
at com.teradata.jdbc.jdbc_4.Statement.executeStatement(Statement.java:309)
at com.teradata.jdbc.jdbc_4.Statement.prepareRequest(Statement.java:467)
at com.teradata.jdbc.jdbc_4.PreparedStatement.<init>(PreparedStatement.java:53)
at com.teradata.jdbc.jdbc_4.TDSession.createPreparedStatement(TDSession.java:506)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalPreparedStatement.<init>(TeraLocalPreparedStatement.java:84)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.prepareStatement(TeraLocalConnection.java:328)
at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.prepareStatement(TeraLocalConnection.java:149)
at com.sunopsis.sql.SnpsQuery.a(SnpsQuery.java)
at com.sunopsis.sql.SnpsQuery.a(SnpsQuery.java)
at com.sunopsis.sql.SnpsQuery.updateExecStatement(SnpsQuery.java)
at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.k(e.java)
at com.sunopsis.dwg.cmd.e.A(e.java)
at com.sunopsis.dwg.DwgJv.treatCmd(DwgJv.java)
at com.sunopsis.dwg.DwgJv.main(DwgJv.java)
at oracle.odi.Agent.main(Agent.java) -
I'm trying to open a 900kb Word doc (240pages) in Pages but get this error message: Import Warning - A table was too big. Only the first 40 columns and 1,000 rows were imported.
Julian,
Pages simply won't support a table with that many rows. If you need that many, you must use another application.
Perhaps the originator could use a tabbed list rather than a table. That's the only way you will be able to contain a list that long in Pages. You can do the conversion yourself if you open the Word document in LibreOffice, Copy the Table, Paste the Table into Numbers, Export the Numbers doc to CSV, and import to Pages. In Pages Find and Replace the Commas with Tabs.
There are probably other ways, but that's what comes to mind here.
Jerry -
Getting Incorrect data type error while trying to do a CAST in table
Getting an error while trying to compile the following piece of code
CREATE OR REPLACE PACKAGE BODY A_pkg AS
FUNCTION A(O_error_message IN OUT varchar2)
RETURN BOOLEAN IS
--Declaring the local variables and CURSORs used in the program unit
L_attrib_tbl CFA_SQL.TYP_attrib_tbl;
cursor c1 is
select list_first1.number_11
from TABLE (CAST (L_attrib_tbl AS "CFA_SQL.TYP_attrib_tbl")) list_first1;
BEGIN
L_group_id = '22'
IF L_merch_type_value = 'G' OR L_merch_type_value = 'I' THEN
CFA_SQL.QUERY_ATTRIB(L_attrib_tbl,
L_group_id) ;
END IF;
open C1;
Fetch C1 into L_number;
close C1;
return true;
END A;
END;
Also pasting the Spec for CFA_SQL which contains TYP_attrib_tbl
TYPE TYP_attrib_rec IS RECORD
group_id CFA_ATTRIB_GROUP.GROUP_ID%TYPE,
varchar2_1 VARCHAR2,
number_11 number(10,0));
TYPE TYP_attrib_tbl is TABLE of TYP_attrib_rec INDEX BY BINARY_INTEGER;
The error is coming in the line
cursor c1 is
select list_first1.number_11
from TABLE (CAST (L_attrib_tbl AS "CFA_SQL.TYP_attrib_tbl")) list_first1;
with the error as Invalid data type pointing to CFA_SQL.TYP_attrib_tbl as invalid, but I have initialized L_attrib_tbl as of that datatype only. Ahy help would be greatly appreciated.
Regards,
JoydeepHi Kelly,
There is no data that is entered in that period.The data will be entered for that period next month.
POV is also not set to that period,but still the problem persists.
Thanks
Maybe you are looking for
-
I have a voicemail system at my company and any voicemail box that you call gives you a time that is 8 hours off of the correct time. I have gone into the unity configuration page and checked the time zone and everything and it shows the correct time
-
I have an iPad and iPhone backed up with the same icloud account but because iv two the storage has filled really quick, how can I have separate icloud accounts?
-
Script Task : exception has been thrown by the target of an invocation
Having a simple SSIS package that downloads a file from SharePoint using client object model. the task runs successfully through VS2010 IDE and SQL Agent on development workstation but fails when running through SQL Agent on the server. there are oth
-
Para. from FM cannot be used in inplicit Enh. before the end of endfunction
Hi experts, now i am trying to implement the implicit enhancement for the FM 'HRXSS_CAT_WD_RECORD'. one of the inporting parameter is 'IV_ACTION'. after the begin of function, i implement the first implicit enhancement using the variable 'IV_ACTION'.
-
In Australia we have just switched to daylight savings time and my 3G iPhone running version 4.1 change the internal clock perfectly. The odd thing is that the alarm function in the standard clock App supplied with the phone, is going off an hour ear