Forms :: How To Generate Serial Number

Aug 23, 2011

how do you generate serial numbers? i have an invoice where i have to add items, so i want the numbering to start from 1 everytime i start a new form and increment by 1 as i i enter a new record. For this i have put my code in when-new-record-instance but problem is if i delete a record and enter a new one, the serial number starts from the nex number.

For ex. if i have 4 items with serial numbers 1, 2, 3, 4 and i delete the item at no. 3 and add a new item , the serial number comes as 5.

proper code to generate the serial numbers?

View 7 Replies


ADVERTISEMENT

Forms :: Generating Sequence - Get Serial Number?

Dec 21, 2011

i want to get serial numbers in oracle forms. i have one data block with 10 rows and a non database display item with corresponding length as that of the original data block .

when ever i am executing the form i want to see the serial number generated in the display item and when i inserted a new item or row it should show the corresponding rownum.

eg:

empno name serialno
5 tom 1
4 tinil 2
6 sofy 3
7 john 4
1 albert 5
2 michel 6

i want to get the above answer using forms.

View 7 Replies View Related

Forms :: Serial Number In Tabular Style Form?

Feb 9, 2010

I need Sequence generate in each row in tabular style form

Like

FA0015
FA0016
FA0017

(I dont want to use sequence because when i delete the row its conceder delete row in sequence )

View 4 Replies View Related

Forms :: Applying Serial Number In Detail Block

Sep 5, 2011

I have form with master detail relation ship (invoicing form) the detail block is tabular, displaying upto 7 records...

Now my clients wants to show the serial number along with each record while feeding the data (this includes when insert, editing, deleting / clearing records) he wants to see the serial number as in MS access / MS techniques.

I tried to use the system variable to use :system.cursor_record; but this dose not works.(in insert/edit/delete/clear record)

View 5 Replies View Related

Forms :: Simple Data Block - Serial Number Generation

Jun 2, 2010

I have created simple data block by wizard and taken tabular layout 10 rows and 6 columns

i want to generate serial number on first column .....

what need to use..?

View 11 Replies View Related

SQL & PL/SQL :: How To Get Serial Number

Mar 12, 2013

I have following table.

CREATE TABLE ABC
(
DPT_NUM NUMBER,
LOT_NUM NUMBER,
ASSOCIATED_WITH_LOT NUMBER
);
SET DEFINE OFF;
Insert into ABC
[code]......

Now i run follwoing query and result is

select * from abc
DPT_NUMLOT_NUMASSOCIATED_WITH_LOT

1501
1502501
1509501
1511
1503
1516
1522
1565
1569565
2601
2602
2604602
2607
2508

I need following result

DPT_NUMLOT_NUMASSOCIATED_WITH_LOT Serial_Number

1501 1
1502501 2
1509501 2
1511 3
1503 4
1516 1
1522 2
1565 3
1569565 3
2601 1
2602 2
2604602 2
2607 3
2508 3

Note that serial number must reset after each 4 lot_num againt dpt_num. Not that where lot is associated in associated_with_lot there serial number must be same as serial number is for associated lot.

View 7 Replies View Related

SQL & PL/SQL :: How To Maintain Serial Number

Aug 4, 2012

I have one table as per the attachment, with id(Primary key),level,name and Srno.Now I want to maintain Sr. if user transfers level 2 of one block (level 1) to another block.is it possible through any oracle function.

View 8 Replies View Related

PL/SQL :: Serial Number - Translate ID From TBL-ID2 To TBL-ID?

Jun 30, 2012

I have two tables,

CREATE TABLE TBL_ID(
SERIAL NUMBER(3),
ID NUMBER(5));
CREATE TABLE TBL_ID2(
ID NUMBER(5));

[code]...

I want translate id from TBL_ID2 to TBL_ID, and make new serial as  max serial + 1 I tried

insert into TBL_ID(serial,id)
select (select max(serial) + 1 from ),id from TBL_ID2
Desired Output after insert
select * from TBL_ID

SERIAL   ID
------   --
1        10
2        20
3        50
4        60
5        90

View 3 Replies View Related

SQL & PL/SQL :: Get Desire Serial Number?

Jul 31, 2013

I have follwoing Table

create table abc( prd_cod number,tax_num number, tkt_num number,shd_cod number,cnt_num number,ctn_num number);
Insert into ABC(PRD_COD, TAX_NUM, TKT_NUM, SHD_COD, CNT_NUM, CTN_NUM) Values (1, 1, 1, 1, 1, 1);
Insert into ABC(PRD_COD, TAX_NUM, TKT_NUM, SHD_COD, CNT_NUM, CTN_NUM) Values (1, 1, 1, 1, 2, 1);
Insert into ABC(PRD_COD, TAX_NUM, TKT_NUM, SHD_COD, CNT_NUM, CTN_NUM) Values (1, 1, 1, 2, 1, 1);

[code]...

Now i have following data

PRD_CODTAX_NUMTKT_NUMSHD_CODCNT_NUMCTN_NUM

111111
111121
111211
112111
151211
211111

I need to query above data with a column "Srl_Num". Its serial number and serial should like 'AA1','AB1'. In serial number is last digit 1 is "Ctn_Num" Column Value. First Letter 'A' of serial number is 'A' and second letter of serial number will change. When it reaches till 'Z' Then first letter will change.I mean if serial number is 'AZ1' Then next serial number will be 'BA1','BB1','BC1' and so on.

I need query to show data like

Srl_Num PRD_CODTAX_NUMTKT_NUMSHD_CODCNT_NUMCTN_NUM

AA1 111111
AB1 111121
AC1 111211
AD11 12111
AE1 151211
AF1 211111

View 3 Replies View Related

How To Print Sql Query With Serial Number

Mar 27, 2007

How can i print serial no of records in sql query? I know I can achieve this with selecting rownum but it gives wrong data if used with group by like below

select rownum,deptid from emp group by rownum,deptid order by rwnum

View 2 Replies View Related

SQL & PL/SQL :: How To Generate Number (not Sequence Number) In Query

Mar 9, 2011

I have the following select query that works perfectly fine. Returns 25 rows based on the descending order of the price.But, I want add one more expression to this list of columns in this query (apart from customer_id).

the expression should look like Cust-01 for the first customer from the below query all the way to Cust-25 for the last customer.But how can I can generate 01 to 25 in oracle?

select customer_id from
(select customer_id from capitalPLAN
where member_status = 'MEMBER' AND customer_id NOT in ('156','201','1385','2125','3906','165')
order by price desc
)
where rownum <= 25

View 4 Replies View Related

SQL & PL/SQL :: Random Number Generate

Jul 6, 2010

I have 2 question....

1. i have a table and i want to pick data from one field randomly..

i write this query for this purpose...

SELECT SUBJECTIVE_QUES_PK FROM
(SELECT SUBJECTIVE_QUES_PK FROM PMS.SUBJECTIVE_QUES
ORDER BY SYS.DBMS_RANDOM.VALUE)
WHERE QUES_TYPE_FK=3
AND ROWNUM<=5;

2. can i write this query in forms 6i..

i know that this question not relevant but if i write it in forms section then i will be duplicate.

View 27 Replies View Related

Forms :: Read Data From Serial Port?

Jun 16, 2004

I'm trying to read some data from external device via COMM Port.

Application is running n server and device is connected localy on my PC.

My device iz DPI605R for purpose of� pressure measuring.

View 6 Replies View Related

Forms :: Communication With Serial Device (via COM1)

Jan 3, 2012

Is it possible to communicate with a serial device (via COM1) with oracle forms / webutil? I am able to communicate in java using RXTXcomm, but I am having problems making a bean that uses it (getting security errors and yes, I have signed the jars).

Basically, I have a scale hooked up to my COM1 port and want to be able to send commands (zero and tare) to it and read the weight from it through a form or java bean.

View 5 Replies View Related

PL/SQL :: Generate Unique Number Without Sequence?

Feb 13, 2013

I need generate an unique number without sequence. I am using Oracle 11.2, here is the details. The column idSeq is unique withing one specific idType. I don't want a sequence for each idType.

create table tb_test (idSeq number(5), idType number(5), addr varchar2(256));

insert into tb_test
(select case when idSeq is null then 1 else max(idSeq)+1 end, 3, 'Main street');

I am having ORA-00937 : not a single-group group function error

View 23 Replies View Related

Forms :: Transfer Data From Oracle 9i To Serial Port?

Feb 14, 2012

I want to transfer data from Oracle form 9i to serial port.

Serial port is connected to electric board to show.

View 2 Replies View Related

SQL & PL/SQL :: Generate PAN Number By Concatenation Of Data From Different Tables?

Jul 11, 2011

How to generate a PAN number by concatenation of data from different tables

View 3 Replies View Related

SQL & PL/SQL :: Reference Cursor To Generate Sequence Number

Apr 1, 2013

I want the query to generate the sequenctial number from 1 for the new financial year in some query.

View 6 Replies View Related

Forms :: Communication Form Serial / Parallel Port Via Oracle?

Jun 14, 2005

I want to connect a biometric device with my system, through serial port / parallel port. And want to permit only valid users to the system.

View 18 Replies View Related

Generate Random And Unique 6 Digit Number In Oracle

Sep 29, 2008

I need to generate random and unique 6 digit number in Oracle. I need to insert these numbers into a table. I tried using DBMS_RANDOM package, which generates random 6 digit numbers, but fails to generate UNIQUE numbers.

View 3 Replies View Related

SQL & PL/SQL :: Performance To Generate Auto-increment Number In Oracle

Jun 16, 2010

which method is more efficient in terms of performance to generate an auto increment number in oracle.

Step1

CREATE TABLE test
(id NUMBER PRIMARY KEY,
name VARCHAR2(30));

Step2
CREATE SEQUENCE test_sequence
START WITH 1
INCREMENT BY 1;
[code]....

View 22 Replies View Related

SQL & PL/SQL :: Generate The Number Of Rows Based On Table Field?

Mar 29, 2013

generate the number of rows based on table field.

Sample code is given below.

CREATE TABLE T
(
docno VARCHAR2(10),
CODE VARCHAR2(8),
QTY NUMBER(3)
)
LOGGING

View 4 Replies View Related

SQL & PL/SQL :: Generate Range Based On Start And End Number Dynamically?

Jul 14, 2011

I have following requirement. Let say i have to generate a range based on "start number" and "end number" dynamically.Some kind of hash buckets.

e.g Start Number : 1 and End Number : 1001.

Also i want to divide that range based on some dynamic value like for above example 10 ranges of 100 each. and both 1 and 1001 should be included only once and the next row start number cannot be same as previous row end number.

Means

Range 1 1 -101
Range 2 102-200
Range 3 201-300
...
Range 10 901-1001

Is there any way of doing it automatically. I tried with Model clause. it works fine for even cases but for odd i have issues also when i take small start and end number i get an error.

SELECT case when ranges=1 then ranges else ranges+1 end Start_Id, ranges+round((1001-1)/10) End_Id
from
(

[Code].....

I want this to be generic for any values here 1 is Start Number 1001 is end number and 10 is the bucket. I need these parameters dynamic and want's the same kind of results for any values.

View 22 Replies View Related

PL/SQL :: How To Generate Large Random Number Without Decimal Places

Nov 5, 2012

I need to generate random numbers from the range 71 million to 90 million. While generatind the same iam getting the value with decimal places.

How to generate with out decimal places ?

SQL> select ABS(dbms_random.value(71000000,90000000)) from dual;
ABS(DBMS_RANDOM.VALUE(71000000,90000000))
-----------------------------------------
87283730.7

View 6 Replies View Related

SQL & PL/SQL :: Generate Hourly Based Number Of Orders Placed Report

Oct 11, 2011

I have a table called 'orders' and having date and time of order placed in the field timeplaced. I need to generate a report which is having hourly based number of orders placed . If no order is placed in an hour then it should show 0 for that hour in the result .

create table orders (order_id integer, timeplaced date,last_updated date);
Insert into ORDERS
(ORDER_ID,
TIMEPLACED, LAST_UPDATED)
Values
(1, TO_DATE('10/11/2011 12:53:39', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('10/11/2011 10:53:39', 'MM/DD/YYYY HH24:MI:SS'));
[code]........

But I need the result for all the 24 hours. Actually row for the hour 1,2,3,4,5,6,8,9,13-23 are not present in the DB

TO_CHAR(TIMEPLACED,'HH')COUNT(*)

00
10
20
30
40
50
60
71
80
90
102
111
122
130
140
150
160
170
180
190
200
210
220
230

View 3 Replies View Related

Forms :: Restrict User To Enter Serial Numbers Of Product In 3 Level Block

Apr 24, 2012

I have a sale invoice form with 3 data blocks.

Data block 1- master_blk : For date/customer of sale invoice
Data block 2- detail_blk1 (detail of the master block - For products and qty)
Data block 3- detail_blk2 (detail of DETAIL_BLK1 For entering serial numbers of products)

My requirement is that whatever quantity user enter in data block 2 against each product he must enter equal number of serial numbers of that product in data block 3.

For this I have created on item (cnt_iteml : to count product's serial numbers in block3 ) in data block 2, and on summary item (t_serial_no ) in block3.

Whenever user changes in quantity, cnt_iteml: item is populated with t_serial_no in block3 of that product by following trigger on quantity column.

POST-Change Trigger ( quantity column )

:stock_transactions.cnt_itl:=:serial_numbers.t_serial_no;

Following trigger is written on block level at data block-3 to populate cnt_iteml with t_serial_no.
PRE-RECORD

IF GET_BLOCK_PROPERTY('SERIAL_NUMBERS',STATUS) IN ('CHANGED') THEN
:stock_transactions.cnt_itl:=:serial_numbers.t_serial_no;
END IF;

Above triggers are fulfilling my requirement except following condition.

If user after entering serial numbers in block 3 and without saving goes back to block2 and try to navigate to another record he gets a message asking him to save changes by forms. At this time if user presses no then cnt_itl item is not been populated with t_serial_no item's value.

What I want in above condition is that if user was inserting new record cnt_it item should be populated with 0, so that he shouldn't be able to save this record. And If he was updating then cnt_itl item should be populated with actual no of records in database against that product.

View 2 Replies View Related

Forms :: Generate Bar Code In 6i?

Nov 2, 2011

i want to generate bar code in forms 6i but i don't know the code.

View 3 Replies View Related

Forms :: How To Generate Excel In Oracle 11g

May 4, 2012

I had a form in oracle 6i with which I can generate an excel sheet when clicked a button(by using ole2 built in)...this form I have converted to oracle forms 11g and replaced the ole2 with client_ole2 and added webutil library...but the excel is not generated as in 6i.

View 1 Replies View Related

Forms :: How To Generate XML Data Of SQL Query Through 10g

Jul 19, 2013

I have got requirement to generate a .XML format of a select query in a particular folder in server. The XML coding of a select query i got through DBMS_XMLGEN.getXML package.

SELECT DBMS_XMLGEN.getXML('SELECT * FROM EMPL_NEW') FROM dual

but through forms i am unable to create it!! and the result output should be saved as .xml in a particular folder in server.

View 3 Replies View Related

Forms :: How To Generate Excel File

Jun 12, 2012

I want to gerate the excel(Office 2010)file using oracle forms 6i. How we can achieve this with forms 6i?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved