get the number in the declaration of DBMS

Hello everyone,

my friend, I create the following code, but I've always faced a problem to display the result of County all the

the code is:

------------------------------

I insert a count (*) to get the number of employees

but he keep get only '1' to the last of the result in the following way:

DETAILS OF THE EMPLOYEE:

YJOSEPH5 | YOUSEFJOSEPH | 15 NOVEMBER 15

HYOUSEF10 | HASSANYOUSEF | 15 NOVEMBER 15

HYOUSEF17 | HASSANYOUSEF | 15 NOVEMBER 15

HYOUSEF14 | HASSANYOUSEF | 15 NOVEMBER 15

HYOUSEF16 | HASSANYOUSEF | 15 NOVEMBER 15

COUNT: 1

the code

------------------------------------

DECLARE
V_USER_ID VARCHAR2 (50);
NUMBER OF V_EMP_NO;
V_FIRST_NAME VARCHAR2 (30);
V_LAST_NAME VARCHAR2 (30);
DATE OF V_REG_DATE;
NUMBER OF V_COUNT;
V_SQL_SATEMENTS VARCHAR2 (1000);
NCOUNT THE NUMBER;
CURSOR C IS SELECT USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE, COUNT (*) FROM EMP
USER_ID, FIRST_NAME, LAST_NAME, EMP_NO, REG_DATE GROUP;
BEGIN
OPEN C;
SELECT COUNT (*) FROM NCOUNT FROM USER_TABLES WHERE TABLE_NAME = 'EMP ';
IF (NCOUNT < = 0) THEN
V_SQL_SATEMENTS: =' CREATE TABLE EMP)
USER_ID VARCHAR2 (40) PRIMARY KEY,.
NUMBER OF EMP_NO,
FIRST NAME VARCHAR2 (30),
VARCHAR2 (30) LAST_NAME,.
DATE OF REG_DATE)';

RUN IMMEDIATELY "DROP TABLE EMP;
IMMEDIATELY RUN V_SQL_SATEMENTS;
END IF;

SELECT NVL (MAX (EMP_NO), 0) + 1
IN V_EMP_NO
YOUSEF. EMP;
INSERT YOUSEF. EMP (USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE)
VALUES (SUBSTR (: LAST NAME, 1, 1) |: LAST_NAME |) V_EMP_NO, V_EMP_NO,:FIRST_NAME,:LAST_NAME,TO_DATE(SYSDATE,'DD-MON-YY'));
DBMS_OUTPUT. PUT_LINE (' DETAILS OF THE EMPLOYEE: "");
LOOP
EXTRACT THE C IN V_USER_ID, V_EMP_NO, V_FIRST_NAME, V_LAST_NAME, V_REG_DATE, V_COUNT;
WHEN THE EXIT %C NOTFOUND;

DBMS_OUTPUT. PUT_LINE (V_USER_ID |'|) ' || V_FIRST_NAME | V_LAST_NAME |' | ' || V_REG_DATE);
END LOOP;
DBMS_OUTPUT. PUT_LINE ("COUNT:" | "|") V_COUNT);

CLOSE C;
END;
/

ALL FRIENDS,

THANKS FOR EVERY BODY,

I JUST FOUND THE RIGHT WAY TO DO

FOR THOSE WHO WANT TO SEE:

-----------------------------------------------------------

DECLARE
V_USER_ID VARCHAR2 (50);
NUMBER OF V_EMP_NO;
V_FIRST_NAME VARCHAR2 (30);
V_LAST_NAME VARCHAR2 (30);
DATE OF V_REG_DATE;
NUMBER OF V_COUNT;
V_SQL_SATEMENTS VARCHAR2 (1000);
NCOUNT THE NUMBER;
CURSOR C IS SELECT USER_ID, FIRST_NAME, LAST_NAME, EMP_NO FROM EMP REG_DATE;
BEGIN
SELECT COUNT (*) IN THE EMP V_COUNT;
OPEN C;
SELECT COUNT (*) FROM NCOUNT FROM USER_TABLES WHERE TABLE_NAME = 'EMP ';
IF (NCOUNT<=0)>
V_SQL_SATEMENTS: =' CREATE TABLE EMP)
USER_ID VARCHAR2 (40) PRIMARY KEY,.
NUMBER OF EMP_NO,
FIRST NAME VARCHAR2 (30),
VARCHAR2 (30) LAST_NAME,.
DATE OF REG_DATE)';
                                         
RUN IMMEDIATELY "DROP TABLE EMP;
IMMEDIATELY RUN V_SQL_SATEMENTS;
END IF;

SELECT NVL (MAX (EMP_NO), 0) + 1
IN V_EMP_NO
YOUSEF. EMP;
INSERT YOUSEF. EMP (USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE)
VALUES (SUBSTR (: LAST NAME, 1, 1) |: LAST_NAME |) V_EMP_NO, V_EMP_NO,:FIRST_NAME,:LAST_NAME,TO_DATE(SYSDATE,'DD-MON-YY'));
DBMS_OUTPUT. PUT_LINE (' DETAILS OF THE EMPLOYEE: "");
LOOP
EXTRACT THE C IN V_USER_ID, V_EMP_NO, V_FIRST_NAME, V_LAST_NAME, V_REG_DATE;
WHEN THE EXIT %C NOTFOUND;

DBMS_OUTPUT. PUT_LINE (V_USER_ID |'|) ' || V_FIRST_NAME | V_LAST_NAME |' | ' || V_REG_DATE);

END LOOP;

CLOSE C;
DBMS_OUTPUT. PUT_LINE ("COUNT:" | "|") V_COUNT);

END;
/

Tags: Database

Similar Questions

  • How do I get the number by using the sql values list

    DECLARE

    v_rec_cnt number: = 0;

    Type v_table is table of the varchar2 (9);

    card_tab v_table: = v_table)

    '372131483',

    '372131566',

    '372131618',

    '372131720',

    '372131801',

    '372131885',

    '372131976',

    '372132058'... records 110000lacks)

    and org_colo_cam_id = 6827;

    Start

    Because me in card_tab. First... card_tab. Last

    loop

    SELECT count (1) in the v_rec_cnt OF dtc_tab_random_no dorn

    WHERE org_colo_cam_id = 6827 and

    NVL(attribute01,'@null@') = 'OFFICE '.

    and dorn_card_no = card_tab (i);

    v_rec_cnt: = v_rec_cnt + 1;

    end loop;

    dbms_output.put_line (' County :'|| v_rec_cnt);

    END;

    I need to get the values in list of bove records I write the script run I got this error can u please help for this

    I got IN the operator, but 1000 is limit in thank you operator for help

    Error on line 1

    ORA-06550: line 4, column 11:

    PLS-00801: internal error [22510]

    ORA-06550: line 4, column 11:

    PL/SQL: Ignored Element

    ORA-06550: line 117342, column 10:

    PLS-00320: the declaration of the type of the expression is incomplete or incorrect

    through utl_file.get_line the id to select queries count (1) inner loop passes the id I had the County thanks

  • Query to get the number of records

    Hi all

    I would get the number of records in all tables in a schema. I don't want to run select count (*) of < table name >, because there are nearly 400 paintings. So I need a generic quqeyr that will give the recordcount for all tables.

    Experts good help yourslef to tide me over.

    Do you need a specific account? Or an approximate count is sufficient? Do you use the RBO and CBO?

    If you use the CBO and want an approximate count, column NUM_ROWS USER_TABLES should give you what you want.

    If you need a specific account, you will have full scan all tables. You can automate this process via SQL dynamic, i.e.

    DECLARE
      l_cnt INTEGER;
    BEGIN
      FOR x IN (SELECT table_name FROM user_tables)
      LOOP
        EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || x.table_name INTO l_cnt;
        dbms_output.put_line( 'Table ' || x.table_name || ' has ' || l_cnt || ' rows.' );
      END LOOP;
    END;
    

    Lawrence was also a [solution based on XML Query | http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html] to count all the rows in each table in a schema.

    Justin

  • How can I get the 6 digit number to associate my watch.  It doesn't give me a 5-digit number?

    When I try to manually associate my watch it only gives me a 5 digit number, but not the number 6 to complete the pairing.  How can I get the 6 digit number?

    Hello

    When pairing manually, you must press the name of 5 digits on the screen of your iPhone (when he shows the same device name that is shown on your watch, after typed it on your watch's 'i'):

    Your watch then displays a six-digit code, you will then enter on your iPhone:

    More information:

    Set up your Apple Watch - Apple Support

  • I am trying to replace my iphone 6 s model n °: A1688, FCC ID: BCG-E2946A, IC: 579C-E2946A. but I can get the serial number because its doesn't turn only not on how can I replace it?

    I am trying to replace my iphone 6 s model n °: A1688, FCC ID: BCG-E2946A, IC: 579C-E2946A. but I can get the serial number because its doesn't turn only not on how can I replace it?

    Take it to your local Apple store. They will find it for you.

  • I can't get the number 5 and 6 of my key Board that is

    I can't get the number 5 and 6 on my key Board that happen about two hours ago please help me on fixing the problem

    Hello bigarthur, this is what is happening in the different programs that you use on your computer or just in firefox?

  • Can I get the serial number of the iOS, IMEI/MEID, CDN and ICCID by code device when I am developing an application?

    As the title suggests, can I get the serial number of the device iOS device, IMEI/MEID, CDN and ICCID by code, someone says I can't do that, I'm very confused. Can someone show me the Apple document on this subject?

    For reasons of confidentiality, Apple doesn't want you to access specific information of any peripheral such as MAC IMEI, UDID, address, serial number, etc and has been remove support for this kind of information the SDK for awhile now.  Your application will be rejected if you try to use private methods, that's probably what they were talking about.

  • How can I get the number of callers phone number (call history) of an incoming call on iPhone by program (as TrueCaller App does)

    I try to get the caller ID (telephone number or the call history) at the time of the incoming call. TrueCaller has implemented it and they get the phone number of the caller and the call also history.

    Please help me get there.

    Tips:

    1 CoreTelephony Framework(It gives only calling states)

    2 apples 9.0 update: "Maybe" contacts sync. with the mail application and detects the incoming phone number.

    3 TrueCaller App https://www.truecaller.com/articles/iphone

    https://iTunes.Apple.com/app/truecaller-enhances-your-phonebook/id448142450

    You're talking not here who you think you are. Please read the terms of the user agreement you signed.

  • How can I get the serial number if my MacBook Pro is lost or stolen?

    How can I get the serial number if my MacBook Pro is lost or stolen?

    Try the suggestions here > find the serial number of your Apple hardware product

  • How can I get the COMPLETE serial number to display? This number shows except for the 4 last digits.

    How can I get the COMPLETE serial number to display? This number shows except for the 4 last digits.

    Hi Infogoddess,

    Thank you for using communities Support from Apple! If you try to find the serial number of your iPod touch or another Apple product, you can find information and the steps in the following articles useful:

    iPod: how to find the serial number - Apple Support

    Find the serial number of your Apple - Apple Support product

    See you soon

  • Get the version number of an old file of sequence test bed

    A customer wants a small change to a previous deployment.

    They returned the original file in the sequence for me but the deployment is about two years old.

    Is there anyway I can get the Version of TestStand from the old file sequence number, so that I know which version to save it in.

    I am currently using 4.2.1.83 TestStand.

    Thank you

    Sean

    Sean,

    You can open the following file by using wordpad and take a look.

    hope this helps,

    Norbert

  • How to get the number of bits of Windows?

    Hi all

    How can I get the number of bits of Windows, the application of the LV is running on?

    By using the disabled conditional structure, I can get the number of bits of the application (if it is built in BT 32 or 64), but not the number of bits of windows.

    Thank you

    system variable 'PROCESSOR_ARCHITECTURE '?

  • Get the serial number of the GPIB-USB-HS

    How can I get the serial number of the GPIB-USB-HS device programmatically?

    I worked on it. Attached simple solution.

    It is possible using the driver of VISA?

  • How to get the number of line of a multi-line string

    It seems that this Panel of string does not provide the tool to get the chain line number,

    Does anyone have the same experience?

    so...

    How to get the line number of a variable string?

    Number of lines

  • When I try to use Windows Update, I get an error message when it tries to check the updates. I get the following error code [error number: 0 x 80070424]

    I get the following message

    Also get the red shield with X saying if off automatic updates.

    Tried fixing it by going to control panel, but it does not allow me to change the settings

    [Error number: 0 x 80070424]
    The website has encountered a problem and cannot display the page you are trying to view. The options provided below may help you solve the problem.

    For self-help options:

    To support options:

    Hi, I found the answer! Right click; Start, then on run, copy and paste this command, click OK. Problem solved!

    Bill

    % SYSTEMROOT%\SYSTEM32\REGSVR32. EXE, % SYSTEMROOT%\SYSTEM32\WUAUENG. DLL

Maybe you are looking for