Creating a key for a Time table in HMM format

Hello,
I am looking to create an INT column in SQL that inserts all hours and minutes within a day (that is, 1440 entries), in the following format:
HMM
Where:
H is the 24 hours format, without that leading zero, and MM are the minuts with the leading zero. For example:
0 is equivalent to 00:00
1 is equivalent to 00:01
2 is equivalent to 00:02
15 is equivalent to 00:15
59 is equivalent to 00:59
105 is equivalent to 01:05
130 is equivalent to 01:30
920 is equivalent to 09:20
1130 is equivalent to 11:30
1300 is equivalent to 13:00
2010 is equivalent to 20:10
2359 is equivalent to 23:59
Since I am still a little grasshoper on the path of SQL Kung-Fu, I am having a little hard time coming with up with a SLQ syntax to achieve that. Could someone please advise?
Regards,
P.

130 is just an example, which i took from HuaMin's
response
If I understood your issue, you have values in integer like 130 is 01:30 and you want to get the time '01:30' from the integer. This what what we all answer above. I just follow the other people understanding and post another solution.
It will be much easier if you post DDL+DML+result that you want to get instead of stories :-)
DDL: query to create the table
DML: queries to insert some sample data
Result: according the DDL+DML
* since you did not posted DDL+DML, I demonstrate the solution using single value (using the variable @n which represent the value that come from the table)
** Please post post DDL+DML+result that you want
  Ronen Ariely
 [Personal Site]    [Blog]    [Facebook]

Similar Messages

  • Foreign Keys for a Logical Table

    Hi All,
    I want to know in which scenarios we create the Foreign Keys for a Logical Table. Once we create the foreign key for the logical table, does it mean that it will automatically override if any joins are there.
    Physical Table A, B ( no physical joins)
    Logical Table A, B (logical join B(Dim)-->A(Fact))
    created the foreign key in logical table A with B .(A.1=B.1)
    Will the rpd generate sql with A.1=B.1 join condition for reports.
    I tried to create the logical foreign key for logical table A, I could not see any corresponding table option.Here is its snapshot
    http://tinypic.com/r/jq1gkz/6
    Thanks,
    Virat

    In general when we go complex joins in Physical layer we go for Logical foreign key joins in BMM layer, best examples is SCD Type-II.
    Physical Table A, B ( no physical joins)
    -->You need to have a physical join so that this can be override by BMM layer
    created the foreign key in logical table A with B .(A.1=B.1) Will the rpd generate sql with A.1=B.1 join condition for reports.
    -->Yes you can see this join in BI Physical query.
    I tried to create the logical foreign key for logical table A, I could not see any corresponding table option.Here is its snapshot
    -->2 cases: 1)You need to delete existing logical joins 2) You might not have join in physical layer.
    Hope this helps
    Let me know for issues
    Edited by: Srini VEERAVALLI on Jan 18, 2013 1:29 PM
    BTW: You got very good name, why dont you update in your profile to see your name instead of some number
    Edited by: Srini VEERAVALLI on Jan 18, 2013 1:29 PM

  • Question about how to create FORIGEN KEY constraints against XMLTYPE table

    Hi,
    1.I have a table called SNPLEX_DESIGN which is created as XMLTYPE, the XMLTYPE is refered to a registered XMLschema. The XMLschema has a data element called BATCH_ID, and I create a primary key for the SNPLEX_DESIGN table on the BATCH_ID. The SQL staement as
    ALTER TABLE SNPLEX.SNPLEX_DESIGN ADD (CONSTRAINT "BATCH_ID_PK" PRIMARY KEY(xmldata."BATCH_ID"))
    2. I have another table call SNPLEX_PROCESS which is a regual relational table with a column TOKENID. I would like to create a forign key on TOKENID which needs to refer to the SNPLEX_DESIGN table BATCH_ID_PK primary key.
    But I got error when I try to alter the SNPLEX_PROCESS table.
    SQL> ALTER TABLE "SNPLEX"."SNPLEX_PROCESS" ADD (CONSTRAINT "BATCH_ID_FK" FOREIGN KEY("TOKENID") RE
    FERENCES "SNPLEX"."SNPLEX_DESIGN"(xmldata."BATCH_ID"));
    ERROR at line 1:
    ORA-02298: cannot validate (SNPLEX.BATCH_ID_FK) - parent keys not found
    3. Can someone helps me on this.. I have no problem to create a foreign key in SNPLEX_DESIGN to refere primary key in relational table. But Why I can not do the other way around.
    Any assistances will be appreciated..
    Jinsen

    Hi Jinsen
    As mentioned in the error message not all rows in PROCESS have a corresponding value in DESIGN.
    To find out which are missing do some selects to compare your data or use the exception clause in the ALTER TABLE statement.
    e.g.: ALTER TABLE "SNPLEX"."SNPLEX_PROCESS" ADD (CONSTRAINT "BATCH_ID_FK" FOREIGN KEY("TOKENID") RE
    FERENCES "SNPLEX"."SNPLEX_DESIGN"(xmldata."BATCH_ID")) EXCEPTIONS INTO <exception table>
    Notice that you have to create the <exception table> with the script $ORACLE_HOME/rdbms/admin/utlexcpt.sql.
    Chris

  • How do I find the key for my time capsule router

    How do I find the key for my time capsule router

    Hello, see if these are of any help...
    http://www.iclarified.com/entry/index.php?enid=4547
    http://manuals.info.apple.com/en/TimeCapsule_SetupGuide.pdf
    If it's the Pre-Shared Key you're looking for, open Airport Utility, under the menu item Base Station, look for Equivalent Network Password.

  • How to create transaction code for a Z-table

    How to create transaction code for a Z-table?
    Se93 --> then which radio button to be selected? and what is the program nam e to  be given

    Hi Sam,
    <b>Procedure to create a TCODE for ZTABLE:</b>
    Create a table maintainance/View for the Z* Table.
    Once you create the view goto SE93>Select Parameter transaction and give the short desc.>
    Give the transaction as SM30(Skip the first screen-optional)>Check all check boxes under GUI support>In the default values(grid)section first row give the VIEWNAME as you created initially and the second row UPDATE as X.
    <u><i>Se93 --> then which radio button to be selected</i></u>
    Select the parameter transaction as a radio button.
    <u><i>what is the program nam e to be given</i></u>
    no need to give any program name. Instead you have to give the transaction code name as SM30.
    Pls mark the helpful answers.
    Thanks
    Eswar

  • Hi, Like in our laptop when we press a key for a time then that alphabet's frequency continue to increase.

    Hi,
    Like in our laptop when we press a key for a time then that alphabet's frequency continue to increase.
    for eg. if we press "j" in text then it will be like "jjjjjjjjjjjjj" on screen.
    that function in my macbook pro disabled.
    Please help me with this cause its very irritating.
    Thank You
    <Edited by Host>

    I think it's a keyboard malfunction. Take it to Genius Bar or authorised service centre to fix it up.

  • I'm wondering if there is any way to view the results of the form other than in a spreadsheet?  Is it possible to print responses one by one in PDF format, or word, etc?  I'd like to create a form for proposal applications, and the spreadsheet format resu

    I'm wondering if there is any way to view the results of the form other than in a table?  Is it possible to print responses one by one in PDF format, or word, etc?  I'd like to create a form for proposal applications, and the spreadsheet format results are nearly unusable for this type of form.

    Hi Nalani500 ,
    Yes, you can print the response in a PDF by following the steps suggested below.
    1) Go to the response file
    2) Select the response you want to print
    3) Click on Save as PDF button and it would save the selected response in PDF format.
    Thanks,
    Vikrantt Singh

  • How to create an encrypted key for a user table

    I have an airshow website where volunteers and vendors can apply online (www.hollisterairshow.com) . The city attorney requires that we have a wet signature on a printed application form so the volunteer/ vendor currently has to print their application at the time they apply online, then sign it and mail it in and this works fine. Unfortunately, we have had a lot of instances where volunteers/ vendors needed to print their application again and the only way we could do this was for an administrator to print their application to a pdf file and e-mail the file to them. So, I'd like to improve this process by automatically sending an e-mail to the applicant when they apply online with a link to a printable page and containing a key pointing to their application. This way, volunteers/ vendors could print and sign their application whenever they want and as many times as they need to. Each volunteer is a single row in a volunteer table and each vendor is a single row in a vendor table.
    The key I use in the tables is a sequential key automatically incremented by MySQL so I would end up sending them a link looking something like www.hollisterairshow.com/printvolunteerapp.php?volunteernumber=27 . This would work, but it wouldn't be hard for a volunteer to change it to a different volunteernumber and so get access to someone else's personal information, which would not be acceptable. So, I'm thinking I need a secondary key that is somehow scrambled and used as an secondary index in the table so I'd be sending a link that mght look like www.hollisterairshow.com/printvolunteerapp.php?volunteerkey=sygew . So I'd really appreciate some advice on how to create a scrambled secondary index for each volunteer or vendor and plug it into the link I send them in the e-mail.
    Thanks for any advice.
    Tony

    Your question is not clear whether you want to create account or you want to create agent.
    For creating local agent you can refer
    http://bhabaniranjan.com/configure-odi-11g-local-agent/
    For creating EE Agent you can refer
    http://bhabaniranjan.com/configure-odi-java-ee-agent-on-windows-server-2008-64-bit/
    For creating account, login to supervisor and then go to security tab. There you can create different user to login to odi Studio. Let me know If i understand you correctly or not.
    Thanks.

  • How can I use the SQL to create a primary key for a existing table?

    create table a(bm number,mc varchar2(20));
    when the table was created,i want to make the column bm as
    the primary key and my SQL is "alter table a enable primary key bm",the system show
    me error,how can I write the right one?

    create table a(bm number,mc varchar2(20));
    when the table was created,i want to make the column bm as
    the primary key and my SQL is "alter table a enable primary key bm",the system show
    me error,how can I write the right one? You do not have any primary key defined on your table yet, so, it does not make sense to enable it (if at all possible) !
    You need to add PRIMARY KEY using something like this:
    SQL> alter table a add constraint pk_a_bm primary key (bm) ;

  • How to Create ACCESS key for different users

    How to create or generate an ACCESS KEY which is required to make changes to the table V_FAGL_ACTIVEC (For New General ledger) for IDES 6.0. Is it created in table DEVACCESS, if so where or is it created in SU01 where user id's are maintained. Since I am working on IDES, I thought probably we can create it for each user in SU01, but dont know the steps to do it. Please help me. It is urgent.

    Hi
    ACCESS KEY - First of all its provided by SAP. You can get the key from http://service.sap.com -> SAP SUPPORT PORTAL -> Keys & Requests -> SCCR Keys -> Registration. Here u can register a DEVELOPER or an OBJECT, by this time SAP will give the ACCESS KEYS.
    **Note : To access http://service.sap.com u should have S number login or like that.
    Only after obtaining that ACCESS KEY, SAP will allow the DEVELOPER to create some objects or change or modify Delivered objects.
    Why ACCESS KEY - For creating or accessing any object some one should be responsible. Suppose, any issue arises with an object then can easily track the details who has created or modified.
    Reward with suitable points

  • Can we create secondary index for a cluster table

    hi
    can we create secondary index for a cluster table

    Jyothsna,
    There seems to be some kind of misunderstanding here. You <i>cannot</i> create a secondary index on a cluster table. A cluster table does not exist as a separate physical table in the database; it is part of a "physical cluster". In the case of BSEG for instance, the physical cluster is RFBLG. The only fields of the cluster table that also exist as fields of the physical cluster are the leading fields of the primary key. Taking again BSEG as the example, the primary key includes the fields MANDT, BUKRS, BELNR, GJAHR, BUZEI. If you look at the structure of the RFBLG table, you will see that it has primary key fields MANDT, BUKRS, BELNR, GJAHR, PAGENO. The first four fields are those that all cluster tables inside BSEG have in common. The fifth field, PAGENO, is a "technical" field giving the sequence number of the current record in the series of cluster records sharing the same primary key.
    All the "functional" fields of the cluster table (for BSEG this is field BUZEI and everything beyond that) exist only inside a raw binary object. The database does not know about these fields, it only sees the raw object (the field VARDATA of the physical cluster). Since the field does not exist in the database, it is impossible to create a secondary index on it. If you try to create a secondary index on a cluster table in transaction SE11, you will therefore rightly get the error "Index maintenance only possible for transparent tables".
    Theoretically you could get around this by converting the cluster table to a transparent table. You can do this in the SAP dictionary. However, in practice this is almost never a good solution. The table becomes much larger (clusters are compressed) and you lose the advantage that related records are stored close to each other (the main reason for having cluster tables in the first place). Apart from the performance and disk space hit, converting a big cluster table like BSEG to transparent would take extremely long.
    In cases where "indexing" of fields of a cluster table is worthwhile, SAP has constructed "indexing tables" around the cluster. For example, around BSEG there are transparent tables like BSIS, BSAS, etc. Other clusters normally do not have this, but that simply means there is no reason for having it. I have worked with the SAP dictionary for over 12 years and I have never met a single case where it was necessary to convert a cluster to transparent.
    If you try to select on specific values of a non-transparent field in a cluster without also specifying selections for the primary key, then the database will have to do a serial read of the whole physical cluster (and the ABAP DB interface will have to decompress every single record to extract the fields). The performance of that is monstrous -- maybe that was the reason of your question. However, the solution then is (in the case of BSEG) to query via one of the index tables (where you are free to create secondary indexes since those tables are transparent).
    Hope this clarifies things,
    Mark

  • How to create editable tablecells for a single table row dynamically?

    Hi
    How to make the cell of a tablerow editable based on flag in backing list object bound to row? I can't decide the editable property while creating table columns. So i can't use setCellFactory() during creation. However setCellFactory() makes all cells in table column editable.How to make non-editable table row cell editable and vice-versa based on flag?

    hi
    good
    if you want to create two different view for a same table than you cant give the same name for the same view,otherwise it would allow you to create the view.Try out with different view name as well as the function group name,i hope this ll work.
    thanks
    mrutyun^

  • Create csv file for data in tables

    Hi All,
    I need to "export" data for about 60 tables in one of my databases to a csv file format using a "|" as a separator.
    I know I can do this using a query like:
    select col1 || '|' || col2 || '|' || col3 from table;
    Some of my tables have more than 50 columns so I'm guessing there is an easier way to do this than to construct select SQL statements for each table?
    Thanks in advance.

    I would point out that the OP did not identify the target for the files so it could be an non-Oracle database or Excel in which case external tables would not work since Oracle only writes to external tables in datapump format.  If the target is another Oracle database then external tables would be an option.  If external tables are an option then insert/select over a database link would be a potential alternate approach to using csv files.
    I use a SQL script to generate the Select statement to create my csv files.
    set echo off
    rem
    rem SQL*Plus script to create comma delimited output file from table
    rem
    rem 20000614  Mark D Powell   Automate commonly done task
    rem
    set pagesize  0
    set verify    off
    set feedback  off
    set linesize  999
    set trimspool on
    accept owner    prompt 'Enter table owner => '
    accept tblname  prompt 'Enter table name => '
    spool csv2.sql
    select 'select ' from sys.dual;
    select decode(column_id,1,column_name,
                 '||''|''||'||column_name)
    from   sys.dba_tab_columns
    where  table_name = upper('&&tblname')
    and    owner      = upper('&&owner')
    order by column_id;
    select 'from &&owner..&&tblname;'
    from   sys.dual;
    spool off
    undefine owner
    undefine tblname
    HTH -- Mark D Powell --

  • How to create object class for a z table

    Hi All,
    I have a z table and I want to register the changes of fields should be logged to CDHDR and CDPOS table.
    Is this possible?
    If yes how can I creat an object class for a z table. I have already checked the change document option in z data element.
    Please help.
    Regards,
    Jeetu
    Moderator message: standard functionality, please search for available information/documentation before asking.
    locked by: Thomas Zloch on Oct 6, 2010 6:16 PM

    Tcode SCDO. You'll need to create a change document for you Z table and then use the FM created to record the changed data.

  • Creating a flatfile for muli- date table

    I am creating a flatfile for reporting purposes. The ASSESSMENT tables can have up to two assessment_date, assessment_type_code per transaction_ID
    ie ASSESSMENT
    Record 1
    TRANSACTION_ID = 1234
    ASSESSMENT_TYPE_CODE = 'ABC;
    ASSESSMENT_DATE = 01/06/2006;
    Record 2
    TRANSACTION_ID = 1234
    ASSESSMENT_TYPE_CODE = 'BBC;
    ASSESSMENT_DATE = 17/06/2006;
    How do I change this update statement to store both records in the flatfile.
    UPDATE FLATFILE2003
    SET
    ASSESSMENT_TYPE_CODE_1 = (SELECT ASSESSMENT_TYPE_CODE FROM ASSESSMENT F WHERE FLATFILE2003.TRANSACTION_ID = F.TRANSACTION_ID AND ?),
    ASSESSMENT_DATE_1 = (SELECT ASSESSMENT_DATE FROM ASSESSMENT F WHERE FLATFILE2003.TRANSACTION_ID = F.TRANSACTION_ID AND ?),
    ASSESSMENT_TYPE_CODE_2 = (SELECT ASSESSMENT_TYPE_CODE FROM ASSESSMENT F WHERE FLATFILE2003.TRANSACTION_ID = F.TRANSACTION_ID AND ?),
    ASSESSMENT_DATE_2 = (SELECT ASSESSMENT_DATE FROM ASSESSMENT F WHERE FLATFILE2003.TRANSACTION_ID = F.TRANSACTION_ID AND ?)
    Thanks
    Brendon

    Do you mean something like this?
    WITH rec1 AS (SELECT 1234  TRANSACTION_ID,
                         'ABC' ASSESSMENT_TYPE_CODE,
                         TO_DATE('01/06/2006', 'dd/mm/yyyy') ASSESSMENT_DATE
                    FROM dual
                   UNION
                  SELECT 1235  TRANSACTION_ID,
                         'ABC' ASSESSMENT_TYPE_CODE,
                         TO_DATE('01/06/2006', 'dd/mm/yyyy') ASSESSMENT_DATE
                    FROM dual),
         rec2 AS (SELECT 1234  TRANSACTION_ID,
                         'BBC' ASSESSMENT_TYPE_CODE,
                         TO_DATE('17/06/2006', 'dd/mm/yyyy') ASSESSMENT_DATE
                    FROM dual
                   UNION
                  SELECT 1236  TRANSACTION_ID,
                         'BBC' ASSESSMENT_TYPE_CODE,
                         TO_DATE('17/06/2006', 'dd/mm/yyyy') ASSESSMENT_DATE
                    FROM dual)
    SELECT rec1.transaction_id       transaction_id,
           rec1.assessment_type_code assessment_type_code_1,
           rec1.assessment_date      assessment_date_1,
           rec2.assessment_type_code assessment_type_code_2,
           rec2.assessment_date      assessment_date_2
      FROM rec1, rec2
    WHERE rec1.transaction_id = rec2.transaction_id
    UNION ALL
    SELECT rec1.transaction_id       transaction_id,
           rec1.assessment_type_code assessment_type_code_1,
           rec1.assessment_date      assessment_date_1,
           rec2.assessment_type_code assessment_type_code_2,
           rec2.assessment_date      assessment_date_2
      FROM rec1, rec2
    WHERE rec1.transaction_id = rec2.transaction_id(+)
       AND rec2.transaction_id IS NULL
    UNION ALL
    SELECT rec2.transaction_id       transaction_id,
           rec1.assessment_type_code assessment_type_code_1,
           rec1.assessment_date      assessment_date_1,
           rec2.assessment_type_code assessment_type_code_2,
           rec2.assessment_date      assessment_date_2
      FROM rec1, rec2
    WHERE rec1.transaction_id(+) = rec2.transaction_id
       AND rec1.transaction_id IS NULL
    ;C.

Maybe you are looking for

  • Issue with User Variable Due Shared Member Security Access

       Hi All, One of my client is using User variable in data form to define POV. Now if user has access to 2 member in the Dimension, he should able to see 2 member when he try to assign the value to this "user variable" but he can see some of the pare

  • Pdf pages display blank in safari

    Using Safari, when I go to a webpage with a .pdf URL the page is blank.  I recently upgraded to Lion and purchased/installed Adobe Acrobat X Pro  (I was using Acrobat 7.0 with Snow Leopard). The only to access these types of pages is by trying to dow

  • How does my application save the raw data to binary file?

    Hi all, At first, please look at my attachment. There is the part of my code (it is inside of a while loop) which saves a raw data from my firewire camera. I am thinking how does this saving process work? How does it save the data in each while loop'

  • How can I get the "OK" button to light up to post the URL?

    I am trying to post the URL but the OK button does not light up.

  • Class VIs for access to private Data: reentrant or not?

    I just created in a class some VIs for access to private data (my German translation). I'm talking about these VIs, which enable you to connect your class object to a property node to read or write private class data. These VIs are by default non-ree