Table - doubt
Hello. I have a job to do which is: we have to create a table of random numbers () and the user gives a number he chooses. We need to create a new table with all table at random numbers that are larger than the number of the user.
I did this: http://img291.imageshack.us/my.php?image=helpaipeop3.jpg
My question is: How can I create a new table with all the numbers that are larger than the number?
In the future, please attach images directly to your message instead of placing them on ImageShack so people can access it directly.
To answer your question: you're not understanding dataflow. Since there is that no dependencies in the data between the 2 loops then the 2 loops will be different at the same time. However, the background loop runs with empty bays are filled until the top loop ends. Your incorrect use of local variables is a mistake and the number without a doubt one of the reasons why we see programmes does not properly. Please make sure that sets are filled before you try to use them. That said, is there no need 2 loops first. The comparison just there where you generate the random number. Use a shift register to accumulate a table. If the random number is larger than the control, and then add it to the table. If this isn't the case, pass through. Use a box structure. Like this:
To learn more about LabVIEW, it is recommended that you go through the tutorials and look over the material in tutorials the NI Developer Zone Learning Center , which provides links to other materials and other. You can also take a course online for free.
Tags: NI Software
Similar Questions
-
Small request help on the use of the global temporary table - some doubts
Hi allFew days back according to a condition, I used a TWG (on the ranks of commit preserve).
I created a trigger (before the insertion of line level) on GTT that calls a procedure (pragma autonomous transaction declared in the procedure).
Procedure inserts data into two tables and I have a validation final (after the two insertion of data in tables) in the procedure.
I tested by inserting the number of lines in TWG and found that the two tables are correctly supply procedure called by trigger.
Which means that my works absolutely perfect functionality. (performance is also good)
Now, my question is: since in the production source ETL tool will load this TWG.
ETL will use this table in different processes simultaneously.
Suppose that a single session ETL populates this table, and at the same time in parallel another session fills this table with different data. is there a lock on this TWG?
Would the TWG is blocking other lines to add at any time?
Is it possible that data may disappear without completing the entire process prematurely TWG?
PS the feature I developed is the generic exception feature. This works for all valid tables for the database. For most of the tables will be filled with ETL, that's why I had these doubts in my mind.
I apologize, if these seems like childish doubts.
Thank you very much
Arpit Agrawal
Each line I'll get my GTT and follow all the features [trigger procedure &], will be considered as a session until the validation, right?
This is not correct, a session is considered between the opening of session (session is created) and close the session (session is closed) of the database.
If I use, validation TWG deletions here, how would he had differed on commit preserve as when my feature is completed, I don't want to keep more data.
If on commit delete has been used here, it wouldn't make a difference in your case since you make is ENGAGING in some AUTONOMOUS OPERATIONS.
In both cases, commit delete and commit preserve, you don't have to worry about the data inside the TWG because it will be empty onece you logoff (session ends).
However, you can perform a delete operation in your session if you do not want to keep the data up to the end of the session.
-
Hi Master,
Using Sql * Loader I can load the dat/csv/txt data to oracle tables. I can use it when clause contained in the data file and load control in different tables.
e.g. when deptno = 20 then table 1. Where deptno = 10 then table2 etc...
But using the external table... How can I load data in different tables as an example above? I googled. but do not get appropriate information. Please advise... !!
Concerning
AR
Bad code. You use positional WHEN when you define variable length fields. As a result, your code will load Department 201, 2090,...:
SQL > create table T_DEPTNO_20)
NUMBER 2 DEPTNO,
3 DNAME VARCHAR2 (14).
LOC 4 VARCHAR2 (13)
5)
6 EXTERNAL ORGANIZATION
() 7
ORACLE_LOADER TYPE 8
9 DEFAULT TEMP DIRECTORY
10 ACCESS SETTINGS
(11)
12 RECORDS DELIMITED BY NEWLINE
13 CHARGE WHEN (1:2) = "20"
14 LOGFILE 'MyFile.log.
15 BADFILE "MyFile.bad."
16 NODISCARDFILE
17 FIELDS TERMINATED BY ', '.
18 EVENTUALLY FRAMED BY "" "
RTRIM 19
20 MISSING FIELD VALUES ARE NULL
(21)
22 DEPTNO,
23 DNAME,
LOC 24
25)
26)
27 RENTAL ("MyFile.csv")
28)
RELEASE 29 UNLIMITED LIMIT
30.
Table created.
SQL > select * from T_DEPTNO_20
2.
DEPTNO DNAME LOC
---------- -------------- -------------
SEARCH 20 DALLAS
201 DO NOT LOAD ARMPIT
SQL > drop table T_DEPTNO_20
2.
Deleted table.
SQL > create table T_DEPTNO_20)
NUMBER 2 DEPTNO,
3 DNAME VARCHAR2 (14).
LOC 4 VARCHAR2 (13)
5)
6 EXTERNAL ORGANIZATION
() 7
ORACLE_LOADER TYPE 8
9 DEFAULT TEMP DIRECTORY
10 ACCESS SETTINGS
(11)
12 RECORDS DELIMITED BY NEWLINE
13 CHARGER WHEN deptno = '20'
14 LOGFILE 'MyFile.log.
15 BADFILE "MyFile.bad."
16 NODISCARDFILE
17 FIELDS TERMINATED BY ', '.
18 EVENTUALLY FRAMED BY "" "
RTRIM 19
20 MISSING FIELD VALUES ARE NULL
(21)
22 DEPTNO,
23 DNAME,
LOC 24
25)
26)
27 RENTAL ("MyFile.csv")
28)
RELEASE 29 UNLIMITED LIMIT
30.
Table created.
SQL > select * from T_DEPTNO_20
2.
DEPTNO DNAME LOC
---------- -------------- -------------
SEARCH 20 DALLAS
SQL >
SY.
-
Hi to all of that I doubt to retrieve information from two tables to help join
SQL > select ename, empno, lease_car_id employee_car_list;
EMPNO, ENAME LEASE_CAR_ID
---------- ---------- ----------
7369 SMITH 1
7499 2 ALLEN
7521 WARD 3
7566 JONES 4
7654 MARTIN 5
SQL > select lease_car_id, lease_car_make, lease_car lease_car_model;
LEASE_CAR_ID LEASE_CAR_MAKE LEASE_CAR_MODEL
---------- ------------- ----------------------
1 TOYOTA CAMRY
2 FORD TAURUS
3 GM BUICK
4 GM CHEV
5 GM BUICK
I want to know the empno, ename that uses lease_car_make and lease_car_model of GM, BUICK?
I wrote a join condition, but it displays every thing please change my query
Select employee_car_list.empno, employee_car_list.ename in the outer join left employee_car_list
lease_car on employee_car_list.lease_car_id = lease_car.lease_car_id
You can use it. Left outer join will be used when you want all rows from the left table and the matching rows from the right table
SELECT EmpNo, ename FROM
EMPLOYEE_CAR_LIST T1,
LEASE_CAR T2
WHERE T1. LEASE_CAR_ID = T2. LEASE_CAR_ID
AND LEASE_CAR_MAKE = 'GM' AND LEASE_CAR_MODEL = 'BUICK ';
output:
7521 WARD 7654 MARTIN Post edited by: Partha Sarathy S
-
doubts about the result in short 3.1 table
Hi all
I created the table of results short 2.4 using the box for query using EQL and motions, but I do not see the possibility to enter the eql short 3.1.Has that something has changed, or I missed something?
and to allow drilling down short 2.4 I added an action column to retrieve the ID of event available on a particular line. Clicking on the button Add an Action column on the Configuration tab and added the action but can not see samething in short 3.1.
Can you get it someone please let me know how the above things is possible in short 3.1
Thanks in advance.
Unfortunately, you cannot rename it. It is standard to have the label the name of the attribute followed by the subset of date / time used.
-
doubt in the creation of tables in different data in a tablespace files
Hi good Eve everyone,
in my scenario, I must create nearly 50 paintings with 3 data files in a table space.
I have to save the top 15 in datafile 1 and 15 next in 2nd datafile and the rest in 3rd datafile.
How do I create and tables in a data file of the group.
looking for a helping hand in need...
thanking you in advance
Prakash
You can do this, but it's awkward. Here is an example:
ALTER session set deferred_segment_creation = true;
create tablespace twofiles datafile 'c:\tmp\tf1.dbf' size 1m,'c:\tmp\tf2.dbf' size 1 m;
create table infile1 (c1 date) tablespace twofiles;
create table infile2 (c1 date) tablespace twofiles;
ALTER table infile1 allocate extended (datafile 'c:\tmp\tf1.dbf');
ALTER table infile2 allocate extended (datafile 'c:\tmp\tf2.dbf');
Select nom_segment, file_id from dba_extents where nom_tablespace = 'TWOFILES ';
However, it is simpler to let the Oracle uncle to decide how to distribute the scopes.
-
doubt about table constraints - subscribe - search
Hello friends,
Can you please clarify this question for me:
I have a table called INVESTIGATIONS:
SOURCE_ID
AGENT_ID
INQUIRY_ID
CLIENT_FK
BEDS
UNIT_TYPE
PROJECT
INQUIRY_STATUS
LEAD_STATUS
DEAL_TYPE
BUDGET
ADMIN_FEED
AGENT_FEED
I had to create * 9 look it up * tables to provide values for the first 9 columns in table of the requests for INFORMATION.
What causes a huge footprint on the database:
-Join between 9 tables. -> > 9 FK on table of investigations.
-9 NOT check constraints NULL on information to the array for the first 9 columns.
{message: id = 10345002}
This is the required report:
Kind regardsselect "INQUIRY_STATUS"."INQUIRY_STATUS" as "INQUIRY_STATUS", "AGENTS"."AGENT_NAME" as "AGENT_NAME", "SOURCES"."SOURCE_NAME" as "SOURCE_NAME", "UNIT_TYPES"."UNIT_TYPE" as "UNIT_TYPE", "COMPLEXES"."COMPLEX_NAME_EN" as "COMPLEX_NAME_EN", "BEDS"."BED_NUMBER" as "BED_NUMBER", "INQUIRIES"."INQUIRY_ID" as "INQUIRY_ID", case when "INQUIRIES"."DEAL_TYPE" = 'S' then 'Sale' else 'Rent' end as "DEAL_TYPE", "INQUIRIES"."MOVING" as "MOVING", "INQUIRIES"."BUDGET" as "BUDGET", "INQUIRIES"."ADMIN_FEED" as "ADMIN_FEED", "INQUIRIES"."AGENT_FEED" as "AGENT_FEED", "CLIENTS"."FIRST_NAME" as "FIRST_NAME" , "LEAD_STATUS"."LEAD_STATUS" AS "LEAD_STATUS" from "INQUIRIES" "INQUIRIES" INNER JOIN "CLIENTS" "CLIENTS" ON ("CLIENTS"."CLIENT_ID"="INQUIRIES"."CLIENT_FK") INNER JOIN "LEAD_STATUS" "LEAD_STATUS" ON ("LEAD_STATUS"."STATUS_ID" = "INQUIRIES"."LEAD_STATUS") INNER JOIN "BEDS" "BEDS" ON ("BEDS"."BED_ID"="INQUIRIES"."BEDS") INNER JOIN "COMPLEXES" "COMPLEXES" ON ("COMPLEXES"."COMPLEX_ID"="INQUIRIES"."PROJECT") INNER JOIN "UNIT_TYPES" "UNIT_TYPES" ON ("UNIT_TYPES"."UNIT_TYPE_ID"="INQUIRIES"."UNIT_TYPE") INNER JOIN "SOURCES" "SOURCES" ON ("SOURCES"."SOURCE_ID"="INQUIRIES"."SOURCE_ID") INNER JOIN "AGENTS" "AGENTS" ON ("AGENTS"."AGENT_ID"="INQUIRIES"."AGENT_ID") INNER JOIN "INQUIRY_STATUS" "INQUIRY_STATUS" ON ("INQUIRY_STATUS"."STATUS_ID" = "INQUIRIES"."INQUIRY_STATUS") where :P1_phone is null or TRIM(:P1_phone) in ("CLIENTS".mobile1,"CLIENTS".mobile2,"CLIENTS".land_line)
FatehFateh says:
Hello friends,
Can you please clarify this question for me:I had to create * 9 look it up * tables to provide values for the first 9 columns in table of the requests for INFORMATION.
Which causes a huge footprint on the database?
N ° this is a database was built for. Especially an oracle database can handle this exceptionally well. The positive point is the optimizer (cbo = cost based optimizer) is the most effective way how to deal with such a simple select statement. Provided that the CBO has enough and relevant information, which means that statistics should be collected.
I just noticed that this filter condition is not a good way to get quick access to your data in tables.
where :P1_phone is null or TRIM(:P1_phone) in ("CLIENTS".mobile1,"CLIENTS".mobile2,"CLIENTS".land_line)
The datamodel is not properly normalized, so instead of making a simple comparison like
:p1_phone = clients.phonenumber
you need such a compex or condition (IN = GOLD)But it wasn't the question, right?
Published by: Sven w. on August 20, 2012 18:33
-
Doubt by inserting the Date and time in the table
Hi I created a table with two columns "Order_ID" and "Order_date" as
create table test
(
whole order_id,
ORDER_DATE date default sysdate
);
Now, I insert a line in the
insert into test (order_id) values (1);
now, I get the result as
ORDER_ID ORDER_DAT
------------- --------------
1 JUNE 5, 12
But I need to insert the time current system also in the Order_date column.
How can I achieve this?It works well for me!
bcm@bcm-laptop:~$ sqlplus user2/user2 SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 4 20:19:57 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 20:19:58 SQL> @test1 20:20:01 SQL> create table test1 20:20:01 2 ( 20:20:01 3 order_id integer, 20:20:01 4 order_date date default sysdate 20:20:01 5 ); Table created. 20:20:01 SQL> 20:20:01 SQL> insert into test1(order_id) values(1); 1 row created. 20:20:01 SQL> select * from test1; ORDER_ID ORDER_DATE ---------- ------------------- 1 2012-06-04 20:20:01 20:20:01 SQL>
-
Dear members,
I do FLASHBACK TABLE as the user sys. I know that the FLASHBACK TABLE cannot be used for the SYS user.
always I have run this command with clouse to file and
When I run this command with timestamp clouse, I get error.
Can you get it someone please tell me why this is happening?
ORACLE: 11 GR 2
OS: FEDORA 14
-----
$ sqlplus / as sysdba
SQL > insert into values t11 ('k');
1 line of creation.
SQL >! day;
Sea 30 mai 15:45: 13 IST 2012
SQL > insert into values t11 ('z');
1 line of creation.
SQL > drop table t11.
Deleted table.
SQL > select * from dba_recyclebin;
OWNER OBJECT_NAME ORIGINAL_NAME OPERATION TYPE TS_NAME CREATETIME DROPTIME DROPSCN NOM_PARTITION RELATED BASE_OBJECT PURGE_OBJECT SPACE CANCAN
------------------------------ ------------------------------ -------------------------------- --------- ------------------------- ------------------------------ ------------------- ------------------- ---------- -------------------------------- --- --- ---------- ----------- ------------ ----------
SYS, BIN$ wT5v1Gw96zbgQGSsOaoM4g == $0 T11 DROP TABLE NISHANT 2012-05 - 30:14:47:37 2012-05 - 30:15:45:36 17728226 YES YES 85115 85115 85115 8
SQL > flashback table "BIN$ wT5v1Gw96zbgQGSsOaoM4g == $0 ' timestamp to_time (May 30, 2012 15:45:13 ',' dd/mm/yyyy hh24:mi:ss');
flashback table "BIN$ wT5v1Gw96zbgQGSsOaoM4g == $0" to to_time timestamp (May 30, 2012 15:45:13 ',' dd/mm/yyyy hh24:mi:ss')
*
ERROR on line 1:
ORA-08185: Flashback not supported for user SYS
SQL > flashback table "BIN$ wT5v1Gw96zbgQGSsOaoM4g == $0" before dropping.
Flashback complete.before drop between recyclebin area (* flashback drop option *)
trying to flashback with data undo timestamp (* flashback table option *), is not supported for sys.
and the table created in the non-system tablespace
----------
SYS, BIN$ wT5v1Gw96zbgQGSsOaoM4g == $0 T11 DROP TABLE NISHANT 2012-05 - 30:14:47:37 2012-05 - 30:15:45:36 17728226 YES YES 85115 85115 85115 8independent system LMT TBS will support recyclebin functionality
Published by: rash on May 30, 2012 18:07
-
doubt in a table subpartitioning
Hi gems... good evening...
I have a table that was previously only range partitions.
Now I changed it to the partitioning composite range-hash.
There are 6 partition tablespaces namely TS_PART1, TS_PART2... TS_PART 6.
The default tablespace of the schema is TS_PROD.
The table had following structure previously:
create the table ORDER_BOOK
(
CUST_ID NUMBER (10),
PROFILE_ID NUMBER (10),
PRODUCT_ID NUMBER (10),
SUB_PROFILE_ID VARCHAR2 (25).
DATE OF CASHFLOW_DATE,
NUMBER (24.6) OF EARNINGS.
constraint ORDER_BOOK_PK primary key (CUST_ID, PROFILE_ID, PRODUCT_ID, SUB_PROFILE_ID, CASHFLOW_DATE)
)
partition by range (CASHFLOW_DATE)
(
partition values ORDER_BOOK_PART1 less (TO_DATE (January 1, 2003 ',' DD-MM-YYYY "")) tablespace TS_PART1;
partition values ORDER_BOOK_PART2 less (TO_DATE (January 1, 2006 ',' DD-MM-YYYY "")) tablespace TS_PART2;
partition values ORDER_BOOK_PART3 less (TO_DATE (January 1, 2009 ',' DD-MM-YYYY "")) tablespace TS_PART3;
partition values ORDER_BOOK_PART4 less (TO_DATE (1 January 2012 ',' DD-MM-YYYY "")) tablespace TS_PART4;
partition values ORDER_BOOK_PART5 less (TO_DATE (1 January 2015 ',' DD-MM-YYYY "")) tablespace TS_PART5;
partition values ORDER_BOOK_PART6 less (TO_DATE (1 January 2018 ',' DD-MM-YYYY "")) tablespace TS_PART6
)
;
create index ORDER_BOOK_IDX on ORDER_BOOK (PRODUCT_ID, CASHFLOW_DATE);
Now, I did the following steps to change the existing partitions to the new partitions composite range-hash:
Start
DBMS_REDEFINITION. CAN_REDEF_TABLE
(uname = > 'DEMO_TEST',)
tNom = > "ORDER_BOOK"
options_flag = > DBMS_REDEFINITION. CONS_USE_PK);
end;
/
create the table INTERIM_ORDER_BOOK
(
CUST_ID NUMBER (10),
PROFILE_ID NUMBER (10),
PRODUCT_ID NUMBER (10),
SUB_PROFILE_ID VARCHAR2 (25).
DATE OF CASHFLOW_DATE,
NUMBER (24.6) OF EARNINGS.
constraint INTERIM_ORDER_BOOK_PK primary key (CUST_ID, PROFILE_ID, PRODUCT_ID, SUB_PROFILE_ID, CASHFLOW_DATE)
)
partition of range (CASHFLOW_DATE)
SUBPARTITION by hash (CUST_ID)
model SUBPARTITION
(
SUBPARTITION SP1 tablespace TS_PART1,
SUBPARTITION SP2 tablespace TS_PART2,
SUBPARTITION SP3 tablespace TS_PART3,
SUBPARTITION SP4 tablespace TS_PART4,
SUBPARTITION SP5 tablespace TS_PART5,
SUBPARTITION SP6 tablespace TS_PART6
)
(values less than P1 (to_date('01-01-2003','DD-MM-YYYY')) partition,
values of partition P2 lower (to_date('01-01-2006','DD-MM-YYYY')),
values of partition P3 lower (to_date('01-01-2009','DD-MM-YYYY')),
partition P4 values less than (to_date('01-01-2012','DD-MM-YYYY')),
values for partition P5 lower (to_date('01-01-2015','DD-MM-YYYY')),
values of partition P6 lower (to_date('01-01-2018','DD-MM-YYYY')))
allow the movement of the line;
Start
dbms_redifinition.start_redef_table
(uname = > 'DEMO_TEST',)
orig_table = > 'ORDER_BOOK ',.
int_table = > 'INTERIM_ORDER_BOOK ',.
options_flag = > DBMS_REDEFINITION. CONS_USE_PK);
end;
/
Start
DBMS_REDEFINITION.finish_redef_table
(uname = > 'DEMO_TEST',)
orig_table = > 'ORDER_BOOK ',.
int_table = > 'INTERIM_ORDER_BOOK');
end;
/
After I did the index with the LOCAL clause is to say local indexes.
But the problem is that... at the beginning when there is only the range partitioning, then the data will tablespaces corresponding score.
But after editing the table, fill the array results in consumption of space in partition as well as the default tablespace storage.
I checked the size of the storage space. Since I came to know about it.
The output of the USER_TAB_SUBPARTITIONS is correct... each subparts are in the corresponding storage spaces.
But the primary partitions (USER_TAB_PARTITION) are in the default tablespace.
Please help me... thanks in advance...
Published by: user12780416 on April 13, 2012 07:46>
But the primary partitions (USER_TAB_PARTITION) are in the default tablespace.
>
Yes - so why is it a surprise?You have created a new table and storage for partitions has not specified then the default tablespace has been used. You did not specify tablespaces for subparts to each of them uses the specified tablespace.
Don't you see the difference between the original
partition ORDER_BOOK_PART1 values less than (TO_DATE('01-01-2003', 'DD-MM-YYYY')) tablespace TS_PART1,
and the new
(partition P1 values less than (to_date('01-01-2003','DD-MM-YYYY')),
-
Doubt PLSQL cursor table variable record
Hi all
My version of Oracle: Oracle 10 G
I have a cursor, allows day:
cursor c_emp
is
(select * from emp where empina = 10); -Now this * returns me 5 values, IE empid (100), (rahul) fname, lname (smith), sal (9000), deptid (10)
Now, in my home, I have a cursor loop for example, like this:
Start
for rec_c_emp in c_emp
loop
..
..
..
end of loop
end;
Now my requirement is I need to capture these values(rec_c_emp.empid,rec_c_emp.fname,rec_c_emp.lname,rec_c_emp.sal,rec_c_emp.deptid) 5
in a table that is to say i [0], I [1], I [2], I [3], I [4]
Now please note that in the future my ' select * from emp' could make me more values and so I need to capture these values without changing my code.
I hope that I clearly explained my problem, please help.
Concerning
RahulMac_Freak_Rahul wrote:
Let's say I have a cursor:
cursor c_emp is
Select to_char (empid) empid, fname to_char (fname), lname to_char (lname), to_char (sal) sal to_char (deptid) deptid from emp where empno = 100;want these values to be assigned to my table of varchar2, as:
a [0]: 100
[1]: rahul
[2]: smith
[3]: 9000
[4]: 10Possible - but not really reasonable.
The projection of SQL itself must be a single table. For example
SQL> create or replace type TArray is table of varchar2(4000); 2 / Type created. SQL> SQL> col ARRAY format a50 SQL> select TArray(empno,ename,job,sal) as ARRAY from emp order by empno; ARRAY -------------------------------------------------- TARRAY('7369', 'SMITH', 'CLERK', '800') TARRAY('7499', 'ALLEN', 'SALESMAN', '1600') TARRAY('7521', 'WARD', 'SALESMAN', '1250') TARRAY('7566', 'JONES', 'MANAGER', '2975') TARRAY('7654', 'MARTIN', 'SALESMAN', '1250') TARRAY('7698', 'BLAKE', 'MANAGER', '2850') TARRAY('7782', 'CLARK', 'MANAGER', '2450') TARRAY('7788', 'SCOTT', 'ANALYST', '3000') TARRAY('7839', 'KING', 'PRESIDENT', '5000') TARRAY('7844', 'TURNER', 'SALESMAN', '1500') TARRAY('7876', 'ADAMS', 'CLERK', '1100') TARRAY('7900', 'JAMES', 'CLERK', '950') TARRAY('7902', 'FORD', 'ANALYST', '3000') TARRAY('7934', 'MILLER', 'CLERK', '1300') 14 rows selected. SQL> SQL> begin 2 for c in( 3 select TArray(empno,ename,job,sal) as array from emp where rownum < 3 4 ) loop 5 DBMS_OUTPUT.put_line( 'ROW' ); 6 for i in 1..c.Array.Count loop 7 DBMS_OUTPUT.put_line( 'array['||i||']='||c.Array(i) ); 8 end loop; 9 end loop; 10 end; 11 / ROW array[1]=7369 array[2]=SMITH array[3]=CLERK array[4]=800 ROW array[1]=7499 array[2]=ALLEN array[3]=SALESMAN array[4]=1600 PL/SQL procedure successfully completed. SQL>
-
Doubt about the passage collection (Pl/SQL table) in a procedure.
Hi all
I have developed a package of sample with procedure 1. Here, I spent the output to a table in the collection data and I am passing the array of the collection as a parameter out.
When I run the proc, it worked for 1 scenario, but did not work for the other. I posted two scenarios after the code.
Scenario 1:pkg spec: create or replace PACKAGE IMP_EXP_BKUP_PKG AS TYPE test10_tbl2 IS TABLE OF test10.t1%type INDEX BY BINARY_INTEGER; v2_test10 test10_tbl2; PROCEDURE manpower_list(v1 number, v2 out test10_tbl2); END IMP_EXP_BKUP_PKG; Pkg Body: create or replace PACKAGE BODY IMP_EXP_BKUP_PKG AS PROCEDURE manpower_list(v1 number, v2 out test10_tbl2) AS BEGIN SELECT t1 BULK COLLECT INTO v2 FROM test10 WHERE t4 = v1; END; END IMP_EXP_BKUP_PKG;
Worked well.DECLARE v2 imp_exp_bkup_pkg.test10_tbl2; BEGIN imp_exp_bkup_pkg.manpower_list('10', v2); FOR i IN v2.FIRST..v2.LAST LOOP DBMS_OUTPUT.PUT_LINE(v2(i)); END LOOP; END;
Scenario 2:
Is not here.DECLARE --v2 imp_exp_bkup_pkg.test10_tbl2; TYPE typ_tbl2 IS TABLE OF test10.t1%type INDEX BY BINARY_INTEGER; v2 typ_tbl2; BEGIN imp_exp_bkup_pkg.manpower_list('10', v2); FOR i IN v2.FIRST..v2.LAST LOOP DBMS_OUTPUT.PUT_LINE(v2(i)); END LOOP; END; Error: ORA-06550: line 6, column 3: PLS-00306: wrong number or types of arguments in call to 'MANPOWER_LIST'
I want to just make sure that, are we supposed to use the same type that we have breeding stock in the package for the declaration of the variables?SamFisher wrote:
I want to just make sure that, are we supposed to use the same type that we have breeding stock in the package for the declaration of the variables?
Yes, you MUST use the same type definition.
SY.
-
Doubt about inserting data into a table
Hi all, when I try to insert data into a table through an anonymous block, the pl/sql block runs successfully, but the data are not get inserted. Can someone please tell me where I am doing wrong?
Thanks in advance!SQL> DECLARE 2 3 V_A NUMBER; 4 5 V_B NUMBER; 6 7 v_message varchar2(25); 8 9 10 BEGIN 11 12 13 select regal.regal_inv_landed_cost_seq.NEXTVAL into V_A from dual ; 14 15 select regal.regal_inv_landed_cost_seq.currval into V_B from dual ; 16 17 INSERT INTO rcv_transactions_interface 18 ( 19 INTERFACE_TRANSACTION_ID, 20 HEADER_INTERFACE_ID, 21 GROUP_ID, 22 TRANSACTION_TYPE, 23 TRANSACTION_DATE, 24 PROCESSING_STATUS_CODE, 25 PROCESSING_MODE_CODE, 26 TRANSACTION_STATUS_CODE, 27 QUANTITY, 28 LAST_UPDATE_DATE, 29 LAST_UPDATED_BY, 30 CREATION_DATE, 31 CREATED_BY, 32 RECEIPT_SOURCE_CODE, 33 DESTINATION_TYPE_CODE, 34 AUTO_TRANSACT_CODE, 35 SOURCE_DOCUMENT_CODE, 36 UNIT_OF_MEASURE, 37 ITEM_ID, 38 UOM_CODE, 39 EMPLOYEE_ID, 40 SHIPMENT_HEADER_ID, 41 SHIPMENT_LINE_ID, 42 TO_ORGANIZATION_ID, 43 SUBINVENTORY, 44 FROM_ORGANIZATION_ID, 45 FROM_SUBINVENTORY 46 ) 47 48 SELECT 49 regal.regal_inv_landed_cost_seq.nextval, --Interface_transaction_ id 50 V_A, --Header Interface ID 51 V_B, --Group ID 52 'Ship', --Transaction Type 53 sysdate, --Transaction Date 54 'PENDING', --Processing Status Code 55 'BATCH', --Processing Mode Code 56 'PENDING', --Transaction Status Cod e 57 lc.quantity_received, --Quantity 58 lc.last_update_date, --last update date 59 lc.last_updated_by, --last updated by 60 sysdate, --creation date 61 lc.created_by, --created by 62 'INVENTORY', --Receipt source Code 63 'INVENTORY', --Destination Type Code 64 'DELIVER' , --AUT Transact Code 65 'INVENTORY', --Source Document Code 66 msi.primary_uom_code , --Unit Of Measure 67 msi.inventory_item_id, --Item ID 68 msi.primary_unit_of_measure, --UOM COde 69 fnd.user_id, 70 V_A, --Shipment Header ID 71 V_B, --SHipment Line ID 72 82, --To Organization ID 73 'Brooklyn', --Sub Inventory ID 74 81, --From Organization 75 'Vessel' --From Subinventory 76 77 FROM 78 regal.regal_inv_landed_cost_tab lc, 79 fnd_user fnd, 80 mtl_system_items msi 81 82 WHERE 83 lc.organization_id = msi.organization_id 84 AND lc.inventory_item_id = msi.inventory_item_id 85 AND lc.created_by = fnd.created_by; 86 87 commit; 88 v_message := SQL%ROWCOUNT; 89 dbms_output.put_line('v_message'); 90 END; 91 / v_message PL/SQL procedure successfully completed. SQL> select * from rcv_transactions_interface; no rows selected
There is no problem with inserting data!
Only there is no data! This means that your select statement retrieves no rows.
You can see the output of your program (0). This means that there where no line in the result set.Please check the output of your tax return independently:
SELECT -- regal.regal_inv_landed_cost_seq.nextval, --Interface_transaction_id -- V_A, --Header Interface ID -- V_B, --Group ID 'Ship', --Transaction Type sysdate, --Transaction Date 'PENDING', --Processing Status Code 'BATCH', --Processing Mode Code 'PENDING', --Transaction Status Code lc.quantity_received, --Quantity lc.last_update_date, --last update date lc.last_updated_by, --last updated by sysdate, --creation date lc.created_by, --created by 'INVENTORY', --Receipt source Code 'INVENTORY', --Destination Type Code 'DELIVER' , --AUT Transact Code 'INVENTORY', --Source Document Code msi.primary_uom_code , --Unit Of Measure msi.inventory_item_id, --Item ID msi.primary_unit_of_measure, --UOM COde fnd.user_id, -- V_A, --Shipment Header ID -- V_B, --SHipment Line ID 82, --To Organization ID 'Brooklyn', --Sub Inventory ID 81, --From Organization 'Vessel' --From Subinventory FROM regal.regal_inv_landed_cost_tab lc, fnd_user fnd, mtl_system_items msi WHERE lc.organization_id = msi.organization_id AND lc.inventory_item_id = msi.inventory_item_id AND lc.created_by = fnd.created_by;
Published by: hm on 13.10.2011 23:19
I removed the references of the sequence and the variables V_A and YaeUb.
BTW: Why do you want to include V_A and YaeUb in two different columns?The use of sequences in your code seems a bit strange to me. But this has nothing to do with your question.
-
Doubt to the advanced multiple selection table
Hello
I use a table in my page.and I have several columns of the table selection.
I select several lines and inserts the data into another table.
My question is when I check the multiple select box and select lines it will redirect to another page.
and when I return to the selection page of that checkbox values are not resetting.it shows the same values.
Please let me know how to reset these values or how these values are not checked.
Thanks in advance
BharatBharat,
Attach a transitional attribute with Multiple selection... instead of any attribute associated with the table.
Kind regards
GYAN -
If I said PL/SQL table and populated with 10 values.
If I want to find a perticular values are in the list populated how can I find.say I have values from 1 to 10.
and I want to find if 9 is in the list.
I tried with loop. Is there another way. I use 10g.
declare
tr_nm number_array;
i the number;
Start
I'm in 1.10
loop
tr_nm.extend;
tr_nm (i): = i;
end loop;
for j from 1... tr_nm. Count
loop
If tr_nm (j) = 9 then
i: = i + 1;
end if;
end loop;
If i > 0 then
null;
end if;
end;Please try this code
Note: this code runs from 10 g.DECLARE type num_type is table of NUMBER; v_num_arr num_type; v_num number; v_var number :=9; BEGIN select level bulk collect into v_num_arr from dual connect by level <=10; dbms_output.put_line('Count - '||v_num_arr.count); if v_var member of v_num_arr then dbms_output.put_line('Found '); end if; END;
Maybe you are looking for
-
Cannot open a new tab (additional) today! What's up with that?
In this latest version, the "+" at the end of the line is no longer opens a new tab. Nothing happens except the screen that says it will open a new tab. I'm on version Beta 30 and who says that I am up to date. I thought I saw a 'flash' that 31 of th
-
Need information about type of screen for Satellite C50
Hello Wondering if anyone could help clarify what the situation is in what regards the matte and glossy screens on the series C50. Ideally, the specific model numbers say that I'd get a matte screen? and also ideally on Amazon UK for example regardin
-
Boolean personalized crosses on valves
Hello I would build two Boolean, for 6 or 4-way cross valve (shown in the attached picture). I tried to pull the two States of Boolean in the powerpoint then tried to import via the Clipboard in a custom of the ring/boolean control. Her resut is not
-
Write spreadsheet adds carriage return
I use the array build function to set up a number of channels and build an array of strings. The construction is in a time loop. A new row is added in the table to each loop. I use scripture to spread worksheet function to save the worksheet to a
-
64-bit Windows 8 pilots for dv7 - 4073 has
Hello I would like to know if there is no release date of my drivers for laptop for win8 - 64 bit I have a Pavilion dv7 - 4073ca and has recently upgraded to windows 8, and I will be forced to downgrade to windows 7 because I can't find the drivers i