HELPS OPERATOR ON TABLE TYPE LESS
Hi all
I'm using Oracle Database 11 g.
I want to perform a negative operation on a varray.
In the code, I want to update based on the result of the operation LESS below. I tried, but it gives 06550 ORA. I think what I'm not looking for the right way to use the collection.
Help, please
declare
TYPE array_tbl IS TABLE OF varchar (255);
v_array array_tbl;
Start;
Select to bulk model_name fired into v_array from kit_car_dim where owner = 'KIT' and model_name like 'FORD ';
because me in 1... loop v_array. Count;
/ * I want to do something like this * /.
Select model_name in v_array
less
Select model_name from kit_car_dim where owner = 'KIT ';
/ * which can be used for the update statement below * /.
Update kit_car_dim set modified_timestamp = sysdate, model_ident = '1'
where model_name = (model_name of operation less);
end loop;
end;
First, you declare a nested table, varray No. If you don't use a nested table, use MULTISET EXCEPT:
Set serveroutput on
declare
TYPE array_tbl IS TABLE OF varchar (255);
v_array array_tbl;
Start
Select dname
Bulk collect
in v_array
of the Department;
for v_i loop 1.v_array.count
dbms_output.put_line (v_array (v_i));
end loop;
dbms_output.put_line('===');
v_array: = multiset v_array except array_tbl ('ACCOUNTING');
for v_i loop 1.v_array.count
dbms_output.put_line (v_array (v_i));
end loop;
end;
/
ACCOUNTING
SEARCH
SALES
OPERATIONS
========================
SEARCH
SALES
OPERATIONS
PL/SQL procedure successfully completed.
SQL >
SY.
Tags: Database
Similar Questions
-
Please help me remove this type of table...
Please help me remove this type of table...
TNOM TABTYPE CLUSTERID
------------------------------ ------- ----------
BIN$ HI3JvRlnSmyMUR + f9icFEA == $0 TABLE
BIN$ JuMC/vSJRcaO/190ftoiFw == $0 TABLE
BIN$ KwkQkRoGScii3AvcHn + n4w == $0 TABLE
BIN$ LYpz0DI0QV2IQTWan9kRdQ == $0 TABLE
BIN$ MGWHAXchQTeKSLowzG4HmA == $0 TABLE
BIN$ RCy9knumTrO5cKeBGC2Ttw == $0 TABLE
BIN$ Rvd4MeZbT6moBxOyIGUHQQ == $0 TABLE
BIN$ TbwpiJzmRKCZzB0FFuQT6A == $0 TABLE
BIN$ XwZK5pqhQGeHdQE4A3zGng == $0 TABLE
BIN$ qWyyrHnwRZSvdeqkXnckoQ == $0 TABLE
BIN$ rdPFWqyjTw6JgkYaHlGHAw == $0 TABLEhttp://download.Oracle.com/docs/CD/B13789_01/server.101/b10759/statements_9018.htm
PURGE RECYCLEBIN;
-
Not able to manage the value 'Table Type' in my procedure, humble need help here
Hi all
I am facing a problem with below pl/sql block. The time I run it it works fine, but when I run the procedure only from the exact values (hardcoded), it throws error as below.
[Error] Execution (38: 1): ORA-06550: line 2, column 1:
PLS-00306: wrong number or types of arguments in the call to 'CREATE_ABNORMAL_BY_TRADER '.
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
What I understand problem is, I use a Type of table herewhich works very well with my Pl/Sql block, but do not work when I run the same procedure of the value hard-coded.
Please guide me how to handle this situation.
Pl/Sql block [works absolutely well]:
Declare
lv_eff_from_dt DATE;
lv_eff_to_date DATE;
v_severity_codes_wl param_tbl: = param_tbl();
lv_algo_id_wl sagedbo.alerts.algo_id%TYPE;
Begin
lv_eff_from_dt: = sage_utility.get_transaction_date('EFF_FROM_DATE'); -' 05-Aug-2013. '
lv_eff_to_date: = sage_utility.get_transaction_date('EFF_TO_DATE'); -' 04-sep-2013. '
lv_algo_id_wl: = sage_utility.get_code_values('ALERT_MODELS','GRAY_LIST'); -GLABNORMALv_severity_codes_wl: = sage_utility.get_multi_parameter_value(1,'SEVERITY_CODE_WL'); -4.5
SONARDBO.sage_generate_alert.create_abnormal_by_trader (lv_algo_id_wl, v_severity_codes_wl, lv_eff_from_dt, lv_eff_to_date, 'US');End;
Pl/Sql block [does not] (by the way the same values but hard)
Begin
SONARDBO.sage_generate_alert.create_abnormal_by_trader ('GLABNORMAL', '4', 5, 5 August 2013 ', ' 04-Sep-2013', 'US');
End;
Error PLS-00306: wrong number or types of arguments in the call to 'CREATE_ABNORMAL_BY_TRADER '.
I'm sorry that my question is not so generic, you cannot run on your computer. How should just guide me with the concept, I treat the values in table hardcodedly? (For testing of use)
Thank you very much
If your passage of type table, then you will need to run as below
Begin
SONARDBO.sage_generate_alert.create_abnormal_by_trader ("GLABNORMAL", param_tbl (' 4 ', ' 5'), August 5, 2013 ', ' 04-Sep-2013', 'US');
End
Means that you must call with the table type ("' hard coded values"). Here is the simple test. Take a look at this
SQL > CREATE or REPLACE the TYPE nt_tab IS TABLE OF VARCHAR2 (50);
2.
Type of creation.
SQL > CREATE OR REPLACE PROCEDURE test_proc (p_nttab nt_tab)
2 AS
3 v_nttab nt_tab: = p_nttab;
4 BEGIN
5 FOR me in 1.v_nttab. COUNTY
6 LOOP
7 DBMS_OUTPUT. Put_line (v_nttab (i));
8 END OF LOOP;
9 END;
10.
Created procedure.
-Perform the procedure with only one value of type table
SQL > EXEC test_proc (nt_tab ('KING'));
KING
PL/SQL procedure successfully completed.
-Run procedure with the multi-value table type
SQL > EXEC test_proc (nt_tab ('KING', 'AAAA', 'BBBB'));
KING
ABDELKADER
BENAMER
PL/SQL procedure successfully completed.
Post edited by: 000000
Post edited by: 000000
-
Need help to identify the type of object in the loop of pl/sql
Hello
I need help to identify the Type of object declared beneath a procedure as shown below:
I need to pass the parameter to the procedure as a TYPE of OBJECT and also refer to variables of Type Object in a loop
create or replace type TEST_VALIDATION_REC is RECORD (order_num varchar2 (30),)
number of inventory_item_id
reserved_YN varchar2 (1).
error_flag varchar2 (1).
Error_message varchar2 (2000)
);
CREATE OR REPLACE TYPE VALD_TBL AS VARRAY (10000) OF TEST_VALIDATION_REC;
PROCEDURE ADD_TO_ORD)
p_lot_number_list IN VALD_TBL,
p_ord_number IN Varchar2,
p_user_id in NUMBER: = fnd_profile.value ('USER_ID'),-change 1.10
p_responsibility_id in NUMBERS: = fnd_profile.value ('RESP_ID'),-change 1.10
p_application_id IN VARCHAR2: = 'PO',-change 1.10
x_error_flag OUT Varchar2,
x_error_msg OUT Varchar2
)
In the above procedure, I had the VALD_TBL. Is it OK?
And how in the loop if the records if I use:
FOR indx1 IN 1.p_lot_number_list. COUNTY
LOOP
BEGIN
SELECT
inventory_item_id
IN
ln_item_id
Of
dummy_lot_tab
WHERE
lot_number = p_lot_number_list (indx1); - > how direct the item here?
EXCEPTION
WHILE OTHERS THEN
ln_item_id: = NULL;
END;
Records are PL/SQL objects. They are not the SQL objects. You can create a SQL TYPE (schema level) as a collection (variable-tables only, tables nested).
So therefore your first statement is syntactically incorrect
CREATE OR REPLACE TYPE TEST_VALIDATION_REC IS RECORD (order_num VARCHAR2(30), inventory_item_id NUMBER, reserved_YN VARCHAR2(1), error_flag VARCHAR2(1), Error_message VARCHAR2(2000) );
You must put in an anonymous PL/SQL block or the stored procedure
DECLARE TYPE test_validation_rec IS RECORD ( order_num VARCHAR2(30), inventory_item_id NUMBER, reserved_YN VARCHAR2(1), error_flag VARCHAR2(1), error_message VARCHAR2(2000) ); TYPE vald_tbl iS VARRAY(10000) OF test_validation_rec; lv_tbl vald_tbl; BEGIN lv_tbl := vald_tbl(); -- insert your code here END;
-
Error in initialization of multilevel nested table type
Hello
Database version: Oracle 11 g R2
I am creating a complex process I need to create complex nested table types and use them in code.
{code}
CREATE or REPLACE TYPE ws_data_compare_rt
AS AN OBJECT
(
external_web_service_id NUMBER (10),
service_code VARCHAR2 (30),
ws_bridging_id NUMBER (10),
ws_attribute_name VARCHAR2 (64).
ws_attribute_value VARCHAR2 (32767).
in_source_attribute VARCHAR2 (30),
in_source_value VARCHAR2 (32767).
comparison_rule VARCHAR2 (100)
);
CREATE or REPLACE TYPE ws_data_compare_tt IS TABLE OF THE ws_data_compare_rt;
CREATE or REPLACE TYPE ws_data_compare_master_rt
AS AN OBJECT
(
key_attribute_1 VARCHAR2 (30),
NUMBER of key_attribute1_value
key_attribute_2 VARCHAR2 (30),
NUMBER of key_attribute2_value
m_ws_data_compare_tt ws_data_compare_tt
);
/
CREATE or REPLACE TYPE ws_data_compare_master_tt IS TABLE OF THE ws_data_compare_master_rt;
{code}
The objects have been created successfully. However when I use it in my code, I need to initialize them, but I get an error for the variable of ws_data_compare_master_tt type initialization.
{code}
...
g_ws_data_compare_rt ws_data_compare_rt: = ws_data_compare_rt (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
g_ws_data_compare_tt ws_data_compare_tt: = ws_data_compare_tt();
g_ws_data_compare_master_rt ws_data_compare_master_rt: = ws_data_compare_master_rt (NULL, NULL, NULL, NULL, g_ws_data_compare_tt);
g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();
...
{code}
I'm unable to initialize the variable g_ws_data_compare_master_tt of type ws_data_compare_master_tt that I get the below error.
For PACKAGE BODY UTL compile errors. PKG_WS_UTIL
Error: PLS-00222: no function with name 'WS_DATA_COMPARE_MASTER_TT' does exist in this scope
Line: 28
Text: g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();
Error: PL/SQL: ignored element
Line: 28
Text: g_ws_data_compare_master_tt ws_data_compare_master_tt: = ws_data_compare_master_tt();
Can someone help me to find out what is the problem?
Thanks in advance.
Kind regards
Natarajan
Ah, I found the problem on my own. It was because of a bad statement similarly variable g_ws_data_compare_master_tt in a table in the specification of the package that was trouble. However I wonder the error returned Oracle was not fully exposed.
Kind regards
Natarajan
-
PLS-00201 in the table type declaration
Hello world
I want to create a line of some of my table type table type.
For example:
create or replace type tmp_Road is table of the XUXUEHAN.tbl_Road%rowtype
But I PLS-00201: identifier 'XUXUEHAN.tbl_Road' must be declared.
Where am I wrong? Thank you :-)
Hi, rp0428.
I read your page
But, the way I called the function package-"select * from table (text_x.get('1')); -It's like the way you did-' select * from table (pkg4.get_emp (20));
But the compiler tell me "types of data not valid." I don't really understand why. Please help me, thanks :-)
-
The assignment of values of Table type error
Hello
I'm trying to insert values for a Collection type, while doing that I am faced with an error.
My statement of collection type PFB and and assignment." PLS-00306: wrong number or types of arguments in call to 'XXSCP_AVL_CSP_SQR_O_TP' "
Object type:
Statement:TYPE XXSCP_AVL_CSP_SQR_O_TP AS OBJECT ( PLAN_ID NUMBER, SR_INSTANCE_ID NUMBER, INVENTORY_ITEM_ID NUMBER, BASE_ITEM_ID NUMBER, ITEM_NAME VARCHAR2(50), SUPPLIER_ID NUMBER, SUPPLIER_SITE_ID NUMBER, NORMAL_BUY_USAGE VARCHAR2(5), AVAILABLE_QUANTITY NUMBER , SPL_PEG_FLAG VARCHAR2(10), SQR_LINE_ID VARCHAR2(2000), SQR_NUMBER VARCHAR2(2000), SQR_MOQ NUMBER, BPA_PO_LINE_ID NUMBER, SUGG_BPA_NUMBER VARCHAR2(30), BPA_BUY_PRICE_BASIS VARCHAR2(10), BPA_LINE_NUM NUMBER, BPA_PO_LINE_LOC_ID NUMBER, BPA_CURRENCY_CODE VARCHAR2(10), BPA_PRICE NUMBER, BPA_PO_HEADER_ID NUMBER, BPA_EXPIRATION_DATE DATE, BPA_QUANTITY NUMBER, ORIG_AVAILABLE_QTY NUMBER ); Table type : TYPE XXSCP_AVL_CSP_SQR_C_TP AS TABLE OF XXSCP_AVL_CSP_SQR_O_TP;
Assignment to the body:l_tab_avl_csp_sqr XXSCP_AVL_CSP_SQR_C_TP := XXSCP_AVL_CSP_SQR_C_TP();
Can anyone help with this.l_tab_avl_csp_sqr.EXTEND(1); l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT) := XXSCP_AVL_CSP_SQR_O_TP(); l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).plan_id := l_tab_planorders (i).l_num_plan_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sr_instance_id := l_tab_planorders (i).l_num_sr_instance_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).inventory_item_id := l_tab_planorders (i).l_num_inventory_item_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).base_item_id := l_tab_planorders (i).l_num_base_item_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).item_name := l_tab_planorders (i).l_chr_item_name; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).supplier_id := l_tab_planorders (i).l_num_supplier_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).supplier_site_id := l_tab_planorders (i).l_num_supplier_site_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).available_quantity := l_rec_pegged_list (j).remaining_aval_qty; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).spl_peg_flag := 'Y'; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sqr_line_id := l_rec_pegged_list (j).sqr_line_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sqr_number := l_rec_pegged_list (j).sqr_number; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sqr_moq := l_rec_pegged_list (j).sqr_moq; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_po_line_id := l_rec_pegged_list (j).bpa_po_line_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sugg_bpa_number := l_rec_pegged_list (j).bpa_number; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_buy_price_basis := l_rec_pegged_list (j).bpb_type; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_line_num := l_rec_pegged_list (j).bpa_line_num; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_po_line_loc_id := l_rec_pegged_list (j).bpa_lloc_id; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_currency_code := l_rec_pegged_list (j).bpa_curr_code; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_price := l_rec_pegged_list (j).bpa_price; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_expiration_date := l_rec_pegged_list (j).bpa_expiration_date ; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_quantity := l_rec_pegged_list (j).bpa_quantity ; l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).orig_available_qty := l_rec_pegged_list (j).remaining_aval_qty ;
Thanks in advance,
Rakesh
Published by: Vincent Rakesh on April 24, 2013 12:18 AMYou must add a vacuum-arg set constructor to your type to use, user l_tab_avl_csp_sqr (l_tab_avl_csp_sqr. "COUNTY): = XXSCP_AVL_CSP_SQR_O_TP();
create or replace TYPE XXSCP_AVL_CSP_SQR_O_TP AS OBJECT ( PLAN_ID NUMBER, SR_INSTANCE_ID NUMBER, INVENTORY_ITEM_ID NUMBER, BASE_ITEM_ID NUMBER, ITEM_NAME VARCHAR2(50), SUPPLIER_ID NUMBER, SUPPLIER_SITE_ID NUMBER, NORMAL_BUY_USAGE VARCHAR2(5), AVAILABLE_QUANTITY NUMBER , SPL_PEG_FLAG VARCHAR2(10), SQR_LINE_ID VARCHAR2(2000), SQR_NUMBER VARCHAR2(2000), SQR_MOQ NUMBER, BPA_PO_LINE_ID NUMBER, SUGG_BPA_NUMBER VARCHAR2(30), BPA_BUY_PRICE_BASIS VARCHAR2(10), BPA_LINE_NUM NUMBER, BPA_PO_LINE_LOC_ID NUMBER, BPA_CURRENCY_CODE VARCHAR2(10), BPA_PRICE NUMBER, BPA_PO_HEADER_ID NUMBER, BPA_EXPIRATION_DATE DATE, BPA_QUANTITY NUMBER, ORIG_AVAILABLE_QTY NUMBER, /* Constructor */ constructor function XXSCP_AVL_CSP_SQR_O_TP return self as result ); create or replace TYPE body XXSCP_AVL_CSP_SQR_O_TP AS /* Constructor */ constructor function XXSCP_AVL_CSP_SQR_O_TP return self as result is begin return; end; end;
You can also assign your attributes that you construct your instance:
l_tab_avl_csp_sqr.EXTEND(1); l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT) := new XXSCP_AVL_CSP_SQR_O_TP( l_tab_planorders (i).l_num_plan_id, l_tab_planorders (i).l_num_sr_instance_id. l_tab_planorders (i).l_num_inventory_item_id, l_tab_planorders (i).l_num_base_item_id, l_tab_planorders (i).l_chr_item_name, l_tab_planorders (i).l_num_supplier_id, l_tab_planorders (i).l_num_supplier_site_id, l_rec_pegged_list (j).remaining_aval_qty, 'Y', l_rec_pegged_list (j).sqr_line_id, l_rec_pegged_list (j).sqr_number, l_rec_pegged_list (j).sqr_moq, l_rec_pegged_list (j).bpa_po_line_id, l_rec_pegged_list (j).bpa_number, l_rec_pegged_list (j).bpb_type, l_rec_pegged_list (j).bpa_line_num, l_rec_pegged_list (j).bpa_lloc_id, l_rec_pegged_list (j).bpa_curr_code, l_rec_pegged_list (j).bpa_price, l_rec_pegged_list (j).bpa_expiration_date, l_rec_pegged_list (j).bpa_quantity, l_rec_pegged_list (j).remaining_aval_qty );
Gerard
Published by: gaverill on April 23, 2013 12:12
-
now I'm seeing its definition into a toad, but I am not able to see, although questioning the user_objects watch table type of desired table.
query: select * from user_objects where object_name = 'DEF_NT_EMPLOYEES_DETAILS. '
result:
OBJECT_NAME | SUBOBJECT_NAME | OBJECT_ID. DATA_OBJECT_ID | OBJECT_TYPE | CREATED | LAST_DDL_TIME | TIMESTAMP | STATUS | TEMPORARY | GENERATED | SECONDARY
DEF_NT_EMPLOYEES_DETAILS | 32975 | TYPE OF | 2010-12-31 19:17:25 | 2010-12-31 19:20:54 | 2010-12 - 31:19:20:54 | VALID | N | N | N |
Oracle version: 9i
Help, please.
Concerning
RahulSELECT TEXT FROM USER_SOURCE WHERE TYPE LIKE 'TYPE%' AND NAME = 'DEF_NT_EMPLOYEES_DETAILS' ORDER BY TYPE, LINE /
SY.
-
Hi, I have problems creating a table type to work with XMLType, here is a sample of my code
1 declare
2
T_linha_xml TYPE 3 IS RECORD (documento CLOB);
4 type t_tab_xml is table of the t_linha_xml;
t_tab_xml tabela_documento 5;
6 v_root XMLType;
7
Start 8
9
10
11 v_root: = sys.xmltype.createXML ("< API_SP_SOAP_OUT > < / API_SP_SOAP_OUT > '");
12 tabela_documento (1) .documento: = ' < API_SP_SOAP_OUT > < / API_SP_SOAP_OUT > ';
13
14 end;
The error is
Error on line 1
ORA-06531: Reference to an uninitialized collection
ORA-06512: at the level of line 12
Can someone help please, I have never worked with before table types.
Best regards
João LopesDear João Lopes!
You must initialize a collection until you can use it. Please change your code as follows:
DECLARE TYPE t_linha_xml IS RECORD (documento CLOB); type t_tab_xml is table of t_linha_xml; tabela_documento t_tab_xml; v_root XMLType; BEGIN -- This will initialize the collection tabela_documento := t_tab_xml(); v_root := sys.xmltype.createXML('
'); -- Extend the collection tabela_documento.EXTEND(2); tabela_documento(1).documento := ' '; END; Yours sincerely
Florian W.
-
Operation of table too complicated
I get behind another programmer and its code is rather inefficient. This operation of table seems complicated and I'm wondering if Labview gurus out there could show the code which does exactly the same thing, but that's not obfusticated and if all goes well, is more effective.
See attatched photo.
It is pulling the however many lines in simple tables, then grouping 0-6 and 7-13 in the individual tables and their transposition. Another option is
-
How the parameter of the procedure with the default table type?
Hello!
How the parameter of the procedure with the default table type?
For example:type varchar2lType is table of varchar2(50) index by binary_integer;
Published by: bullbil on 16.01.2012 06:35create or replace procedure test1 ( s1 varchar2(50) sa2 Varchar2Type ) as begin dbms_output.put_line('yyxxyyy!'); end; /
If he should really be an associative array for some reason any (can't think why, but just for fun...) you could declare a dummy array in the packet header and specify as the default:
create or replace package wr_test as type varchar2ltype is table of varchar2(50) index by pls_integer; g_dflt_varchar2l_tab varchar2ltype; procedure testit ( p_testarray varchar2ltype default g_dflt_varchar2l_tab ); end wr_test; create or replace package body wr_test as procedure testit ( p_testarray varchar2ltype default g_dflt_varchar2l_tab ) is begin dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements'); end testit; end wr_test;
It is a bit of a hack, because it relies on a global variable that is exposed. A more orderly approach would overload the procedure so that a version does not have the table and another argument:
create or replace package wr_test as type varchar2ltype is table of varchar2(50) index by pls_integer; procedure testit; procedure testit ( p_testarray varchar2ltype ); end wr_test; create or replace package body wr_test as procedure testit is v_default_array varchar2ltype; begin testit(v_default_array); end testit; procedure testit ( p_testarray varchar2ltype ) is begin dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements'); end testit; end wr_test;
-
How to create composite indexes for Table Type
Hello
I have a file type my_rec
Type my_rec is RECORD)
Field1 varchar2 (100),
VARCHAR2 (100) Field2.
field3 varchar2 (100));
I declare a table type
Type my_tt is table of my_rec INDEX OF VARCHAR (200);
Here, instead of using varchar (200) can I said anyway that the values of Field1 and Field2 is a composite index?
Thank you
PaddyStill not able to solve my problem.
No need to simplify.
It's just not possible.1 index-by must be PLS_INTEGER, directory or VARCHAR2.
2 anchor statements cannot be used (I know this isn't what you're doing here).
3. you can not make a kind of self-reference on one of the fields in the index.An alternative is to make the big collect in a collection indexed by pls_integer, then go fill another collection with varchar2 key.
-
DIF creation Table Type Select = in gR 10, 3
In a case of very simple example, I have a customers table that I am trying to create a Table Type select in the physical layer.
Using the administration tool I created 'New physical tabe' and enter select * from customers where region = 'East '.
If I "update all heads of rank" it shows now 56 lines - which is correct
If I try 'view data' I get an error
[nQSError: 17001] Oracle error code: 936, messgae: ORA-00936: lack of expression cal OCIStmtExecute beaked.
[nQSError: 17010] Prepare the SQL statement failed.
If I deploy the view I can go to sqlplus and choose in this one.
I tried table of qualification name and select specific columns - I know that's not a problem of permission and without doubt the fact that there are ranks well confirms it must have generated correct SQL.
I'm confused - what I'm missing here?Hi Tim,.
You can try to give a few columns
Select col_name, col_name2, col_name3 customer where region = 'east '.
and to create all the columns--> right click on--> the new physical column (with the same data type)
Thank you
Saichand.v -
Error in the importation of tables with nested table types
Hello
I have two tables with the nested table type when I m try to import a schema to another all tables with error to give the type of identifying different
Here is my order of import
imp leader = tables_nested.dmp ignore = y fromuser = ABC touser = DEV_SCHEMA toid_novalidate = sup_payment_type
I tried to import with the option TOID_NOVALIDATE, but it says
IMP-00086: TOLD 'SUP_PAYMENT_TYPE' not found in the export file
Here, the view of my log file.
. . table import 'CONTRACT' 788 imported lines
. . importation of "EQUIPMENT" 4301 imported table lines
. . rows in table 'CONT_EQUIPMENT' import imported 4300
IMP-00017: statement failed with error ORACLE 2304:
"CREATE TYPE"SUP_PAYMENT_TYPE"TIMESTAMP" 2007-11 - 28:10:50:50' OID "3FF6F10."
"CADC08A99E040A8C0010178F9"AS OBJECT ().
"CONT_NO NUMBER".
"EQP_NO NUMBER".
"PMT_NO NUMBER".
'DATE OF PLAN_PMT_DATE '.
"S_NO NUMBER".
"BATCH_NO NUMBER".
'DATE OF TRAN_DT '.
'DATE OF ACTUAL_PMT_DATE '.
"ACTUAL_PAID_AMT_CURR NUMBER".
"ACTUAL_PAID_AMT_KZT NUMBER".
"PMT_CURSTYP_CD NUMBER".
'NUMBER OF PMT_EXG_RATE);'
IMP-00003: ORACLE error 2304
ORA-02304: invalid literal object identifier
IMP-00063: WARNING: jump table "DEV_SCHEMA". "" SUPPLIER_PAYMENT "as the type of the object
'DEV_SCHEMA '. "' SUP_PAYMENT_TYPE ' could not be created or has identify different
About to activate the constraints...
Thank youBaptist
Get the error on tahiti, I realized this must be a common problem and is described in Metaclunk.
So in Metaclunk I get "ora-02304 imp' and came up with 1066139.6 ML.
It describes your situation.
So many times, it is very easy to solve your problems in a few minutes. I always wonder why people walk immediately into shock and horror and nothing to do when they hit a mistake.----
Sybrand Bakker
Senior Oracle DBA -
Pass values of table type (parameter)
Hi all
I've written a procedure that has table type among the input parameters. How to pass values from table type while calling the procedure. Please suggest
Thank you and best regards,
Mahesh
-For reference
-Registration type
CREATE or REPLACE TYPE lt_rec_type IS (of the OBJECT
Article VARCHAR2 (2000 BYTE)
(, quantity NUMBER (10));
-Table type
CREATE or REPLACE TYPE lt_tbl_type IS TABLE OF THE lt_rec_type;
-Procedure
(PROCEDURE) xxxx
p_table_type lt_tbl_type);SQL> CREATE OR REPLACE TYPE lt_rec_type IS OBJECT(item VARCHAR2(2000), quantity NUMBER(10)) 2 / Type created. SQL> CREATE OR REPLACE TYPE lt_tbl_type IS TABLE OF lt_rec_type 2 / Type created. SQL> CREATE OR REPLACE PROCEDURE proc(p_table_type IN lt_tbl_type) 2 AS 3 BEGIN 4 FOR i IN 1..p_table_type.count 5 LOOP 6 dbms_output.put_line(p_table_type(i).item ||'/'|| p_table_type(i).quantity); 7 END LOOP; 8 END; 9 / Procedure created. SQL> SET SERVEROUTPUT ON SQL> DECLARE 2 l_tbl_type lt_tbl_type := lt_tbl_type(); 3 BEGIN 4 l_tbl_type.extend; 5 6 l_tbl_type(1) := lt_rec_type('Car', 100); 7 8 l_tbl_type.extend; 9 10 l_tbl_type(2) := lt_rec_type('Bike', 450); 11 12 proc(l_tbl_type); 13 END; 14 / Car/100 Bike/450 PL/SQL procedure successfully completed. SQL>
Maybe you are looking for
-
remove a web site that appears next to "getting started" on the menu bar
A Web site link unwanted icon appears on the bar next to "most visited", "getting started,"latest news"and it also appears on my gmail page. I don't know if it's an embed (?) or that it could be called, but it seems a website has invaded my search en
-
THE HP 1315 PCS CD - INSTALLATION PROBLEM
MY COMPUTER OS: WINDOWS XP MY PRINTER: PRINTER HP PSC 1315, COPY AND SCAN, with original HP CD. (Printer out of warranty) I am, of 73 year having no technical Assistance ([personal information deleted]) Because of some virus, the computer is reformat
-
Hello It's my first time display questions on a forum like this, so I'll try to explain in detail what I have (somehow... :)).Is it possible to have 2 "Program Files" location - one on the C partition - and the other on the D partition so that you ca
-
I received the error 0xc0000098. It tells me to insert the windows disk of vista that came with my computer, and when the load cd prompt tells me to repair my computer, I did it or not this result more than once. I can always get on my computer, howe
-
BSOD locale ID: 4105. Help!
So I got a new PC around Christmas, and since then he has BSOD'ed from time to time. Not the BSOD I'm used to seeing tho, it just stops and then starts again. Then once I log in, it tells me there was a dump file that is created. He has not a patt