ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to Set Current Date/Time in PFTBL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Set Current Date/Time in PFTBL

    Hi All,

    Could anybody tell me, How set the Current Date, Time and Time Stamp value in PFTBL fields.

    Please send DDS.

    Thanks,
    Vishal

  • #2
    Re: How to Set Current Date/Time in PFTBL

    ever hear of Google? it's a wonderful tool. and why do you want this in DDS? you should really build new tables using DDL (unless the powers that be impose stupidity on you). go to IBM's infocenter and look this up PLEASE...
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: How to Set Current Date/Time in PFTBL

      Whats PFTBL (physical file table)??? are you saying how do I display the date & time on DDS?

      in DDS there are date and time keywords just type *DATE and/or *TIME
      and there ya go....

      Please be a bit more specific as to what you are actually trying to do.

      thanks
      jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment


      • #4
        Re: How to Set Current Date/Time in PFTBL

        Hi,

        My requirement is to,

        Create table, which as type PFTBL.
        In table, Date, Time and Time Stamp are fields.

        When inserting a record to table, these Date, Time and Time Stamp should be display in Current Date, Time and Time Stamp.

        How to set the Current Date, Time and Time Stamp by default in table.

        Thanks,
        Vishal.

        Comment


        • #5
          Re: How to Set Current Date/Time in PFTBL

          AFAIK this will not be possible with DDS!
          You need to fill your Date and Time-Fields with the System Date and Time within your Source Code.

          With SQL it is possible to define a DEFAULT for Date and Time fields:

          PHP Code:
          Create Table ...
          (
          MyDate Date Default Current_Date, ... 
          Birgitta

          Comment


          • #6
            Re: How to Set Current Date/Time in PFTBL

            not be possible with DDS ?

            Yes, be can !

            DDS datatypes

            Type P to indicate Packed Decimal data.
            Type S to indicate Zoned Decimal data.
            Type B to indicate Binary data.
            Type F to indicate Floating Point data.
            Type A to indicate Character data.
            Type L to indicate Date data.
            Type T to indicate Time data.
            Type Z to indicate Time stamp data.
            Type H to indicate Hexadecimal data.

            When you update a record with datatype L , T or Z
            and you haven't give the L , T or Z fields any value,
            then the AS400 will write the current date, time or timestamp to the PF.

            Haven't test this method myself, but my DB book said so.

            Comment


            • #7
              Re: How to Set Current Date/Time in PFTBL

              I heard if I take a tiny blue pill I become like the superman!

              but.....
              Haven't test this method myself, but my DB book said so.
              I'm here to chew bubble gum and kick @#%@#%@#%.....and I'm all outta bubble gum !
              Yes I'm talking to you squirrel nuts.

              Comment


              • #8
                Re: How to Set Current Date/Time in PFTBL

                Originally posted by Marc_d View Post
                not be possible with DDS ?

                Yes, be can !

                DDS datatypes

                Type P to indicate Packed Decimal data.
                Type S to indicate Zoned Decimal data.
                Type B to indicate Binary data.
                Type F to indicate Floating Point data.
                Type A to indicate Character data.
                Type L to indicate Date data.
                Type T to indicate Time data.
                Type Z to indicate Time stamp data.
                Type H to indicate Hexadecimal data.

                When you update a record with datatype L , T or Z
                and you haven't give the L , T or Z fields any value,
                then the AS400 will write the current date, time or timestamp to the PF.

                Haven't test this method myself, but my DB book said so.

                dude it is wrong do not be misunderstood...

                just by giving l date type and time t u can not get current date time dear...
                for date it will give default 0001-01-01 time 00.00.00 will be there

                i think with dds not possible.
                Young people knows how to run fast but old people knows the way..

                Comment

                Working...
                X