birthMonth-String to the Date of Conversion - get data from this month

Hello

We would like that the EEG records results for birthmonth this month table. If this month is May (05) then I need to get records of Birthmonth for the month may of table.

{Code}

Create table birthmonth (birthmonth Varchar2 (10), Numeroclient number);

INSERT INTO BIRTHMONTH ('1', 100);

INSERT INTO BIRTHMONTH ('2', 101);
INSERT INTO BIRTHMONTH ('3', 102);
INSERT INTO BIRTHMONTH ('41', 103);
INSERT INTO BIRTHMONTH ('5', 104);
INSERT INTO BIRTHMONTH ('10', 105);

INSERT INTO BIRTHMONTH ('11', 106);

{code}

Hello

user1758353 wrote:
Hello

We would like that the EEG records results for birthmonth this month table. If this month is May (05) then I need to get records of Birthmonth for the month may of table.

Here's one way:

SELECT  *
FROM     birthmonth
WHERE     birthmonth     = TO_CHAR ( SYSDATE
                        , 'fmMM'
                      )
;

SYSDATE returns the date of the day.
To_char (SYSDATE, 'MM') returns the current month (a string 2, with a '0' for most of the month).
To_char (SYSDATE, "FMMM") returns the current month (a string 1 or 2, without a '0').

{Code}

Create table birthmonth (birthmonth Varchar2 (10), Numeroclient number);

INSERT INTO BIRTHMONTH ('1', 100);

INSERT INTO BIRTHMONTH ('2', 101);
INSERT INTO BIRTHMONTH ('3', 102);
INSERT INTO BIRTHMONTH ('41', 103);
INSERT INTO BIRTHMONTH ('5', 104);
INSERT INTO BIRTHMONTH ('10', 105);

INSERT INTO BIRTHMONTH ('11', 106);

{code}

Thanks for posting that, but no instructions INSERT works; they need the keyword VALUES.
Always test (and, if necessary, correct) CREATE TABLE and INSERT statements before committing.

Is it really wise to save only the month? Most often, people store all birth_date in a DATE column. It is easy to use EXTRACT or TO_CHAR to get the month of a DATE.
Because you really want to use a column of VARCHAR type, making 10 characters long guest just wrong. Why not make 2 characters? In addition, add a CHECK constraint to make sure invalid month, such as '41' above, does.

Tags: Database

Similar Questions

  • HP dv9000 vista laptop won't start. Cannot 'fix '; BIOS Diagnostics: all GOOD except Hard Drive check result: replace the hard drive NEED the data from this hard drive!

    HP dv9000 vista laptop won't start. Attempt to restore repair result several times cannot be made online. BIOS ran diagnostics, everything was good except the hard disk, hd chk result: replace the hard drive. F11 entered to access advanced hp Recovery Manager options tempted towards the top of the entire disk, all files show while listing to back up, attached to my external hard drive current over the back with success.  Plugged external on another laptop, new files since the previous backup are no where.  Should I buy a new external hard drive and repeat the backup via Recovery Manager Advanced Options or should I remove the internal hard disk and insert it into a case and apply in usb on another laptop to view the files.  I know when my computer crashed, I had too many windows/tabs open and too much process and tried to interrupt a process and I confused his little brain and now he has Alzheimer's disease.  I am freaked because I'll lose everything 2012 including some very important documents and about 50 000 pictures HD (yes I learned my lesson backup!) I am in crisis mode because I recently became sick and my photos and documents is vital for my next year of chemotherapy and radiation. Please advice are extremely appreciated. Thank you

    Hello

    This backup after pressing F11 is a HP backup option, not a Microsoft option.

    I suggest that you contact HP or ask their Support Forums.

    http://h30434.www3.HP.com/

    It's the normal advice I'd give to record data; but we have no idea of the State of your hard drive.

    Saving your files:

    You can remove the hard drive and put it in a hard drive USB enclosure > plug it into another computer > and try to read and copy your data in this way.

    Or, you can download Knoppix > make a bootdisk to > start your system with it (IF your material is all work) > and copy your data from the hard drive like that.

    http://Knoppix.NET/

    See you soon.

  • The Start Menu folder is on the desktop, how to get away from this?

    I use Windows Vista, packs latest.

    Somehow, my start folder Menu has been linked directly to do my office.  There is a folder (Start Menu) on the desktop which cannot be deleted and can be moved to any other place, other than just another post on the desktop itself.

    I have the program set to the Classic Style button and Start Menu now appears above the horizontal line that separates the programs, Documents, etc., other links.  I want her to be out there, as this seems to be a kind of vicious circle.

    I have absolutely no idea of what I can pushed have obtained this file where it is.  What should I do?

    Thank you.

    You know what?  After playing with him for a while, I just jumped start "real" of the Classic Mode to normal mode (for Vista), and then he jumped to classic.  Solved the problem.  I do not know how, why, I didn't even do it intentionally.

    I am completely free of malware, etc.

    Thanks for the help, however.

  • How to insert into a GLOBAL TEMPORARY TABLE and get the data from it?

    The requrement is
    Split the string ENTRY point on the base and store it in a Collection. And the values of the collection will be stored in a global temporary table. Then, I'm updating some other table based on the data from the temporary table.

    There is in fact no error message. But there is no data in the temporary table and also no change in the update statement

    First of all, I'm creatiing a global temporary table only once outside the procedure.

    CREATE GLOBAL TEMPORARY table GLt (data_element number)


    create or replace procedure test_proc (p_in_string VARCHAR2) is
    i the number: = 0;
    number of POS: = 0;
    CLOB lv_str: = p_in_string;
    p_delim VARCHAR2 (1): = ', ';

    TYPE t_array IS TABLE OF VARCHAR2 (20) INDEX directory.
    t_array channels;

    BEGIN

    -cutting of string input and store in the strings (i) collection

    POS: = instr (lv_str, p_delim, 1, 1);
    WHILE (pos! = 0) LOOP
    i: = i + 1;
    Strings (i): = substr(lv_str,1,pos-1);
    lv_str: = substr (lv_str, pos + 1, length (lv_str));
    POS: = instr (lv_str, p_delim, 1, 1);
    IF pos = 0 THEN
    Strings (i + 1): = lv_str;
    END IF;
    END LOOP;

    run immediately "drop table TWG;
    run immediately ' CREATE GLOBAL TEMPORARY table (data_element number) TWG on commit preserve rows ";

    FORALL i in strings.first... Strings.Last
    INSERT INTO VALUES TWG (strings (i));
    commit;

    Update first_tbl set PIN is "XXX" where first_col in (select data_element from TWG);.
    commit;

    END test_proc;

    Published by: cedric b on January 25, 2013 12:59

    Remove the two execute immediate line. They are wrong.

    And then use the table in your code that you created at the beginning. The name is GLT.
    And delete the first commit. This validation would empty the temporary table of GLT.

    You get an error? Or it does not work as expected?

    Also, show how you call the procedure.

    Published by: Sven w. January 25, 2013 14:45

  • Is it possible to see/get the data from the table to a dump file

    I have files dmp generated using expdp on oracle 11 g...

    expdp_schemas_18MAY2013_1.dmp

    expdp_schemas_18MAY2013_2.dmp

    expdp_schemas_18MAY2013_3.dmp

    Can I use a settings file given below to get the data from the table in the file sql or impdp the only option to load the data of table in database.

    VI test1.par

    USERID = "/ as sysdba".

    DIRECTORY = DATA

    dumpfile=expdp_schemas_18MAY2013%S.dmp

    SCHEMAS = USER1, USER2

    LOGFILE = user_dump_data.log

    SQLFILE = user_dump_data. SQL

    and impdp parfile = test1.par.

    No,

    DataPump cannot retrieve a dumpfile data in a flat file.

    Dean

  • Get the data from a virtual computer store

    I'm looking to get the data from a virtual computer store, but format to be used with vmrun.  My current vmrun statement is:

    vmrun t CR h < IPAddress > https://: 443/SDK u & lt; username & gt; Pei & lt; password & gt; runProgramInGuest "[& lt;. datastorename & gt;] & lt; datastorefolder & gt; / & lt; virtualmachinename & gt;. VMX' c:\myscript.bat

    The idea is to replace & lt; datastorename & gt; given with the name of the LUN that is running on a virtual machine.  In this case, I'm running my statement vmrun from inside a script PowerCLI.  I can use a variables powerCLI, if the vmrun instruction can take and use all escape sequences are needed to adapt the format vmrun to this argument.

    That is right.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • How can I get the data from the drive of barcodes to forms

    Hi Experts,

    Forms 6i

    I would like to collect data from the barcode scanner.

    No idea if you got it please share.

    Thanks in advance.

    Hello

    I think that his works even as the keyboard.  You type the code manually or you can read it from a scanner.  With the help of the keyboard that you can able to type what anyone on the position of the cursor, in the same way the barcode scanner also works.  Just like a copy and paste the scanner copies the data from the physical device and paste it into your corrent cursor position.  There is no separate program encodings necessary for this work.

  • I bought an iPhone 6s and want to transfer the data from my old iPhone 4S with iTunes

    I bought an iPhone 6s and want to transfer the data from my old iPhone 4S with iTunes but it says "the"iPhone"iPhone cannot be used because it requires a newer version of iTunes. Go to www.itunes.com to download the latest version of iTunes. "

    I checked and the version of itunes is the latest AID!

    DooozySue wrote:

    I checked and the version of itunes is the latest AID!

    Most likely, what you found, is that the iTunes version is the latest available for your operating system.

    The latest version of iTunes is 12.4.3.  This version requires at least OS X 10.8.5 or later version, or Windows 7 or later version.

    If your iTunes version is earlier than 12.4.3, it will probably not recognize your 6s performance iPhone iOS 9.

    If you do not have the required operating system, get first.  Then download from iTunes

    http://www.Apple.com/iTunes/download

  • Extract the data from the ReadyNAS Duo 3 to disk?

    Hello

    I have a ReadyNAS Duo chassis crashed with two drives of 3 TB in it. Both discs seem to work very well.

    How can I do to retrieve the data from disks of theses? they were in a RAID 1 configuration, so I guess I just need to extract one of the disks. Does it matter which drive is it?

    I started to connect one of the disks to an installation of Ubuntu and I can find from the disc with respect to the available partitions, but I get no info on the file system used, only that it is flagged as RAID.

    Because I don't want ot destroy all the data I was very careful when working with the partitioning tool. So far, I've installed and looked parted, gparted, gdisk and a few others.

    Since I'm really new to Linux, I need more detailed assistance with indicators to be used to access the drive.

    Any input is highly appreciated.

    Christoffer

    Look at this: http://kb.netgear.com/app/answers/detail/a_id/29961?utm_source=community&utm_medium=announcement&utm...

  • Generic procedure to load the data from the source to the table target

    Hi all

    I want to create a generic procedure to load data of X number of the source table to X number of the target table.

    such as:

    Source1-> Target1

    Source2-> Target2

    -> Target3 Source3

    Each target table has the same structure as the source table.

    The indexes are same as well. Constraint are not predefined in the source or target tables.there is no involved in loading the data from the business logic.

    It would simply add.

    This procedure will be scheduled during off hours and probably only once in a month.

    I created a procedure that does this, and not like:

    (1) make a contribution to the procedure as Source and target table.

    (2) find the index in the target table.

    (3) get the metadata of the target table indexes and pick up.

    (4) delete the index above.

    (5) load the data from the source to the target (Append).

    (6) Re-create the indexes on the target table by using the collection of meta data.

    (7) delete the records in the source table.

    sample proc as: (logging of errors is missing)

    CREATE or REPLACE PROCEDURE PP_LOAD_SOURCE_TARGET (p_source_table IN VARCHAR2,

    p_target_table IN VARCHAR2)

    IS

    V_varchar_tbl. ARRAY TYPE IS VARCHAR2 (32);

    l_varchar_tbl v_varchar_tbl;

    TYPE v_clob_tbl_ind IS TABLE OF VARCHAR2 (32767) INDEX OF PLS_INTEGER;

    l_clob_tbl_ind v_clob_tbl_ind;

    g_owner CONSTANT VARCHAR2 (10): = 'STG '.

    CONSTANT VARCHAR2 G_OBJECT (6): = 'INDEX ';

    BEGIN

    SELECT DISTINCT INDEX_NAME BULK COLLECT

    IN l_varchar_tbl

    OF ALL_INDEXES

    WHERE table_name = p_target_table

    AND the OWNER = g_owner;

    FOR k IN l_varchar_tbl. FIRST... l_varchar_tbl. LAST LOOP

    SELECT DBMS_METADATA. GET_DDL (g_object,

    l_varchar_tbl (k),

    g_owner)

    IN l_clob_tbl_ind (k)

    FROM DUAL;

    END LOOP;

    BECAUSE me IN l_varchar_tbl. FIRST... l_varchar_tbl. LAST LOOP

    RUN IMMEDIATELY "DROP INDEX ' |" l_varchar_tbl (i);

    DBMS_OUTPUT. PUT_LINE (' INDEXED DROPED AS :'|| l_varchar_tbl (i));

    END LOOP;

    RUN IMMEDIATELY ' INSERT / * + APPEND * / INTO ' | p_target_table |

    ' SELECT * FROM ' | '. p_source_table;

    COMMIT;

    FOR s IN l_clob_tbl_ind. FIRST... l_clob_tbl_ind LAST LOOP.

    EXECUTE IMMEDIATE l_clob_tbl_ind (s);

    END LOOP;

    RUN IMMEDIATELY 'TRUNCATE TABLE ' | p_source_table;

    END PP_LOAD_SOURCE_TARGET;

    I want to know:

    1 has anyone put up a similar solution if yes what kind of challenges have to face.

    2. it is a good approach.

    3. How can I minimize the failure of the data load.

    Why not just

    create table to check-in as

    Select "SOURCE1" source, targets "TARGET1", 'Y' union flag double all the

    Select "SOURCE2', 'TARGET2', 'Y' in all the double union

    Select "SOURCE3', 'Target3', 'Y' in all the double union

    Select "SOURCE4', 'TARGET4', 'Y' in all the double union

    Select 'Source.5', 'TARGET5', 'Y' in double

    SOURCE TARGET FLAG
    SOURCE1 TARGET1 THERE
    SOURCE2 TARGET2 THERE
    SOURCE3 TARGET3 THERE
    SOURCE4 TARGET4 THERE
    SOURCE.5 TARGET5 THERE

    declare

    the_command varchar2 (1000);

    Start

    for r in (select source, target of the archiving of the pavilion where = 'Y')

    loop

    the_command: = "insert / * + append * / into ' |" r.Target | ' Select * from ' | '. r.source;

    dbms_output.put_line (the_command);

    -execution immediate the_command;

    the_command: = 'truncate table ' | r.source | "drop storage."

    dbms_output.put_line (the_command);

    -execution immediate the_command;

    dbms_output.put_line(r.source ||) 'table transformed');

    end loop;

    end;

    Insert / * + append * / into select destination1 * source1

    truncate table SOURCE1 drop storage

    Treated SOURCE1 table

    Insert / * + append * / to select TARGET2 * in SOURCE2

    truncate table SOURCE2 drop storage

    Treated SOURCE2 table

    Insert / * + append * / into select target3 * of SOURCE3

    truncate table SOURCE3 drop storage

    Treated SOURCE3 table

    Insert / * + append * / into TARGET4 select * from SOURCE4

    truncate table SOURCE4 drop storage

    Table treated SOURCE4

    Insert / * + append * / into TARGET5 select * from source.5

    truncate table source.5 drop storage

    Treated source.5 table

    Concerning

    Etbin

  • What is the fastest way bulk load the data from ACE / 400 to Oracle?

    Asked me to move data from the AS / 400 to Oracle11gR2 as fast that ODI may eventually. Quinte just no mapping, no transformation, no membership.

    An ODI11g agent is started on the computer of Oracle target, but being new ODI, I don't know how to use SQL for Oracle LKM loading in a scene and then updated incremental Oracle IKM layout from staging to the target table.

    It took 50 minutes to move recorded about 4 million. I need to get this in about 10 minutes. So guys, if there is a best practice to do this, please let me know, but now I'll try any suggestion you might think.

    Thank you in advance.

    Means the faster is to use a combination of ODI interface and ODI tool named OdiSqlUnload.
    N ° 1). Use the ODI OdiSqlUnload tool to export the data from the AS / 400 files in a flat file of the BONES.
    Step 2.) Use this flat file as source and LKM file for Oracle (SQLLDR) and Oracle IKM incremental update to load Oracle data.

    Your current path is slow because it operates on a row by row basis.

  • Copy the data from CollaborateSync to the other pc

    Because Acrobat crashes sometimes, I would like to copy the data from CollaborateSync to a PC Backup. This means that I have shared a pdf with PC A one form I'd like to get answers on the PC B, too.

    I tried to copy the Synchronizer-folder "documents and settings" - folder but I can't get answers.

    What information should I copy can I geht PC B answers?

    Klaus

    Find the file "Workflows" in Acrobat under Documents and Settings folder. It is located inside the folder "Collab. If this file is missing, copy the folder "Synchronizer" will not do anything good.

    In addition, copy "Forms" folder as well.

  • Load the data from a text file into a table using pl/sql

    Hi Experts,

    I want to load the data from a text file (sample1.txt) to a table using pl/sql

    I used the pl/sql code below

    ***********************************
    declare
    f utl_file.file_type;
    s varchar2 (200);
    c number: = 0;
    Start
    f: = utl_file.fopen('TRY','sample1.txt','R');
    loop
    UTL_FILE.get_line (f, s);
    insert into sampletable (a, b, c) values (s, s, s);
    c: = c + 1;
    end loop;
    exception
    When NO_DATA_FOUND then
    UTL_FILE.fclose (f);
    dbms_output.put_line('No. deles de lignes insérées: ' || c);
    end;

    ***************************************

    and my sample1.txt file looks like

    ***************************************
    1
    2
    3
    ***************************************

    Gets the data inserted, with way below

    Select * from sampletable;

    A, B AND C

    1-1-1
    2-2-2
    3 3 3

    I want that data to get inserted as

    A, B AND C

    1 2 3

    The text file I have is to have three lines, and the first value of each line should go to each column

    Help, please...

    Thank you
    declare
    f utl_file.file_type;
    s1 varchar2(200);
    s2 varchar2(200);
    s3 varchar2(200);
    c number := 0;
    begin
    f := utl_file.fopen('TRY','sample1.txt','R');
    utl_file.get_line(f,s1);
    utl_file.get_line(f,s2);
    utl_file.get_line(f,s3);
    insert into sampletable (a,b,c) values (s1,s2,s3);
    c := c + 1;
    utl_file.fclose(f);
    exception
    when NO_DATA_FOUND then
    if utl_file.is_open(f) then utl_file.fclose(f); ens if;
    dbms_output.put_line('No. of rows inserted : ' || c);
    end;
    

    SY.

  • My browser is running do not. I uninstall, install several times. Uninstall cookies, delete the data from the user, install in another user - no reaction. What's wrong? Help, please

    My browser is running do not. I uninstall, install several times. Uninstall cookies, delete the data from the user, install in another user - no reaction. What's wrong? Help, please

    Start Firefox in Safe Mode {web link} by holding down the < shift >
    (Mac options)
    key and then from Firefox. Is always the problem?

    Start your computer in safe mode with network. Then launch Firefox.
    Try the sites secure web. Is always the problem?

    Start the computer in Mode safe;
    Free online encyclopedia

  • Unable to delete the data from the Safari Web site...

    Hello.

    I need help with my Safari browser on my Mac.

    Im trying to remove all Web site data with the following procedure:

    Safari-> Preferences-> privacy-> Remove All Data Web site...

    His does not work. Before clicking on the button I have 108 Web sites stored cookies or other data, I click the button, and nothing happens... I'm still 108 cookies.

    I also did the following:

    . - activate the Menu developer and Cache empty and tried again... nothing

    . - used CleanMyMac v3 and it says I don't have cookies.

    . - order iCloud Sync of Safari on the computer and try again... same problem

    . - removed manually com.apple. Safari. Secure

    Any help will be great. Please let me know if you need any additional info.

    Thank you.

    Hello DZanvettor,

    Thank you for using communities of Apple Support.

    If I understand your message that nothing happens when you try to remove the Safari Web site data. I know how it is important for you to be able to remove the Safari Web site data. I recommend that you restart your Mac into safe mode and see if you can remove the data from the Web site in secure mode.

    Here are the steps to restart your Mac in safe mode:

    Safe mode (sometimes called secure boot) is a way to start up your Mac so that it performs certain checks and prevents certain software from loading automatically or opening.

    From your Mac in safe mode does the following:

    * Check your startup disk and attempts to fix problems if necessary directory
    * Loads only required kernel extensions
    * Prevents the elements start and the login items open automatically
    * Disables installed user fonts
    * Delete font caches, hiding the kernel and other files of the system cache
    * Together, these changes can help resolve or isolate issues related to your startup disk.

    Follow these steps to start in safe mode.

    1. start or restart your Mac.
    2. as soon as you hear the startup tone, hold down the SHIFT key.
    3. release the SHIFT key when you see the Apple logo appears on the screen.

    After you delete data from the Web site in safe mode restart your Mac and allow it to start up as usual. Then test the issue again.

    Best regards.

Maybe you are looking for