unique records at random
HelloI need 6 unique random records from a table of query. Each record has a reference to an image, I am ulitmately want 6 images, but each must be unique and random.
Did anyone done this before? There is an available for this custom tag?
Thank you
Kiley
After help everybody I this Chuck of code in order to provide everyone who is facing the same question I did.
This provides a table with 6 elements of unique & random of the id of a table.
Thanks to everyone who helped me.
Tags: ColdFusion
Similar Questions
-
retriving of unique records on two columns
Hello world
Using sql query, that he must retrieve unique records on two columns.
Example of table source: raster columns [uwi, well_no]
Examples of data below
UWI well_no
----- --------
1 988311
1 988311
1 1032662
1 1032662
2 103
2 103
2 103
3
3 104
3 104
3 104
4 106
4 107
4
4 108
For a given
UWI: 1 there are 4 well_no which is having two distinct values where these documents I need to go get
UWI: 2 there are 3 well_no, all 3 well_no contains the same value as (103) Consequently, these documents should not seek
UWI: 3 there are 4 well_no (1 null and 3 values are the same (104)] where these records should not seek.)
UWI: 4 there are 4 well_no which is to have three separate with a single value zero so these 4 files, I need to get.
output:
UWI well_no
----- --------
1 988311
1 988311
1 1032662
1 1032662
4 106
4 107
4
4 108
Thank you
Jery
Hi, Michel,.
Whenever you have a question, please post CREATE TABLE and INSERT statements for your sample data, so people who want to help you can recreate the problem and test their ideas.
Format your message so that it is easy to read and understand.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum: https://forums.oracle.com/message/9362002
Maybe you want something like this, which shows information about the jobs that have deptnos 2 or more not NULL:
WITH got_cnt AS
(
SOME jobs, deptno
, ACCOUNT (SEPARATE deptno) RESUMED (work PARTITION) AS cnt
FROM scott.emp
)
SOME jobs, deptno
OF got_cnt
WHERE cnt > 1
;
-
Find a UNIQUE RECORD on both sides
Hi, I want to find a unique record that is either A or B who wants to tell A NOT IN B & B NOT in one, here is the sample data
IF the START_DATE_TIME differ in 1 second, they are considered the same record, example: 77777733, 77777733, 20120625001608 in one hand is the same as 77777733, 77777733, 20120625001607 B sideA side ----------- A_SUB_NUM B_SUB_NUM START_DATE_TIME SIDE 88912345 88912345 20120625000031 A 77777733 77777733 20120625001608 A 77777733 77777733 20120625000000 A B side ----------- A_SUB_NUM B_SUB_NUM START_DATE_TIME SIDE 88912345 88912345 20120625000022 B 88912345 88912345 20120625000028 B 88912345 88912345 20120625000031 B 77777733 77777733 20120625001607 B
Here is my code, however it didtn give me the expected result that 88912345 have not been filter :(
Here is the data dictionary( SELECT START_DATE_TIME ,A_SUB_NUM ,B_SUB_NUM ,SIDE FROM TEST_A t2 WHERE (A_SUB_NUM, B_SUB_NUM ) NOT IN (SELECT A_SUB_NUM, B_SUB_NUM FROM TEST_B where ( start_date_time > to_char(to_date(t2.START_DATE_TIME,'yyyyMMddhh24miss')-60/86400,'yyyymmddhh24miss') and start_date_time < to_char(to_date(t2.START_DATE_TIME,'yyyyMMddhh24miss')+60/86400,'yyyymmddhh24miss') ) ) ) UNION ALL ( SELECT START_DATE_TIME ,A_SUB_NUM ,B_SUB_NUM ,SIDE FROM TEST_B t1 WHERE (A_SUB_NUM, B_SUB_NUM) NOT IN (SELECT A_SUB_NUM, B_SUB_NUM FROM TEST_A where ( start_date_time > to_char(to_date(t1.START_DATE_TIME,'yyyyMMddhh24miss')-60/86400,'yyyymmddhh24miss') AND start_date_time < to_char(to_date(t1.START_DATE_TIME,'yyyyMMddhh24miss')+60/86400,'yyyymmddhh24miss') ) ) ) This is the result from the query START_DATE_TIME A_SUB_NUM B_SUB_NUM SIDE 20120625000000 77777733 77777733 A Expected result should be START_DATE_TIME A_SUB_NUM B_SUB_NUM SIDE 20120625000000 77777733 77777733 A 20120625000022 88912345 88912345 B 20120625000028 88912345 88912345 B
Appreciate your help :)CREATE TABLE TEST_A (A_SUB_NUM VARCHAR2(50), B_SUB_NUM VARCHAR2(50), START_DATE_TIME VARCHAR(50), SIDE VARCHAR2(2) ); CREATE TABLE TEST_B (A_SUB_NUM VARCHAR2(50), B_SUB_NUM VARCHAR2(50), START_DATE_TIME VARCHAR(50), SIDE VARCHAR2(2) ); INSERT INTO TEST_B VALUES ('88912345' , '88912345' , '20120625000022', 'B'); INSERT INTO TEST_B VALUES ('88912345' , '88912345' , '20120625000028' , 'B'); INSERT INTO TEST_B VALUES ('88912345' , '88912345' , '20120625000031', 'B'); INSERT INTO TEST_B VALUES ('77777733' , '77777733' , '20120625001607', 'B'); INSERT INTO TEST_A VALUES ('88912345' , '88912345' , 20120625000031, 'A'); INSERT INTO TEST_B VALUES ('77777733', '77777733', 20120625000000, 'A'); INSERT INTO TEST_B VALUES ('77777733' , '77777733' , 20120625001608, 'A');
Hello
First of all, I want to note that there is a typing error in the last one you gave instructions insert. Instead of INSERT INTO TEST_B
VALUES ('77777733', '77777733', 20120625000000, ' A'), you probably want to post INSERT INTO TEST_A
VALUES ('77777733', '77777733', 20120625000000, ' A') and also instead of INSERT INTO TEST_B
VALUES ('77777733', '77777733', 20120625001608, ' A'), you probably want to post INSERT INTO TEST_A
VALUES ('77777733', '77777733', 20120625001608, ' A').Here is a solution to your problem:
select * from test_a; A_SUB_NUM B_SUB_NUM START_DATE_TIME SIDE -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---- 88912345 88912345 20120625000031 A 77777733 77777733 20120625000000 A 77777733 77777733 20120625001608 A select * from test_b; A_SUB_NUM B_SUB_NUM START_DATE_TIME SIDE -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---- 88912345 88912345 20120625000022 B 88912345 88912345 20120625000028 B 88912345 88912345 20120625000031 B 77777733 77777733 20120625001607 B select * from test_a where not exists (select * from test_b where abs(to_number(test_b.start_date_time) - to_number(test_a.start_date_time) ) <= 1 ) union select * from test_b where not exists (select * from test_a where abs(to_number(test_a.start_date_time) - to_number(test_b.start_date_time) ) <= 1 ) ; A_SUB_NUM B_SUB_NUM START_DATE_TIME SIDE -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---- 77777733 77777733 20120625000000 A 88912345 88912345 20120625000022 B 88912345 88912345 20120625000028 B
-
extraction of unique records of registration of two different tables
Hello
In the following two tables different www.testing.com code exists in both tables. I want to compare two different columns from two different tables for unique records.
Thank you and best regardsSQL> select unique(videoLinks) from saVideos where sa_id=21; VIDEOLINKS ----------------------------------------------------------------------- www.testing.com SQL> ed Wrote file afiedt.buf 1* select unique(picLinks) from saImages where sa_id=21 SQL> / PICLINKS ----------------------------------------------------------------------- test test14 www.hello.com www.testing.com
Try
Select unique (videoLinks) in the saVideos where sa_id = 21
Union
Select unique (picLinks) in the saImages where sa_id = 21 -
How to retrieve unique records with multiple columns
I have a sps_prod table as described below-
POGNAME VARCHAR2 (1500)
INDEX #VERSION VARCHAR2 (200)
POG_MODEL_STATUS VARCHAR2 (100)
POG_LAYOUT_TYPE VARCHAR2 (500)
POG_MARKET_SPECIFIC VARCHAR2 (500)
POG_CONTACT_NUMBER VARCHAR2 (100)
AREA_SUPPORTED VARCHAR2 (500)
POG_COMMENTS VARCHAR2 (1500)
POG_FOOTER_COMMENTS VARCHAR2 (1500)
POG_ELECTRICAL_LIST_1 VARCHAR2 (1500)
POG_ELECTRICAL_LIST_2 VARCHAR2 (1500)
POG_CARPENTRY_1 VARCHAR2 (1500)
POG_CARPENTRY_2 VARCHAR2 (1500)
INSTALLATION_INSTRUCTION_1 VARCHAR2 (1500)
INSTALLATION_INSTRUCTION_2 VARCHAR2 (1500)
FIXTURE_REORDER_NUMBER VARCHAR2 (200)
FIXTURE_ID VARCHAR2 (200)
FIXTURE_NAME VARCHAR2 (500)
FIXTURE_IMAGE VARCHAR2 (500)
PART_REORDER_NUMBER_9 VARCHAR2 (500)
PART_FIXTURE_ID_9 VARCHAR2 (500)
PART_FIXTURE_NAME_9 VARCHAR2 (500)
PART_FIXTURE_IMAGE_9 VARCHAR2 (500)
UPC VARCHAR2 (50)
ITEM_NUMBER VARCHAR2 (50)
DESCRIPTION VARCHAR2 (700)
MERCH_TYPE VARCHAR2 (20)
HEIGHT VARCHAR2 (100)
WIDTH VARCHAR2 (100)
DEPTH VARCHAR2 (100)
DATE OF CREATE_TS
There are 4 million records in it and many with the same combination of POGName, #Version, POG_Model_Status, POG_Layout_Type, POG_Market_Specific, POG_Contact_Number and Fixture_Name Index. How do the records to retrieve all the columns above, but with a unique combination of fixture_name and reorder_number. It has no keys defined on the table.
I guess that it is a simple problem but the fact I'm trying to retrieve all the columns I'm stumbling.
Thanks in advance.Hello
Sanders_2503 wrote:
... There are 4 million records in it and many with the same combination of POGName, #Version, POG_Model_Status, POG_Layout_Type, POG_Market_Specific, POG_Contact_Number and Fixture_Name Index. How do the records to retrieve all the columns above, but with a unique combination of fixture_name and reorder_number.I don't see a column named reorder_number. Do you mean fixture_reorder_number or part_reorder_number_9?
So, you want only one row for each distinct combination of fixture_name and some other column (I'll assume it's fixture_reorder_number). Does it matter which line? They will not necessarily have the same values for the other columns.
The following query returns the one with the first pogname (in sort order):WITH got_r_num AS ( SELECT pogname, index#version, pog_model_status, pog_layout_type , pog_market_specific, pog_contact_number, fixture_name , ROW_NUMBER () OVER ( PARTITION BY fixture_name , fixture_reorder_number ORDER BY pogname ) AS r_num FROM sps_prod ) SELECT pogname, index#version, pog_model_status, pog_layout_type , pog_market_specific, pog_contact_number, fixture_name FROM got_r_num WHERE r_num = 1 ;
If there be a tie (i.e. two or more lines with the same fixture_name, fixture_number and pogname first) and then the will be chosen arbitrarily.
Instead of "ORDER BY pogname", you can ORDER all the other columns OR expressions, but you must have an ORDER byclause of analytics. You can do "ORDER BY NULL" If you really want pcik an arbitrary line.
I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and also publish the results you want from these data (or some examples of acceptable results).
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using. -
Verification of image recording PHP random code
I saw on many pages of record now a character using random set - converted to an image that users must enter to check that they are not a robot of auto-fill.
On a registration of php page (insert recording), does anyone know how to do this?
I use DW and I guess its something to do with a generator of random numbers with a swf converter...?On Wednesday, April 4, 2007 11:07:37 + 0000 (UTC), "RichardODreamweaver".
wrote: > I've seen on many pages of record now the use of a set of random characters.
> converted to an image that users will type to check that they are not a
> automatic filling robot.
>
> On a php registration page (insert recording), does anyone know how to do this?
>
> I use DW and I guess its something to do with a random number generator
> with a swf... Converter?Do a Google search for tutorials php captcha
--
Steve Fleischer
Steve at flyingtigerwebdesign dot com
Hong Kong -
selection of unique records-remove consecutive same data
Hello
I meet a table where in some cases x, y, msg_date_info fields are there... here, data are in large numbers... I need to recover the data in this table under the condition of the query.
It works very well...SELECT X longit,Y latit,MSG_DATE_INFO,row_number() over (order by MSG_DATE_INFO asc) SlNo FROM (SELECT distinct x,y,MSG_DATE_INFO,row_number() over (order by MSG_DATE_INFO desc) r FROM TRACKING_REPORT WHERE MSISDN='123456789') WHERE R between 1 and 20
Here again one thing I want to add up... this request leads to 20 rows as expected and I want to filter the records so consecutive x and y values of these lines are the same and give only unique values of x and y (provided that the same x and y can be there somewhere in the order of the data).
This example shows what are my needs in detail... and this is the output of the above query
>
80.20550609 13.09469998 8 March 10 19:23:23 1
80.20550609 13.09469998 8 March 10 19:28:37 2
80.20087123 13.09437811 8 March 10 19:33:25 3
80.20550609 13.09469998 8 March 10 19:38:24 4
80.20550609 13.09469998 8 March 10 19:43:25 5
80.20550609 13.09469998 8 March 10 19:48:25 6
80.20087123 13.09437811 8 March 10 19:53:25 7
80.20087123 13.09437811 8 March 10 19:58:24 8
80.20550609 13.09469998 8 March 10 20:03:25 9
80.20087123 13.09437811 8 March 10 20:08:24 10
80.20550609 13.09469998 8 March 10 20:13:24 11
80.20087123 13.09437811 8 March 10 20:18:37 12
80.20550609 13.09469998 8 March 10 20:23:32 13
80.20550609 13.09469998 8 March 10 20:28:25 14
80.20550609 13.09469998 8 March 10 20:33:23 15
80.20550609 13.09469998 8 March 10 20:38:24 16
80.20550609 13.09469998 8 March 10 20:43:24 17
80.20550609 13.09469998 8 March 10 20:48:24 18
80.20550609 13.09469998 8 March 10 20:53:22 19
80.20550609 13.09469998 8 March 10 20:58:24 20
>
This out, I need to filter the unique ROW values x and y and the output should be like
>
80.20550609 13.09469998 03/08/10 19:23 1
80.20087123 13.09437811 03/08/10 19:33 3
80.20550609 13.09469998 03/08/10 19:48 6
80.20087123 13.09437811 03/08/10 19:53 7
80.20550609 13.09469998 03/08/10 20:03 9
80.20087123 13.09437811 03/08/10 20:08 10
80.20550609 13.09469998 03/08/10 20:13 11
80.20087123 13.09437811 03/08/10 20:18 12
80.20550609 13.09469998 03/08/10 20:58 20
>
How to go about this requirement?
Edited by: Aemunathan 9 March 2010 17:45The following gives the same results on your test data, but perhaps it's more accurate because seeks two changes in x and y:
SQL> with mytab as ( 2 select 80.20550609 x, 13.09469998 y, '08-Mar-10 19:23:23' mydate, 1 rn from dual union 3 select 80.20550609,13.09469998, '08-Mar-10 19:28:37', 2 from dual union 4 select 80.20087123,13.09437811, '08-Mar-10 19:33:25', 3 from dual union 5 select 80.20550609,13.09469998, '08-Mar-10 19:38:24', 4 from dual union 6 select 80.20550609,13.09469998, '08-Mar-10 19:43:25', 5 from dual union 7 select 80.20550609, 13.09469998, '08-Mar-10 19:48:25', 6 from dual union 8 select 80.20087123, 13.09437811, '08-Mar-10 19:53:25', 7 from dual union 9 select 80.20087123, 13.09437811, '08-Mar-10 19:58:24', 8 from dual union 10 select 80.20550609, 13.09469998, '08-Mar-10 20:03:25', 9 from dual union 11 select 80.20087123, 13.09437811, '08-Mar-10 20:08:24', 10 from dual union 12 select 80.20550609,13.09469998, '08-Mar-10 20:13:24', 11 from dual union 13 select 80.20087123, 13.09437811, '08-Mar-10 20:18:37', 12 from dual union 14 select 80.20550609, 13.09469998, '08-Mar-10 20:23:32', 13 from dual union 15 select 80.20550609, 13.09469998, '08-Mar-10 20:28:25', 14 from dual union 16 select 80.20550609, 13.09469998, '08-Mar-10 20:33:23', 15 from dual union 17 select 80.20550609, 13.09469998, '08-Mar-10 20:38:24', 16 from dual union 18 select 80.20550609, 13.09469998, '08-Mar-10 20:43:24', 17 from dual union 19 select 80.20550609, 13.09469998, '08-Mar-10 20:48:24', 18 from dual union 20 select 80.20550609, 13.09469998, '08-Mar-10 20:53:22', 19 from dual union 21 select 80.20550609, 13.09469998, '08-Mar-10 20:58:24', 20 from dual 22 ) 23 select x, y, mydate, rn from ( 24 select x, y, mydate, rn, nvl(lead(x) over (order by rn),0) next_x 25 , nvl(lead(y) over (order by rn),0) next_y 26 from mytab 27 ) where next_x != x or next_y != y; X Y MYDATE RN -------------------- -------------------- ------------------ -------------------- 80.20550609 13.09469998 08-Mar-10 19:28:37 2 80.20087123 13.09437811 08-Mar-10 19:33:25 3 80.20550609 13.09469998 08-Mar-10 19:48:25 6 80.20087123 13.09437811 08-Mar-10 19:58:24 8 80.20550609 13.09469998 08-Mar-10 20:03:25 9 80.20087123 13.09437811 08-Mar-10 20:08:24 10 80.20550609 13.09469998 08-Mar-10 20:13:24 11 80.20087123 13.09437811 08-Mar-10 20:18:37 12 80.20550609 13.09469998 08-Mar-10 20:58:24 20 9 rows selected.
Max
http://oracleitalia.WordPress.com -
Stop recording at random. Video is damaged.
I used my camera to record myself riding a motorcycle. Whenever I stopped my bike to check the camera, I noticed that the camera turns off automatically. I kept pushing the record button but got the same result throughout the day. I went home in the hope that some of my day was taken a picture. They were priceless memories that I can't come back. When I tried to grab the videos, they are all corrupt and not recognized by my computer with the exception of a few short test videos, I took at the stop.
I have a Sandisk Ultra 32 GB microSDHC memory card class 10. I have the camera mounted on my motorcycle with Ram Mount hardware.
Why my camera do this? What can I do to correct and prevent this problem?
-
convert multiple records of unique records...
can someone help pls to convert this two records into one record for each account?
Here is the table. For each account, there will be two records for two dates.
It is to say, opening date and closing with the opening and the closing balance.
I want to appear as a single record.
the opening balance will be the least date and next day will be the closing balance.
Note: If there is there is only one record for an account, then this would be considered
date of opening and the opening balance. date and closing balance sheet will be null.
Oracle 11g
CREATE TABLE TEST2 ( RECORD_TYPE VARCHAR2(5 BYTE), ACCOUNT_NO VARCHAR2(12 BYTE), BALANCE_DATE DATE, SD_BALANCE NUMBER(18,4) ); SET DEFINE OFF; Insert into TEST2 (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE) Values ('ABAL', '0105070411', TO_DATE('02/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -6611663.15); Insert into TEST2 (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE) Values ('ABAL', '0105070411', TO_DATE('02/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -6611663.15); Insert into TEST2 (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE) Values ('ABAL', '0105071013', TO_DATE('02/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -1321170); Insert into TEST2 (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE) Values ('ABAL', '0105071013', TO_DATE('02/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), -1321170); Insert into TEST2 (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE) Values ('ABAL', '0106071012', TO_DATE('02/02/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1321170); Insert into TEST2 (RECORD_TYPE, ACCOUNT_NO, BALANCE_DATE, SD_BALANCE) Values ('ABAL', '0106071012', TO_DATE('02/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1321170); COMMIT; I am looking for record_type account_no opening_date opening_balance closing_date closing_balance ABAL 0105070411 20100201 -6611663.15 20100202 -6611663.15 ABAL 0105071013 20100201 -1421173 20100202 -1321170 ABAL 0106071012 20100201 1341170 20100202 1321170
select record_type, account_no, min(BALANCE_DATE) opening_date, min(SD_BALANCE) opening_balance, max(BALANCE_DATE) closing_date, max(SD_BALANCE) closing_balance from test2 group by record_type, account_no;
-
I don't really know how to put this, so I'll link a picture to it. When you look at the picture I've locked the folders that were not originally there. I don't know if you can see how those that I converted (boxed) is more light or transparent. All of a sudden they just released. I don't want to remove them because I don't know if I might need it. It also gives me this error code. Thanks for your help!
Link:
http://Tinypic.com/usermedia.php?UO=dSQmRIlC78vNXtvYSlZar4h4l5k2TGxcHello
To add some excellent information from Steve:
Some people are virtual folders.
A thorough review of the virtual folders
http://articles.TechRepublic.com.com/5100-10878_11-5893800.htmlVirtual folders
http://www.winsupersite.com/showcase/winvista_virtualfolders.aspResearch of virtual folders
http://www.computerperformance.co.UK/Vista/vista_virtual.htm
I hope this helps.
Rob - bicycle - Mark Twain said it is good. -
I have two tables.
Table A table B
---------------------- ----------------------------------
Fund Dept Fund Dept
1 2 1 3
1 3 1 4
1 4 1 2
1 5 1 6
In the tables above, trying to get the column Dept of Table B which is not A Fund = 1 table.
For example, if I select Fund = '1', then I should get the Dept = 6 suite, because this department code is not in A table.
I tried some queries, but I always end up with a Cartesian product. Can you please help me.
Thank you.
Select dept
from tableb
where finance = 1
less
Select dept
from tablea
where finance = 1
/
SY.
-
Have unique records in the table
Hello
I have this code I'm trying to make sure my table (MESSAGES) has no PASSPORTNO double and CUSTOMER_ID. Here is my code:
I got and error:DECLARE CURSOR C6 IS SELECT PASSPORTNO,CUSTOMER_ID,AMOUNT FROM MESSAGES; BEGIN for c2_rec2 in C2(i.passportno) loop DBMS_OUTPUT.PUT_LINE(i.passportno||' '||i.customer_id||' '||c3_rec.AMOUNT); for c4_rec in C4(i.passportno) loop FOR C5_REC IN C5(C4_REC.CUSTOMER_ID) LOOP IF (C6%FOUND) then if C6.PASSPORTNO (NOT EQUALS symbol) i.passportno and C6.CUSTOMER_ID (NOT EQUALS symbol) i.customer_id then INSERT INTO MESSAGES (PASSPORTNO,CUSTOMER_ID,AMOUNT) VALUES (I.PASSPORTNO,C4_REC.CUSTOMER_ID,C5_REC.AMOUNT); else DBMS_OUTPUT.PUT_LINE('DUPLICATE VALUES IN MESSAGES TABLE'); END IF; END IF;
PLS-00225: subprogram or cursor "C6" reference is out of reach
How am I suppose to change my code?hi lee, if you are using cursor for loop, you dont need %found, further more you dont open cursor c6, you can only find cursor c6 when you open it also in dont understand what you trying to do here, if C6.PASSPORTNO i.passportno and C6.CUSTOMER_IDi.customer_id theninsert , as per my understanding code should look like this, c2, c5 and c6 should be parameterized cursor for c2_rec2 in C2(i.passportno) loop DBMS_OUTPUT.PUT_LINE(i.passportno||' '||i.customer_id||' '||c3_rec.AMOUNT); for c4_rec in C4(i.passportno) loop FOR C5_REC IN C5(C4_REC.CUSTOMER_ID) LOOP for c6_rec in c6 (your parameter) loop INSERT INTO MESSAGES (PASSPORTNO,CUSTOMER_ID,AMOUNT) VALUES (I.PASSPORTNO,C4_REC.CUSTOMER_ID,C5_REC.AMOUNT);end loop for c6;
-
How to insert unique random values in 2 columns?
I have a table with 2 columns
Create table code_for_code)
first_code varchar2 (10) unique not null,.
second_code varchar2 (10) not null unique);
and I want to make PL/SQL code to Insert unique values at random in two columns , for example 20 record... How can I do something like that?DECLARE i NUMBER := 0; BEGIN LOOP INSERT INTO code_for_code SELECT first_code, second_code FROM (SELECT DBMS_RANDOM.STRING ('U', 20) first_code, DBMS_RANDOM.STRING ('U', 20) second_code FROM DUAL) a WHERE NOT EXISTS ( SELECT 1 FROM code_for_code WHERE first_code = a.first_code AND second_code = a.second_code); i := i + 1; EXIT WHEN i >= 20; END LOOP; COMMIT; END;
-
Dear all,
I would be happy to know if you have an experience to enable true single record ownership for data blocks. It works for basic blocks, but I need to work also for data blocks. The compiler ignores this property when I run. I would like to enable this property for forms including the unique records. I don't like not up/down cursor moves to a different record in a single registration form. So, if no other alternative is available by you, I would be happy to hear it too.
Thanks for the answers in the future,
MERICAnother possibility is to disable all keyboard actions (by putting the NULL; in the case KEY-triggers) that can be used to navigate to the second record, as
KEY-NXTREC
KEY-NXTSET
KEY PRESS
KEY-CREREC
KEY-DELREC -
How to insert huge records in the table for the practice.
Hello
I created a new database in my personal inbox. Now, I want some specimen for different practical feature of oracle 10g. I need at least 1,00,000 records with different lines and columns.
any buddy tell me of any request or package that can create the table and insert unique records in this table.
Looking for valuable advice.
Thank youCan be dbms_random.string, dbms_random.value and dbms_random.random can help.
Maybe you are looking for
-
Why my iTunes account list all applications that I have or that you have already installed?
-
I received this message. Possible reasons: Measurements: Attempted to write a sample beyond the final sample generated. The build is stopped, so the sample specified by the combination of the position and the offset is never available. Specify a loca
-
Deleting email alternative: hotmail
How can I remove an alternative email on my hotmail account account once its been placed there by a pirate. Someone has accessed my account and inserted an alternative email account. I tried to delete it, but as hotmail pressumes you put it there, it
-
OK here is the problem, when I start my computer after that it loads it goes directly to the black screen where it asks u want to start windows normally safe mode and etc, but when I press on start normally it goes to another screen so I'm going alon
-
How to get email addresses in the device?
Hello I want to retrieve the list of email accounts in the unit. foreach (const Account &account, m_accountList){ if (!account.provider().name().toUpper().contains("SMS") && !account.provider().name().toUpper().contains("PIN")) { const QString name =