RADCUCNTUPG Failed.table type /BIO/WMTCTUSERNM : row type /BIO/MTCTUSERNM
Dear All,
We are upgrading our 4.7 NUC system to ECC6 UC through combined upgrade and unicode conversion.
In the upgrade phase, Batch Job RADCUCNTUPG failed. Error message in RADCUCNT.ELG gives the message that table type /BIO/WMTCTUSERNM : row type /BIO/MTCTUSERNM doesnot exist. Nametab cannot be created.
I loged into the shadow instance and found that the view /BIO/MTCTUSERNM exists in DDIC but doesnot exist in the database.
Any solution for this ?
Warm Regards
Mazdul
Dear All,
I was able to find a solution to the problem.
The SAP Shadow instance was up when the error came.
So i logged in to the shadow instance and went to DB02. In DB02, there is an option of database diagonistics, where we can find the list of objects present in DDIC but missing in the database.
When I pressed the refresh button there, I found /BIO/PTCTUSERNM and /BIO/MTCTUSERNM as objects missing in the database.
Selecting these objects I clicked the button to create the objects in the database. I got the message that these objects were successfully created in the database. It should be noted that /BIO/PTCTUSERNM should be activated first and then /BIO/MTCTUSERNM should be activated.
After this I repeated the step and it went ahead. This was my solution, there may be other solution to this other than this. But sap has not come up with any note regarding this, which I think they should.
Hope this would be helpful.´
Warm Regards
Mazdul
Similar Messages
-
What is the maximum rows allowed in PLSQL array table type?
Hi,
I have a procedure and it contains the cursor which will fetch more than 500 records. And i have 5 output parameters to store the values coming from the cursor. I don't want to store that into custom table. I want to save it one table type array or something like that. Now i want to know what is the maximum storage of array table type? If i store more than 500 data, how will be the performance? Then is there any other way to achieve this? And that should not decrease the preformace.Let me know your thoughts.
ThanksIt really depends on what you are planning to do with the records once you return them from your stored procedure, and what client is on the receiving end of the results.
One option would be to just return a ref cursor and let the client deal with retreiving the rows themselves, whether one by on or by a bulk collect. Another option would be to declare a table of records matching the result set and do a bulk collect into that table type in your procedure and return the table type to the caller. You could also declare a table type for each field in the resultset, bulk collect the records into thos types and return one for each field.
Personally, I would likely go with returning a ref cursor. Both of the collect the resultset in your procedure and then return collections to the caller methods require memory on the database server to hold the entire resultset and memeory on the client to hold the entire resultset. While 500 records is probably not going to be too bad on memory, if the result set grows, you will run into memory issues at some point.
John -
Hello,
We are using procedures with table type:
create type <type_name> as table (....)
using explain plan we discover that it uses row engine.
Is there an alternative??
Thanks,
Amirhi Srinivas,
table type
http://help.sap.com/saphelp_nw2004s/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm
In SE11 you can create table type.
This table type is similar to tables, but not the same way as you create tables. You can create table type with either Line type ( Nothing but a structure), Built-in ABAP types or Reference type. Assume that we have created one table type TYTAB with line type LITYP.
So when you declare like this,
DATA: ITAB type TYTAB - Now ITAB acts as a internal table of type TYTAB.
DATA: LS_TYP TYPE LITYP - This LS_TYP now acts as a structure.
So, it is clear that linetype and structure are one and the same.
Regards,
Santosh -
Purpose of Row type, line type and Table Type..
Hi All,
Just Im started working with OOABAP. Whenever I open some structures, most of the components in the structures have the below three words. What is the exact difference b/w the below words. What is purpose those?
Row type, line type
Table type:
Please let me know.hi,
Line Type
The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
Table type
The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be UNIQUE or NON-UNIQUE. Standard tables and sorted tables are known generically as index tables.
Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
At tables with structured row type, the standard key is formed from all character-type columns of the internal table. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty. At tables with non-structured row type, the standard key consists of the entire row. If the row type is also a table, an empty key is defined.
The user-defined key can contain any columns of the internal table that are no internal table themselves, and do not contain internal tables. References are allowed as table keys. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
Internal tables are always completely specified regarding row type, key and access type
Hope this helps. -
Alter table type from COLUMN to ROW
TABLE type can be changed from ROW to COLUMN (and vice versa) using the ALTER TABLE command .
Lars Breddemann wrote
when considering which data store to choose (which, by the way, can be changed later on as well), you have to take into account:
* will you usually need the complete row (all columns)? If so, row store may be more efficient, as reconstructing the complete row is one of the most expensive column store operations.
* will you need to join the row-store table to a column store table? If so, you should avoid using a different storage type, since using both storage engines in a statement leads to intermediate result set materialization which is another name for bad performance.
* do you want to fill the table with huge amounts of data, that should be aggregated and analysed? If this is the case, the column store is the better option.
As a rule of thumb you may just start with column-store tables and change them to row-store tables when you encounter performance issues.
In general most developers cannot anticipate all important use cases for the tables they design.
This is especially true for living and growing systems.
So, more important than choosing the 'right' storage in the beginning is to monitor the performance and to benchmark the differences when changing the storage engine.
So suppose we have a COLUMN table , but would be requiring to get data from many columns (so would be a very expensive column operation) , would it be advisable to change the table type FROM COLUMN to ROW on the fly . would this be a resource intensive operation if the table has a lot of data ?
Lets suppose , if the above can be done , but there exists a interdependency for the column table (say from another simultaneous operation) , and thus should remain as COLUMN table as such . so what would be the better option in this case .
Creating views is not an option as it seems from the SQL guide , that there was not an option to create a ROW view from a COLUMN table. ?
Edited by: Rajarshi Muhuri on Nov 27, 2011 3:25 AMDear Rajashri,
1. you cann't alter table from column to row using alter command.
but you can achieve this through Stored procedure, just Little bit HSQL coding.
I hope upcoming versions SAP Gives like following SQL statements ( following statemnt not works in HANA works in oralce )
create row table "EFASHION_TUTORIAL"."AAA" as
select
"ARTICLE_COLOR_LOOKUP_ID",
"ARTICLE_ID",
"COLOR_CODE",
"ARTICLE_LABEL",
"COLOR_LABEL",
"CATEGORY",
"SALE_PRICE",
"FAMILY_NAME",
"FAMILY_CODE"
from "EFASHION_TUTORIAL"."ARTICLE_COLOR_LOOKUP";
2. Row & column table two different purpose like OLTP & OLAP.
when you think about OLAP means modeling use Column.
when you think about OLTP means real time operations then use Row
Column table is high compress ( 5 - 20X), i don't think you want get any performance issue when read information from column table. that is actual Core engine reading parller process. ( that is Heart of HANA).
Column table purpose quite different like calculations, grouping.. most of DW environment Queires.
Row table is currently system tables in feature row tables as OLTP, it's less compress mode compress to column store.
so finally you write small program convert column to row and row to column
thanks
Rao -
In RFC, no row types are allowed that contain table types or reference type
Hi,
I want to use an internal table in a Remote enabled function module (RFC). Is there any way to pass a table in a RFC?
kind regards,
JonasHello Jonas,
Your subject line states correctly. You cannot pass tables as IMPORT/EXPORT params using a table type.
You have to use the TABLES param, pass the internal table with type spec. LIKE against the dictionary structure you have created.(As suggested by Vikranth)
BR,
Suhas -
How to execute a procedure if out parameter is table type
Hi,
I need to execute a procedure, output parameter of the procedure is table type.
Oracle version I am using is 9.2.0.8 . I am using SQL*Plus
Procedure declaration
PROCEDURE current_open_cycle (p_ban IN repl_cust2.billing_account.ban%TYPE,
v_bill_seq_rec OUT bill_seq_table) ;
Table type declaration
TYPE bill_seq_table IS
TABLE OF bill_seq_rectype INDEX BY BINARY_INTEGER ;
TYPE bill_seq_rectype IS RECORD (v_cycle_run_year repl_cust2.bill.cycle_run_year%TYPE,
v_cycle_run_month repl_cust2.bill.cycle_run_month%TYPE,
v_cycle_code repl_cust2.bill.cycle_code%TYPE,
v_open_cycle BOOLEAN, -- An open cycle
v_billed_cycle BOOLEAN, --
v_invoice_number VARCHAR2(13),
v_start_date DATE,
v_end_date DATE,
v_root_ban repl_cust2.bill.root_ban%TYPE) ;
I tried executing using this script, but it failed. When I execute this oracle lost connection to data base.
declare
r_bill_seq_rec ss_invoice_utilities.bill_seq_table;
begin
ss_invoice_utilities.current_open_cycle(934018003,r_bill_seq_rec);
end;
Please help me how I should write declare block to execute this procedure and also print output of the procedure.
Regards
RaghuI don't see anything wrong with the anonymous block, assuming ss_invoice_utilities is the correct package name. Perhaps a simplified test case would show up what's not working there.
As for printing the contents of an associative array, you'll have to write some code to loop through it and construct a string per row to output via dbms_output, assuming the text will fit within dbms_output's size restrictions in 9i. dbms_output is a debugging tool though - is that the requirement?
btw "pls_integer" is less to type than "binary_integer" ;)
Edited by: William Robertson on Apr 16, 2009 8:35 AM -
I have an application that I would like to map bc4j to a object type hierarchy in the database. From reading previous otn threads I'm under the impression that Domains are not used for Oracle Table Types, just for columns based on oracle types. The thread later goes on to say that for the base type (person_typ) I would map a entity object to the table(person_table) mapped to the base type. To map all the sub-types I would create new entity objects and have PersonEO subclassed into StudentEO and EmployeeEO.
I have done this and it's unclear to me when I subclass PersonEO as StudentEO how do I declare that StudentEO is of oracle object type student_typ?
I'm also having problems with inserting data into the base entity obect. Here's code:
PersonVOImpl personVo = am.getPersonVO();
PersonVORowImpl row = (PersonVORowImpl)personVo.createRow();
personVo.insertRow(row);
row.setName("Mark");
row.setPhone("911");
am.getTransaction().commit();
personVo.executeQuery();
while (personVo.hasNext()){
PersonVORowImpl personRow = (PersonVORowImpl)personVo.next();
The data gets comitted to the db correctly but when the code hits personVo.executeQuery() I get the following error:
oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.sql.STRUCT with value:Mark
at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:687)
at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:80)
at oracle.jbo.server.OracleSQLBuilderImpl.doLoadBulkFromResultSet(OracleSQLBuilderImpl.java:1113)
at oracle.jbo.server.ViewRowImpl.populate(ViewRowImpl.java:2017)
at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1013)
at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2309)
at oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(ViewObjectImpl.java:2240)
at oracle.jbo.server.QueryCollection.populateRow(QueryCollection.java:1698)
at oracle.jbo.server.QueryCollection.fetch(QueryCollection.java:1552)
at oracle.jbo.server.QueryCollection.get(QueryCollection.java:1008)
at oracle.jbo.server.ViewRowSetImpl.getRow(ViewRowSetImpl.java:2791)
at oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(ViewRowSetIteratorImpl.java:2504)
at oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed(ViewRowSetIteratorImpl.java:2368)
at oracle.jbo.server.ViewRowSetIteratorImpl.refresh(ViewRowSetIteratorImpl.java:2569)
at oracle.jbo.server.ViewRowSetImpl.notifyRefresh(ViewRowSetImpl.java:1641)
at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:577)
at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:611)
at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:593)
at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:2886)
at model.testing.main(testing.java:33)
Am I coding this correctly? I'm using jdev9032 for this. Are there any examples out there on how to correctly use bc4j with oracle object type tables?
Thanks in advance!
-MarkHere is my ddl:
CREATE TYPE Person_typ AS OBJECT
( name VARCHAR2(30),
address VARCHAR2(100)) NOT FINAL
CREATE TABLE PERSON_TABLE OF PERSON_TYP
I map a entity object to person_table one for one and I edit the SYS_NC_OID$ property of updateable to never.
I then map a view object one for one to the entity object. The jbo trace I get when -Djbo.debugoutput=console is declared is the following (omitted everything before the db connected).[156] Successfully logged in
[157] JDBCDriverVersion: 9.0.1.4.0
[158] DatabaseProductName: Oracle
[159] DatabaseProductVersion: Personal Oracle9i Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production
[160] ViewRowSetImpl's jbo.viewlink.consistent = false (0)
[161] Column count: 3
[162] Executing SQL in generateRefAndOID...
[163] select a.oid, make_ref(PERSON_TABLE, a.oid) from (select /*+ NO_MERGE +*/ sys_op_guid() as oid from dual) a
[164] OracleSQLBuilder Executing DML on: PERSON_TABLE (Insert)
[165] INSERT INTO PERSON_TABLE(NAME,ADDRESS) VALUES (:1,:2)
[166] BaseSQLBuilder: releaseSavepoint 'BO_SP' ignored
[167] PersonVO notify COMMIT ...
[168] Column count: 3
[169] ViewObject : Created new QUERY statement
[170] SELECT REF(PersonTable), PersonTable.NAME, PersonTable.ADDRESS FROM PERSON_TABLE PersonTable
[171] LoadBulkFromResultSet failed (2)
oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.sql.STRUCT with value:Mark
java.lang.Object oracle.jbo.domain.TypeFactory.get(java.lang.Class, java.lang.Class, java.lang.Object)
TypeFactory.java:687
java.lang.Object oracle.jbo.domain.TypeFactory.getInstance(java.lang.Class, java.lang.Object)
TypeFactory.java:80
java.lang.Object[] oracle.jbo.server.OracleSQLBuilderImpl.doLoadBulkFromResultSet(oracle.jbo.server.AttributeDefImpl[], int, java.sql.ResultSet, int, oracle.jbo.server.DBTransactionImpl)
OracleSQLBuilderImpl.java:1059
void oracle.jbo.server.ViewRowImpl.populate(java.sql.ResultSet)
ViewRowImpl.java:1964
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(oracle.jbo.server.ViewObjectImpl, oracle.jbo.server.QueryCollection, java.sql.ResultSet)
ViewDefImpl.java:1019
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(java.lang.Object, java.sql.ResultSet)
ViewObjectImpl.java:2035
oracle.jbo.server.ViewRowImpl oracle.jbo.server.ViewObjectImpl.createInstanceFromResultSet(oracle.jbo.server.QueryCollection, java.sql.ResultSet)
ViewObjectImpl.java:1966
oracle.jbo.server.ViewRowImpl oracle.jbo.server.QueryCollection.populateRow()
QueryCollection.java:1395
boolean oracle.jbo.server.QueryCollection.fetch(int)
QueryCollection.java:1237
java.lang.Object oracle.jbo.server.QueryCollection.get(int)
QueryCollection.java:832
oracle.jbo.Row oracle.jbo.server.ViewRowSetImpl.getRow(int)
ViewRowSetImpl.java:2621
void oracle.jbo.server.ViewRowSetIteratorImpl.doFetch(int)
ViewRowSetIteratorImpl.java:2347
void oracle.jbo.server.ViewRowSetIteratorImpl.ensureRefreshed()
ViewRowSetIteratorImpl.java:2211
void oracle.jbo.server.ViewRowSetIteratorImpl.refresh(boolean, boolean)
ViewRowSetIteratorImpl.java:2412
void oracle.jbo.server.ViewRowSetImpl.notifyRefresh(boolean, boolean)
ViewRowSetImpl.java:1556
void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
ViewRowSetImpl.java:548
void oracle.jbo.server.ViewRowSetImpl.executeQuery()
ViewRowSetImpl.java:564
void oracle.jbo.server.ViewObjectImpl.executeQuery()
ViewObjectImpl.java:2616
void mypackage1.testing.main(java.lang.String[])
testing.java:25
Exception in thread main
Process exited with exit code 1.
Please let me know if you need more information.
-Mark -
Proble creating Table Type = Select in 10gR3
In a very simple example case I have a customers table that I am trying to create a Table Type of Select in the physical layer.
Using the Admin tool I create "New Physical tabe" and enter select * from customer where region = 'East'
If I "Update All Row Counts" it now shows 56 rows - which is correct
If I try and "view data" I get an error
[nQSError: 17001] Oracle Error Code: 936, messgae: ORA-00936: missing expression at OCI cal OCIStmtExecute.
[nQSError: 17010] SQL Statement preparation failed.
If I deploy the view I can go to sqlplus and select from it.
I have tried qualifying table name and selecting specific columns - I know its not a permission issue and presumably the fact that it counted rows correctly confirms it must have generated correct SQL.
I'm puzzled - what am I missing here?This is standard behavior..Update Row Count work fine since SELECT COUNT (*) FROM (select * from customer where region = 'East') is a valid SQL, View Data doesn't work since your columns aren't named, so OBI cant select col1, col2, etc.
Hope this explains.
Michael
Edited by: mkooloos on Jan 17, 2011 3:48 PM -
How to populate internal table( varaible of ABAP table type) in Excel VBA?
Hi,
I am trying to update a database table from excel using a VBA Macro.
I am able to connect to SAP and able to read data from SAP using a RFC. Similarly after updating certain values, i want to update a table in SAP.
Below are the steps I am doing apart from basic settings.
Getting the reference of the SAP TABLE type from RFC fucntion module
' Call RFC
Set MyFunc = R3.Add("UPDATE_TVARVC_VIA_RFC")
' Get reference and Values TVARVC
Set oParam4 = MyFunc.Tables("TVARVC")
2. Loop over the active cells and populate oParam4
" add values as below
oParam4.Rows.Add
oParam4.Value(1, "NAME") = ..................
oParam4.Value(1, "TYPE") = ..................
oParam4.Value(1, "NUMB") = ..................
Do it for all columns in the table line.
My query is how to identify active cells and make the above code dynamic in step 2.
Thanks in Advance,
Best,
AneelHi Aneel,
You can try the following:
e.g.
for j = 1 to ActiveCell.SpecialCells(11).Column
oParam4.Rows.Add
if j=1 then oParam4.Value(j, "NAME") = ActiveSheet.Cells(1,j).Value
if j=2 then oParam4.Value(j, "TYPE") = ActiveSheet.Cells(1,j).Value
if j=3 then oParam4.Value(j, "NUMB") = ActiveSheet.Cells(1,j).Value
next j
Regards,
ScriptMan -
I am facing a strange SQL exception:-
The code flow is like this:
.Net 4.0 --> Entity Framework --> SQL 2008 ( StoredProc --> Function {Exception})
In the SQL Table-Valued Function, I am selecting a column (nvarchar(50)) from an existing table and (after some filtration using inner joins and where clauses) inserting the values in a Table Type Object having a column (nvarchar(50))
This flow was working fine in SQL 2008 but now all of sudden the Insert into @TableType is throwing "string or binary data would be truncated" exception.
Insert Into @ObjTableType
Select * From dbo.Table
The max length of data in the source column is 24 but even then the insert statement into nvarchar temp column is failing.
Moreover, the same issue started coming up few weeks back and I was unable to find the root cause, but back then it started working properly after few hours
(issue reported at 10 AM EST and was automatically resolved post 8 PM EST). No refresh activity was performed on the database.
This time however the issue is still coming up (even after 2 days) but is not coming up in every scenario. The data set, for which the error is thrown, is valid and every value in the function is fetched from existing tables.
Due to its sporadic nature, I am unable to recreate it now :( , but still unable to determine why it started coming up or how can i prevent such things to happen again.
It is difficult to even explain the weirdness of this bug but any help or guidance in finding the root cause will be very helpful.
I also Tried by using nvarchar(max) in the table type object but it didn't work.
Here is a code similar to the function which I am using:
BEGIN
TRAN
DECLARE @PID
int = 483
DECLARE @retExcludables
TABLE
PID
int NOT
NULL,
ENumber
nvarchar(50)
NOT NULL,
CNumber
nvarchar(50)
NOT NULL,
AId
uniqueidentifier NOT
NULL
declare @PSCount int;
select @PSCount =
count('x')
from tblProjSur ps
where ps.PID
= @PID;
if (@PSCount = 0)
begin
return;
end;
declare @ExcludableTempValue table (
PID
int,
ENumber
nvarchar(max),
CNumber
nvarchar(max),
AId
uniqueidentifier,
SIds
int,
SCSymb
nvarchar(10),
SurCSymb
nvarchar(10)
with SurCSymbs as (
select ps.PID,
ps.SIds,
csl.CSymb
from tblProjSur ps
right
outer join tblProjSurCSymb pscs
on pscs.tblProjSurId
= ps.tblProjSurId
inner join CSymbLookup csl
on csl.CSymbId
= pscs.CSymbId
where ps.PID
= @PID
AssignedValues
as (
select psr.PID,
psr.ENumber,
psr.CNumber,
psmd.MetaDataValue
as ClaimSymbol,
psau.UserId
as AId,
psus.SIds
from PSRow psr
inner join PSMetadata psmd
on psmd.PSRowId
= psr.SampleRowId
inner join MetaDataLookup mdl
on mdl.MetaDataId
= psmd.MetaDataId
inner join PSAUser psau
on psau.PSRowId
= psr.SampleRowId
inner
join PSUserSur psus
on psus.SampleAssignedUserId
= psau.ProjectSampleUserId
where psr.PID
= @PID
and mdl.MetaDataCommonName
= 'CorrectValue'
and psus.SIds
in (select
distinct SIds from SurCSymbs)
FullDetails
as (
select asurv.PID,
Convert(NVarchar(50),asurv.ENumber)
as ENumber,
Convert(NVarchar(50),asurv.CNumber)
as CNumber,
asurv.AId,
asurv.SIds,
asurv.CSymb
as SCSymb,
scs.CSymb
as SurCSymb
from AssignedValues asurv
left outer
join SurCSymbs scs
on scs.PID
= asurv.PID
and scs.SIds
= asurv.SIds
and scs.CSymb
= asurv.CSymb
--Error is thrown at this statement
insert into @ExcludableTempValue
select *
from FullDetails;
with SurHavingSym as (
select distinct est.PID,
est.ENumber,
est.CNumber,
est.AId
from @ExcludableTempValue est
where est.SurCSymb
is not
null
delete @ExcludableTempValue
from @ExcludableTempValue est
inner join SurHavingSym shs
on shs.PID
= est.PID
and shs.ENumber
= est.ENumber
and shs.CNumber
= est.CNumber
and shs.AId
= est.AId;
insert @retExcludables(PID, ENumber, CNumber, AId)
select distinct est.PID,
Convert(nvarchar(50),est.ENumber)
ENumber,
Convert(nvarchar(50),est.CNumber)
CNumber,
est.AId
from @ExcludableTempValue est
RETURN
ROLLBACK
TRAN
I have tried by converting the columns and also validated the input data set for any white spaces or special characters.
For the same input data, it was working fine till yesterday but suddenly it started throwing the exception.Remember, the CTE isn't executing the SQL exactly in the order you read it as a human (don't get too picky about that statement, it's at least partly true enough to say it's partly true), nor are the line numbers or error messages easy to read: a mismatch
in any of the joins along the way leading up to your insert could be the cause too. I would suggest posting the table definition/DDL for:
- PSMetadata, in particular PSRowID, but just post it all
- tblProjectSur, in particularcolumns CSymbID and TblProjSurSurID
- cSymbLookup, in particular column CSymbID
- PSRow, in particular columns SampleRowID, PID,
- PSAuser and PSUserSur, in particualr all the USERID and RowID columns
- SurCSymbs, in particular colum SIDs
Also, a diagnostic query along these lines, repeat for each of your tables, each of the columns used in joins leading up to your insert:
Select count(asurv.sid) as count all
, count(case when asurv.sid between 0 and 9999999999 then 1 else null end) as ctIsaNumber
from SurvCsymb
The sporadic nature would imply that the optimizer usually chooses one path to the data, but sometimes others, and the fact that it occurs during the insert could be irrelevant, any of the preceding joins could be the cause, not the data targeted to be inserted. -
How to retrieve the values from PL/SQL table types.
Hi Every one,
I have the following procedure:
DECLARE
TYPE t1 IS TABLE OF emp%ROWTYPE
INDEX BY BINARY_INTEGER;
t t1;
BEGIN
SELECT *
BULK COLLECT INTO t
FROM emp;
END;
This procedure works perfectly fine to store the rows of employee in a table type. I am not able to retrieve the values from Pl/SQL table and display it using dbms_output.put_line command.
Can anybody help me please!!!!!
Thanks
Ahmed.You mean, you can't add this
for i in t.first..t.last loop
dbms_output.put_line(t(i).empno||' '||t(i).ename||' '||t(i).job);
end loop;or you can't add this
set serveroutput onor maybe, you are working in third party application where dbms_output is not applicable at all?
You see, not able like very similar it is not working - both are too vague...
Best regards
Maxim -
Passing parameters to PL/SQL table types
Hi Everybody,
I have one question about passing PL/SQL tables types and tabs as IN parameter in procedure.I am working in 11.2.0.2.0 environment. I am stuck on how to pass those values to procedure.Please find below more details:
Table 1:
CREATE TABLE ITEMS
ITEM_ID VARCHAR2(40 BYTE) NOT NULL,
ITEM_NAME VARCHAR2(40 BYTE),
SERIAL NUMBER(2),
ADDED_ON DATE);
Table 2:
CREATE TABLE ITEM_ACTIVITY_INFO
ITEM_ID VARCHAR2(40 BYTE) NOT NULL,
ACCOUNT_TYPE VARCHAR2(1 BYTE),
ID_NUMBER NUMBER(3),
ACTIVATION_DATE DATE);
Table 3:
CREATE TABLE ITEM_GROUP
GROUP_ID NUMBER(2) NOT NULL,
ITEM_ID VARCHAR2(40 BYTE),
GROUP_TYPE VARCHAR2(20 BYTE),
GROUP_DATE DATE);
Table 4:
CREATE TABLE ITEM_ADDRESS
GROUP_ID NUMBER(2) NOT NULL,
NAME VARCHAR2(60 BYTE),
ADDRESS VARCHAR2(100));
Following types are created:
CREATE OR REPLACE TYPE ITEMS_TYPE AS OBJECT
ITEM_ID VARCHAR2(40 BYTE),
ITEM_NAME VARCHAR2(40 BYTE),
SERIAL NUMBER(2),
ADDED_ON DATE);
CREATE OR REPLACE TYPE ITEM_ACTIVITY_TYPE AS OBJECT
ITEM_ID VARCHAR2(40 BYTE),
ACCOUNT_TYPE VARCHAR2(1 BYTE),
ID_NUMBER NUMBER(3),
ACTIVATION_DATE DATE);
CREATE OR REPLACE TYPE ITEM_GROUP_COMP_TYPE AS OBJECT
GROUP_ID NUMBER(2) NOT NULL,
ITEM_ID VARCHAR2(40 BYTE),
GROUP_TYPE VARCHAR2(20 BYTE),
GROUP_DATE DATE
ITEM_ADDRESS_IN ITEM_ADDRESS_TYPE);
CREATE OR REPLACE TYPE ITEM_ADDRESS_TYPE AS OBJECT
GROUP_ID NUMBER(2),
NAME VARCHAR2(60 BYTE),
ADDRESS VARCHAR2(100));
CREATE OR REPLACE TYPE ITEM_GROUP_COMP_TAB AS TABLE OF ITEM_GROUP_COMP_TYPE;
Create or replace procedure ITEM_ADD_CHANGE(
ITEM_IN IN ITEMS_TYPE,
ITEM_ACTIVITY_IN IN ITEM_ACTIVITY_TYPE,
ITEM_GROUP_IN IN ITEM_GROUP_COMP_TAB,
ITEM_OUT IN OUT ITEMS.ITEM_ID%TYPE);
Above are the paramteres we are passing to procedure.
I need help in how to pass parameters to above procedure. All comments and responses will be highly appreciated. Thanks everyone for going through the post. Please let me know if more more information is required on this problem.
Regards
DevBilly Verreynne wrote:
Types used in this fashion, only make sense if the table is based on the type. It makes very little sense to have a table structure and then to duplicate the structure using a type.
The 2 structures may be defined the same. But they are NOT interchangeable and requires one to be converted to the other to use. This is not sensible in my view. It is far easier in that case to simply use the PL/SQL macro +%RowType+ to create a duplicate structure definition - one that can natively be used for touching that table, without conversions required.
If you do want to use types, define the type, then define the table of that type, adding the required constraints (pk, fk, not null, check) to the table's definition.Billy:
Just curious, why do you say it makes very little sense to have a type modeled on a table? I do that a lot. In my case, I am getting the values from an external program, not building them manually, but it makes a lot of sense to me.
One application where I do this a lot has a java front-end that parses HL7 messages. Each message contains at least minimal information about a variable number of entities (and often several rows for an entity) in the database, and must be processed as a single atomic trasnaction. So, rather than have potentially hundreds of parameters to the "main" driver procedures for different message types I created a set of types more or less identical to the tables representing the entities. The java program parses the mesasge and populates the type, then calls the appropriate stored procedure for the message type passing in the populated types. My stored procedure then does inserts/updates or deletes as appropriate over potentially dozens of tables.
John -
Block with more than one table type agurment - Update Procedure for Block
Hi,
I have one form with 3 Block. First Block is single row block, and other 2 are details block . The details balocks are based on the Procedure datasource, because of the complex query conditions. Now my requirement is When Inserting / Updating the Master Block (Single Row Block), I need to get the values in the two details block , because I need to update some other tables also based on these values. I created a procedure with two Table Type parameters (for each details block) , but when I using this procedure as the Update Procedure Name in the block, I am getting the error Only One table type arguement is allowed. Is there any other method to implement this.
Thanks in advance.Rizly,
A quick summary to make sure I understand your requirements. You have a single row base table master block with two detail blocks that are based on Procedures. When you update the single row base table master block, you need all of the data in the two procedure based detail blocks as there are updates that you have to perform to other tables that use this data. You have created a stored procedure that take two PL/SQL tables as parameters, but you are getting the error that only 1 table parameter is allowed.
I need to ask you a few questions first. What is your Forms version? The stored procedure you created; are you using this procedure in the "On-Insert, On-Update, On-Delete" triggers or do you call the procedure in one of the Base Table block ("Key-Commit, When-Button-Pressed" or other trigger)? When you modify or add a new Master block record are you adding values to the detail blocks or using values from the previous Master block record?
If you are using your procedure in the On-Insert, On-Update or On-Delete trigger(s), then based on your description, the error you are receiving is correct. The "On-..." triggers are constrained in that their procedures expect only a single PL/SQL table, Table of Records or Ref Cursor as a parameter. This is a Forms constraint - not a PL/SQL constraint as Forms is expecting you to only perform actions on the block where the "On-..." Trigger is located.
Perhaps you should consider creating a database Package that has two package specification constructs (Ref Cursor, Table of Records, etc) you can populate from Forms and then simply call the package procedure that will use the Ref Cursors to perform the needed update or inserts.
Hope this helps.
Craig...
If mine or someone elses response was helpful, please mark it accordingly -
Regarding appending data in table type
Hello Experts,
Actually, I have one structure and in that I am using one table type .
e.g. in the main structure, fields are as follows,
po_number po_line_item_no gr_details
here gr_details is table type having following fields.
gr_number gr_qty gr_date
As we all know that one po can have multiple GR,
I want to append entries in the above structure in such a way that for one po entry , in the same record , multiple Gr entries should come.
I am doing one program , in it is mendatory.
can anyone please revert back on the same with High Priority ( Coding in Program to append values as per explained above ).
Best Regards,
Rashmi.Hi!
For the same PO entry multiple GRs in same record is not possible. But you can have multiple GR entries in your internal table with same PO details.
For eg. If you have one PO with 4 GRs then you will have 4 lines in internal table that belong to same PO but different GRs. In this case PO details would be redundant.
To read these values into internal table
1. You can read the GR details into corresponding columns of internal table and then update the PO columns for these records.
2. The other bit diffcult way could be to read all PO details into internal table. Then loop at internal table for each PO find out the no. of GRs. If it has N no of GRs then add (N-1) rows with same PO details and different GR details and update the N the GR detail into the existing row of the internal table. If it has only 1 GR then update the existing line. If PO has no GR then delete the table line.
Reward points for all the useful answers.
Maybe you are looking for
-
Service Order Creation through IC Web client
Hello Experts, I am facing some problem for service order creation in IC Web client. Description: "ISUSRV" is the new BOL component in CRM 7.0 for service order creation in ISU System. BOL Object is given in this component is "IsuserviceOrder" for se
-
Dear All, I have full rman backup and archivelog pieces where the version is 10.2.0.1. Now I have prepared a server with oracle 11g and same mount points and want to restore the database from those pieces. Is it possible? If yes then what extra preca
-
Where can I still purchase Mac OS X v10.7 Lion?
Hello all, A friend of mine is hoping to upgarde his version of iMovie to the latest one - but in order to do so has to be the OS needs to be upgraded to to 10.7.4 - is lion still available for purchase anywhere? Installing 10.8 isn't an option as t
-
Running an Air 3 mobile app in gpu renderMode is horrible. A List component with a couple custom ItemRenderers breaks when scrolling up and down. The StyleableTextField components would be misaligned, the backgrounds would not draw correctly, images
-
When will the next batch of iphone5 hit the stores?
I don't want to order with the hopes of getting one before November if I can just walk in a store and buy one in a week. I am hoping to have mine before the end of October but if I order it now it doesn't say it will ship till oct 30th