Autonumber? or sql? or how?

I have a child (detail) block in tubular form. I need to have a field that will number each row/results after the master is queried. ie.
MASTER = company
details= employees
details block looks like this:
NUMBER | NAME | LAST_NAME |ADDRESS
1
2
3
4
so I need that for every new record on the detail block, the next number is generated. So if a new employee gets inserted for this compay, the field "Number" created will be 5. by the same token if a company has 2 records, then the next time someone gets inserted they receive the value of 3 and so on.
can you guys please help me with this? I dont even know where to start.
thanks!

The above procedure (seqno_prc) have some bugs, for example if the user deletes
a row in the detail block, the sequence of the rows above and rows down this deleted row will not change, it should recalculated.
It's better to generate squence of the detail rows just before saving the form.
For me i use when-button-pressed for a save button then i navigate through the detail block , increment the counter and fetch it's value on the item that have the row number, then commit the form .
and everythig is working fine.

Similar Messages

  • Autonumber in SQL

    Is there a way i can get an autonumber in SQL,
    I have a databse and i want the database to have a primary key that is an autonumber, whenever a row is added it automatically enters the key in there.
    I am using Access as the front end for this database.
    Thanks
    ashish

    CREATE SEQUENCE
    Purpose
    Use the CREATE SEQUENCE statement to create a sequence, which is a database object from which multiple users may generate unique integers. You can use sequences to automatically generate primary key values.
    When a sequence number is generated, the sequence is incremented, independent of the transaction committing or rolling back. If two users concurrently increment the same sequence, the sequence numbers each user acquires may have gaps because sequence numbers are being generated by the other user. One user can never acquire the sequence number generated by another user. Once a sequence value is generated by one user, that user can continue to access that value regardless of whether the sequence is incremented by another user.
    Sequence numbers are generated independently of tables, so the same sequence can be used for one or for multiple tables. It is possible that individual sequence numbers will appear to be skipped, because they were generated and used in a transaction that ultimately rolled back. Additionally, a single user may not realize that other users are drawing from the same sequence.
    Once a sequence is created, you can access its values in SQL statements with the CURRVAL pseudocolumn (which returns the current value of the sequence) or the NEXTVAL pseudocolumn (which increments the sequence and returns the new value).
    See Also:
    "Pseudocolumns" for more information on using the CURRVAL and NEXTVAL
    "How to Use Sequence Values" for information on using sequences
    ALTER SEQUENCE or DROP SEQUENCE for information on modifying or dropping a sequence
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_615a.htm#SQLRF01314
    Joel P�rez

  • Where we use the window class in the sql and how to use it

    where we use the window class in the sql and how to use it

    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions004.htm#SQLRF06174
    Regards
    Etbin

  • Whenever an slowness issue came in sql server how should I start?

    whenever a slowness issue or performance issue came in sql server how should I start?
    Please guide.
    Thanks

    Hi Ajay,
    All answer given above would be useful to you in some or the other scenario. if you are facing performance issue the approach you take determines how easily and quickly you can find solution.
    First thing is know your system how it works for that you need to first baseline a system. A system with 70 % CPU utilization would not always be issue but for some environment it can be. If you know your system very well moment performance issue  comes
    you would know where is the problem. Wait stats alone is never helpful you must be able to correlate wait stats to what is going on your system. If you know which query is causing issue its easy to see execution plan and tune it. If issue is server wide it
    can be due to missing index outdated stats slow disk subsystem etc. So first step is finding the cause. As Uri suggested wait stats are always helpful I use wait stats and refer to below whitepaper by Microsoft for SQL Server troubleshooting
    http://technet.microsoft.com/en-us/library/dd672789%28v=sql.100%29.aspx
    Remember important thing is knowing your system and that can come from base lining.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • I am in sql plus how do I find out what database I am in?

    I am in sql plus how do I find out what database I am in? is there a sql command for that...

    select name from v$database;
    or
    select sys_context('userenv', 'DB_NAME') from dual;

  • IaaS SQL/VM - how to use an existing SQL VM

    Hello
    I have a Cloud Service with a Window Web VM and SQL VM. They both are on the same Vnet. Now I want to add a DB using the existing SQL VM. But this VM does not show up of the Server drop down menu in "Specify Database setting"
    wizard. What am I missing here?
    If I let the DB Wizard add a new server (leveraging PaaS offer for SQL DB), how can I make sure that this new server shows up on my Vnet (the same one where I have Web VM on)? I assume that these VMs needs to be on the same Vnet to be able to communicate
    with each other. 
    Thanks in advance for your help

    Hello,
    It seems that you had mix up Windows Azure SQL database with SQL Server on Azure VM. When you create a SQL Server virtual machine in Azure, it similar to on-premises SQL Server installed on VM. You can create and manage databases with SSMS.
    If you create a SQL database on Management Portal, the SQL database server host a VM of the datacenter, you cannot using the existing SQL Server VM which your created yourself.
    When connect to the SQL database from your azure VM which hosted on Cloud Service, there is no need to create a virtual network, just configure the firewall rule of the SQL database server to allow connection from Windows
    Azure Serivces.
    Reference: How to: Configure the Server-Level Firewall Settings (Azure SQL Database)
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • IF statement in SQL*Plus - how to do it

    Hi,
    In SQL*Plus script, I would like to keep conditional checking (IF statement) and proceed. For example, whatever is done in PL/SQL block below, want to do the same in SQL*Plus script, I know partly it can be done using VARIABLE keyword, conditional checking can be done using DECODE in SELECT statement, but I want to carry out a more complex requirement, hence I want to use IF statement somehow in SQL*Plus.
    Another question, how to do spooling in PL/SQL script, it can be done using UTL_FILE, any other option is there to achieve this.
    declare
    v_ind_count int;
    begin
    select count(1) into v_ind_count from user_indexes where index_name = 'index_object_name';
    IF v_ind_count > 0
    THEN
    dbms_output.put_line('index found');
    ELSE
    dbms_output.put_line('index does not exist');
    END IF;
    end;
    /

    Hello,
    SQL*PLUS has no scripting language. It can only execute SQL and PL/SQL scripts. There are some commands like SPOOL or SET but no commands for conditional statements. You should describe your requirements, maybe we can find a way.
    Or you can search the forum, maybe your question has already been answered
    [Google for SQL*PLUS + condition|https://www.google.de/search?q=site%3Aforums.oracle.com+"SQL*PLUS"+condition]
    # {message:id=4189517}
    # {message:id=4105290}
    how to do spooling in PL/SQL scriptFrom within PL/SQL you can use dbms_output, the spool has to be started by the calling SQL script when it is executed in SQL*PLUS. Or you can use utl_file, but then you can only write to a server directory, not into a client file. To give an advice we need more information about what you want to do.
    Regards
    Marcus

  • In SQL Trace how to see which statement getting more time .

    Hi Expart,
    In SQL Trace (T-code ST05) . I am running the standard transaction . how to see which statement
    running more time and less time . suppose one statement running more time so how resolve the
    performance .
    Plz. reply me
    Regards
    Razz

    > The ones in 'RED' color are the statement which are taking a lot of time and you need to
    > optimise the same.
    No, that is incorrect, the red ones show only the ones which need several hundret milliseconds in one execution. This can even be correct for hard tasks. And there are lots of problem, which you will not see
    I have said everything here:
    SQL trace:
    /people/siegfried.boes/blog/2007/09/05/the-sql-trace-st05-150-quick-and-easy
    Go to 'Tracelist' -> Summarize by SQL statements', this is the view which you want to see!
    I summarizes all executions of the same statement.
    There are even the checks explained, the slow ones are the one which need a lot of time per record!
    See MinTime/Rec > 10.000 microseconds.
    Check all number of records, executions, buffer, identicals.
    The SE30 Tipps and Tricks will not help much.
    Siegfried

  • Sql report, How to access current rows 6 columns data

    I have one page having page items & SQL report having 8 columns.
    First column of report is a link for editing.
    on clicking first column, that record gets displayed on page items, which are opn same page.
    Now my problem is i have used link column of report and set 3 page items value on click of link column.\
    But i need to set values for 2 more page items.
    I tried to create computation & process but not working. i am confused about which process point to select & whether onclick page gets submitted or not.
    I tried to write jscript but not succeeded. I dont know how to get current row id in jscript & different column values of current rowid.
    any help.

    Hi,
    Thanks for reply.
    in 5 items, first three are numeric and last two are timestamp fromtime, totime.
    as I mentioned earlier if i interchange 4 & 5 items i.e. now ITEM4 is totime & ITEM5 is fromtime
    and their values. I get value for totime & not for fromtime. all records contain values for all 5 columns. no null.
    So basically their is no problem in value or data, The only problem is whatever sequence is maintained first 4 items get value & 5th item remains blenk.
    Either I type all 5 ITEM NAMES in one Item name-value pair of link or use all three pairs, 5th ITEM remain blank.

  • Using SQL developer, how to show more then 1 table at at time ?

    Hi, everybody
    I am able to open more then 1 procedures/functions for editing.
    However i am not able to open more then 1 table for seeing the data and columns.
    1) how do i open more then 1 table tab in sql developer or i am not allow to do so ?
    2) is it possible to see what column is the foreign key of a table in sql developer ?
    thanks once again :)

    use freeze view button
    and drop table below from tabs
    http://www.oracle.com/technology/products/database/sql_developer/files/viewlets.html
    watch this viewlet
    Useful Features of SQL Developer (July '07)
    it can show u how u can see more than one table at a time

  • I downloaded Mozilla 4 and tried to use it then, I had to delete it and go back to 3.6 vs now I am having problems with my MS SQL 2005 why? What was changed to enable Mozilla 4 to sync with MS SQL and how do I get it corrected?

    After, trying Mozilla 4 beta and then having to go back to a previous vs of Mozilla 3.6.11 my MS OLE DB Provider for SQL 2005 Server has this error message '80040E57' I am using Windows 7 which was pre-installed on my new computer. I do not know how to fix it?

    The latest flash player release is 11,0,1,152.
    Can you upgrade to this version and see whether the crash stil exists?
    Go to get.adobe.com/flashplayer to download and install flash player.
    In case you need direct link to installer/uninstaller, please go to http://forums.adobe.com/message/3952360#3952360 to find them.
    saranlee wrote:
    My computer crashes repeatedly and I get the message pages are not responding do you want to stop, and/or shockwave is not responding do you want to stop. I have Windows XP Service Pack 3, I am having the same issues whether I use Internet Explorer, Google Chrome, or Mozilla Firefox. My HP Pavilion Desktop has 504 MB of Ram and I am using high speed internet connection. Because it was crashing so much, I used the uninstall program for Flash player to uninstall Flash, I checked my registry and removed anything I saw that was Flash. I then uninstalled Google Chrome and Mozilla Firefox, then I reinstalled the most recent versions from their websites. I did the same for FlashPlayer and Shockwave Flash. I went to the Adobe website and had them check to see if it was working and it shows I have FlashPlayer 10.3.181.36. The page that shows  which version of flash player goes with Windows XP states that I should have 10.3.181.34 (This is what I thought I had before I updated, I was having the same problems). When I went into my computer to see what version I have, it shows 11.5.9.620 Activex and both Flash Player and Flash Player Object is listed as 10.3.181.34. My firewall for Windows is set to medium. I also am running Norton Internet Security. It takes anywhere from 3-6minutes for some of my games to load, and I have to refresh at least 3-4 times in order to play. When I do start to play it freezes frequently and I use escape to free it up. This has been going on for a month. I have no idea what to do. I am not very computer savy and I have been learning as I go.

  • SQL report how to handle user input

    All if i have a simple sql query like
    select * from tablename
    And in th report page i would like to put in differenet boxs so that someone could say have date, and usersphone etc.
    Without using PL/SQL function returning sql query Is there a way to say
    select * from table
    where
    date = :P24_inputdate
    and
    usersphone = :p24_usersphone
    And there would have to be something inclucded if nothing was put in by the user and he/she just wanted everything.

    How about:
    select * from table
    where
    (date = :P24_INPUTDATE or :P24_INPUTDATE is null)
    and
    (usersphone = :P24_USERSPHONE or :P24_USERSPHONE is null)
    Andrew

  • SQL query - how to get parameters into a function within a SELECT statement

    Hi,
    I have SQL query roughly as follows
    SELECT A, B, C, MAX(CASE...) AS "D_NAME", FunctionX(B, C, "D_NAME")
    FROM...
    WHERE...
    How to get alias "D_NAME" as a valid parameter into FunctionX?

    Hi,
    user8819407 wrote:
    Hi,
    I have SQL query roughly as follows
    SELECT A, B, C, MAX(CASE...) AS "D_NAME", FunctionX(B, C, "D_NAME")
    FROM...
    WHERE...
    How to get alias "D_NAME" as a valid parameter into FunctionX?Either
    (1) repeat the calculation or
    (2) compute it in a sub-query
    Here's an example of (2)
    WITH  got_d_name  AS
        SELECT A, B, C, MAX(CASE...) AS "D_NAME"
        FROM...
        WHERE...
    SELECT  A, B, C, D_NAME, FunctionX (B, C, D_NAME)
    FROM    got_d_name
    ;A column alias (like d_name) can be referenced in the ORDER BY clause of the query where it was defined, but that's the only place in that query where it can be referenced.

  • What is tuxedo9.1/bin/sql and how to restrict amount of memory it uses?

    Hi,
    We have AIX 5.3 server running Oracle 10.2 database and Tuxedo, a few days ago the database crashed as
    there was no free memory (this was configmed by AIX log).
    According to our monitoring (Open View) memory was consumed by two 'sql' processes
    (where 'sql' is process name): within one hour each process went from 24,000 to 800,000 memory pages.
    I searched the box and found executable named 'sq' in tuxedo9.1/bin:
    ls -l tuxedo9.1/bin/sql-r-xr-xr-x 1 abcPadm abcP 73128 Oct 24 2008 tuxedo9.1/bin/sql
    Would you be able to tell me what is this 'sql' executable and how to restrict amount
    of memory it consumes (other than through ulimit)?
    Thanks
    Sev

    Hi Sev,
    As Ian says, the SQL support in Tuxedo where Tuxedo actually provided a relational database resource manager has long been deprecated and certainly hasn't been supported in over 10 years. The Tuxedo sql program in the Tuxedo bin directory is an interactive SQL utility. I seriously doubt that it is the same executable that caused your memory problem. If it is the same executable, there isn't really much Oracle is going to be able to do for you as that component hasn't been supported for years. You would really need to change the application to use a standard supported SQL utility and relational database.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Using PL/SQL Block how do you check if the character string value is aA-zZ

    I have a pl/sql block that I prompt the user for password and I load the string into an array and interrogate each index(entry) to see if it is "aA-zZ".
    How can I check if the value entered is Alpha.
    I need to do the same for number and Special character. Please advise. Thanks

    Thanks to All of you. The desired solution to verify complex password that enforces desired security policies. An example that I am using is the following:
    IF NOT (regexp_like(sz_complex_pw,'[[:digit:]]') AND regexp_like(sz_complex_pw,'[[:alpha:]]') AND regexp_like(sz_complex_pw,'[[:punct:]]') AND regexp_like(sz_complex_pw,'[[:upper:]]'))
    THEN
    --dbms_output.put_line('Password is not complex...');
    RAISE sz_err_pw_complex; -- Complex Password is not compliant
    END IF;
    DBMS_OUTPUT.PUT_LINE('Complex Password is in Compliance...');
    EXCEPTION
    This was helpful to me and I trust others will find helpful.
    Edited by: yakub21 on Oct 16, 2010 9:05 PM

  • SQL*Loader - How to combine 2 controlfiles to one controlfile

    I have several controllfiles which each import another table from another datafile, because I don't want execute every seperat or create a batch file.... I'm looking for a way to put they all in one single controlfile.
    example:
    1st ctl-file:
    LOAD DATA
    INFILE "t1.dat"
    INTO TABLE t1 REPLACE
    FIELDS TERMINATED BY "     "
    (c1,
    c2 "to_number(:c2,'99999999999999999.99999999999999999','NLS_NUMERIC_CHARACTERS=''.,''')",
    c3 date 'YYYY-MM-DD"T"HH24:MI:SS')
    gQuqT     478.60636734965914     2006-12-05T11:00:49
    ÜgQK     963.0277916962095     2006-12-30T08:03:00
    üZfxN     465.15226622488257     2006-12-30T09:14:12
    2nd ctl-file:
    LOAD DATA
    INFILE "t2.dat"
    INTO TABLE t2 REPLACE
    FIELDS TERMINATED BY "     "
    (c1,
    c2 "to_number(:c2,'99999999999999999.99999999999999999','NLS_NUMERIC_CHARACTERS=''.,''')")
    alvwxs     13.0
    poeh     15.0
    zpgiht     21.0
    At the examples is everytime used a id column, to ident which row should import in which table.
    But at my case i need something like a where condition from which file the data should be imported....how should it look?
    Can someone give me an advice how a controlfile should look which import both tables in one controlfile?
    BR
    roland

    It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
    Vijay

Maybe you are looking for

  • Two ADC 17" mac displays w/Mac Pro?

    I have a pair of the older 17" Mac displays with ADC connectors. I used them with my old MDD G4, which came with a video card that had DVI and ADC connectors. So, I obviously had to buy an ADC/DVI converter so I could use the DVI port that the comput

  • Sort Order Changes Unexpectedly in iPhoto Gallery

    I frequently add new images to some of my iPhoto galleries, then publish to MobileMe. When I rearrange the images in a particular gallery, the sort order sometimes changes spontaneously. Once this occurs, I have to manually restore everything to its

  • Youtube & Vimeo Compression Settings.

    Hello i am using Compressor 4.1.3 and im trying to figure out the guidelines for youtube compression. There are many different variables and alot of suggestions from other users that are just guessing at what box to check. As we all know the default

  • I want to know the particular diff betwenn synchronous mode & asynchronous

    Dear Friends, can u pls explain the difference between synchronous & asynchronous mode. Regards Jagadeeshwar.B

  • CS5 won't save images- help

    I just had photoshop cs5.1 installed, but when I tried to use it, I found that I can't save images using File>Save or Save As. I've tried using the short cut keys, and those don't work either. However, I can save images by closing an image and select