Oracle and asp.....still cannot figure this out.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • clinttoris@hotmail.com

    #16
    Re: Oracle and asp.....still cannot figure this out.


    Turkbear wrote:[color=blue]
    > On 19 Jun 2006 05:26:43 -0700, clinttoris@hotm ail.com wrote:
    >[color=green]
    > >[/color]
    >[color=green]
    > >
    > >
    > >
    > >Hmmm, I'm confused on the last statement made only because I have
    > >specified both date and time and it is still only submitting date.
    > >Here is the code
    > >
    > >to_char('" & Now() & "','dd/mm/yyyy hh24:mi:ss PM') Any other ideas?[/color]
    >
    > Please post the actual output from
    > Response.Write( ssqlCheckBox )...
    >
    > And from
    >
    > Response.Write( Now())
    >
    > You maty have to assign the output of the Now() function to a variable an duse that in the concatenation:
    >
    > Dim cdandt = Now();
    > to_date('" & cdandt & "','dd/mm/yyyy hh24:mi:ss PM') ( Remember : To_Date when INSERTING, To_Char when retreiving..)[/color]

    Hello Turkbear,

    yes I did assign a variable and I read from the variable and it has not
    been working. Here is what you requested.

    Here is the output of Response.Write( ssqlCheckBox )...
    INSERT INTO
    Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er) VALUES
    (1,'1', 'b', to_date('19/06/2006 11:33:06 AM','dd/mm/yyyy hh:mi:ss
    PM'))

    And here is the output of Response.Write( Curdate)
    19/06/2006 11:34:32 AM

    here is my syntax
    CurDate= Now()
    ssqlCheckBox = "INSERT INTO
    Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er,
    user_Id) VALUES (" & SurveyID & ",'" & objRS("Question _Id") & "', '" &
    answerChoices(a nswerChoice) & "', to_date('" & Now() & "','dd/mm/yyyy
    hh:mi:ss PM'), " & user & ")"

    Comment

    • clinttoris@hotmail.com

      #17
      Re: Oracle and asp.....still cannot figure this out.


      Pedro Leite wrote:[color=blue]
      > I REMEMBER
      >
      > had this trouble before on an MS Product.
      >
      > it was a month thing
      >
      > English --> Portuguese
      >
      > JAN --> JAN
      > FEV --> FEV
      > MAR --> MAR
      > APR --> ABR **
      > JUN --> JUN
      > JUL --> JUL
      > AUG --> AGO **
      > SEP --> SET
      > OCT --> OUT **
      > NOV --> NOV
      > DEC --> DEZ **
      >
      > some months were ok, some not, and it was the literal form, ie, trying to
      > insert ABR when shoule be APR.
      >
      > Locale was the man.
      >
      > hth
      >
      > Pedro Leite From Portugal.
      > ------------------------------------------------------------
      > "Turkbear" <noone@nowhere. com> escreveu na mensagem
      > news:pbdd921t1q 13d1m3dpjli96p2 gvnclg7jg@4ax.c om...[color=green]
      > > On 19 Jun 2006 05:26:43 -0700, clinttoris@hotm ail.com wrote:
      > >[color=darkred]
      > >>[/color]
      > >[color=darkred]
      > >>
      > >>
      > >>
      > >>Hmmm, I'm confused on the last statement made only because I have
      > >>specified both date and time and it is still only submitting date.
      > >>Here is the code
      > >>
      > >>to_char('" & Now() & "','dd/mm/yyyy hh24:mi:ss PM') Any other ideas?[/color]
      > >
      > > Please post the actual output from
      > > Response.Write( ssqlCheckBox )...
      > >
      > > And from
      > >
      > > Response.Write( Now())
      > >
      > > You maty have to assign the output of the Now() function to a variable an
      > > duse that in the concatenation:
      > >
      > > Dim cdandt = Now();
      > > to_date('" & cdandt & "','dd/mm/yyyy hh24:mi:ss PM') ( Remember :
      > > To_Date when INSERTING, To_Char when retreiving..)
      > >
      > >[/color][/color]

      hello Pedro,

      Locale. How do I check this. You are referring to the locale on the
      server. Any idea of the comand in Oracle to check this? Thanks.

      Comment

      • Pedro Leite

        #18
        Re: Oracle and asp.....still cannot figure this out.

        hi

        as turkbear suggested, response.write both now() and the sqlstatement
        generated by the asp scrip.
        still on your side, copy + paste to oracle sql debugger ( whatever ) and
        execute it.

        what shows ?? errors or execute ok ??

        Locale is the country settings on client and server machines ( assuming ms )
        check control panel > regional settings. see if there is any difference on
        language, date format, something related.

        PLeite


        <clinttoris@hot mail.com> escreveu na mensagem
        news:1150731403 .814320.280090@ c74g2000cwc.goo glegroups.com.. .[color=blue]
        >
        > Turkbear wrote:[color=green]
        >> On 19 Jun 2006 05:26:43 -0700, clinttoris@hotm ail.com wrote:
        >>[color=darkred]
        >> >[/color]
        >>[color=darkred]
        >> >
        >> >
        >> >
        >> >Hmmm, I'm confused on the last statement made only because I have
        >> >specified both date and time and it is still only submitting date.
        >> >Here is the code
        >> >
        >> >to_char('" & Now() & "','dd/mm/yyyy hh24:mi:ss PM') Any other ideas?[/color]
        >>
        >> Please post the actual output from
        >> Response.Write( ssqlCheckBox )...
        >>
        >> And from
        >>
        >> Response.Write( Now())
        >>
        >> You maty have to assign the output of the Now() function to a variable an
        >> duse that in the concatenation:
        >>
        >> Dim cdandt = Now();
        >> to_date('" & cdandt & "','dd/mm/yyyy hh24:mi:ss PM') ( Remember :
        >> To_Date when INSERTING, To_Char when retreiving..)[/color]
        >
        > Hello Turkbear,
        >
        > yes I did assign a variable and I read from the variable and it has not
        > been working. Here is what you requested.
        >
        > Here is the output of Response.Write( ssqlCheckBox )...
        > INSERT INTO
        > Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er) VALUES
        > (1,'1', 'b', to_date('19/06/2006 11:33:06 AM','dd/mm/yyyy hh:mi:ss
        > PM'))
        >
        > And here is the output of Response.Write( Curdate)
        > 19/06/2006 11:34:32 AM
        >
        > here is my syntax
        > CurDate= Now()
        > ssqlCheckBox = "INSERT INTO
        > Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er,
        > user_Id) VALUES (" & SurveyID & ",'" & objRS("Question _Id") & "', '" &
        > answerChoices(a nswerChoice) & "', to_date('" & Now() & "','dd/mm/yyyy
        > hh:mi:ss PM'), " & user & ")"
        >[/color]


        Comment

        • Pedro Leite

          #19
          Re: Oracle and asp.....still cannot figure this out.

          another thing

          just remembered.

          when constructing a date string, i had to enclose the string in hashes "#",
          but for sql server.

          -------------------------------------------------------
          <clinttoris@hot mail.com> escreveu na mensagem
          news:1150731403 .814320.280090@ c74g2000cwc.goo glegroups.com.. .[color=blue]
          >
          > Turkbear wrote:[color=green]
          >> On 19 Jun 2006 05:26:43 -0700, clinttoris@hotm ail.com wrote:
          >>[color=darkred]
          >> >[/color]
          >>[color=darkred]
          >> >
          >> >
          >> >
          >> >Hmmm, I'm confused on the last statement made only because I have
          >> >specified both date and time and it is still only submitting date.
          >> >Here is the code
          >> >
          >> >to_char('" & Now() & "','dd/mm/yyyy hh24:mi:ss PM') Any other ideas?[/color]
          >>
          >> Please post the actual output from
          >> Response.Write( ssqlCheckBox )...
          >>
          >> And from
          >>
          >> Response.Write( Now())
          >>
          >> You maty have to assign the output of the Now() function to a variable an
          >> duse that in the concatenation:
          >>
          >> Dim cdandt = Now();
          >> to_date('" & cdandt & "','dd/mm/yyyy hh24:mi:ss PM') ( Remember :
          >> To_Date when INSERTING, To_Char when retreiving..)[/color]
          >
          > Hello Turkbear,
          >
          > yes I did assign a variable and I read from the variable and it has not
          > been working. Here is what you requested.
          >
          > Here is the output of Response.Write( ssqlCheckBox )...
          > INSERT INTO
          > Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er) VALUES
          > (1,'1', 'b', to_date('19/06/2006 11:33:06 AM','dd/mm/yyyy hh:mi:ss
          > PM'))
          >
          > And here is the output of Response.Write( Curdate)
          > 19/06/2006 11:34:32 AM
          >
          > here is my syntax
          > CurDate= Now()
          > ssqlCheckBox = "INSERT INTO
          > Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er,
          > user_Id) VALUES (" & SurveyID & ",'" & objRS("Question _Id") & "', '" &
          > answerChoices(a nswerChoice) & "', to_date('" & Now() & "','dd/mm/yyyy
          > hh:mi:ss PM'), " & user & ")"
          >[/color]


          Comment

          • Turkbear

            #20
            Re: Oracle and asp.....still cannot figure this out.

            On 19 Jun 2006 08:36:43 -0700, clinttoris@hotm ail.com wrote:
            [color=blue]
            >
            >Turkbear wrote:[/color]
            [color=blue]
            >Hello Turkbear,
            >
            >yes I did assign a variable and I read from the variable and it has not
            >been working. Here is what you requested.
            >
            >Here is the output of Response.Write( ssqlCheckBox )...
            >INSERT INTO
            >Survey_User_An swer(Survey_Id, Question_Id,Ans wer_Id,Date_Ans wer) VALUES
            >(1,'1', 'b', to_date('19/06/2006 11:33:06 AM','dd/mm/yyyy hh:mi:ss
            >PM'))
            >
            >And here is the output of Response.Write( Curdate)
            >19/06/2006 11:34:32 AM
            >
            >here is my syntax
            >CurDate= Now()
            >ssqlCheckBox = "INSERT INTO
            >Survey_User_An swer(Survey_Id, Question_Id,Ans wer_Id,Date_Ans wer,
            >user_Id) VALUES (" & SurveyID & ",'" & objRS("Question _Id") & "', '" &
            >answerChoices( answerChoice) & "', to_date('" & Now() & "','dd/mm/yyyy
            >hh:mi:ss PM'), " & user & ")"[/color]

            Shouldn't it be:
            CurDate= Now()
            ssqlCheckBox = "INSERT INTO
            Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er,
            user_Id) VALUES (" & SurveyID & ",'" & objRS("Question _Id") & "', '" &
            answerChoices(a nswerChoice) & "', to_date('" & CurDate & "','dd/mm/yyyy hh:mi:ss PM'), " & user & ")"


            Now, please show the output you get with a

            Select to_char(Date_An swer,'dd/mm/yyyy hh:mi:ss PM') from Survey_User_Ans wer;

            in SqlPlus







            Comment

            • clinttoris@hotmail.com

              #21
              Re: Oracle and asp.....still cannot figure this out.


              Turkbear wrote:[color=blue]
              > On 19 Jun 2006 08:36:43 -0700, clinttoris@hotm ail.com wrote:
              >[color=green]
              > >
              > >Turkbear wrote:[/color]
              >[color=green]
              > >Hello Turkbear,
              > >
              > >yes I did assign a variable and I read from the variable and it has not
              > >been working. Here is what you requested.
              > >
              > >Here is the output of Response.Write( ssqlCheckBox )...
              > >INSERT INTO
              > >Survey_User_An swer(Survey_Id, Question_Id,Ans wer_Id,Date_Ans wer) VALUES
              > >(1,'1', 'b', to_date('19/06/2006 11:33:06 AM','dd/mm/yyyy hh:mi:ss
              > >PM'))
              > >
              > >And here is the output of Response.Write( Curdate)
              > >19/06/2006 11:34:32 AM
              > >
              > >here is my syntax
              > >CurDate= Now()
              > >ssqlCheckBox = "INSERT INTO
              > >Survey_User_An swer(Survey_Id, Question_Id,Ans wer_Id,Date_Ans wer,
              > >user_Id) VALUES (" & SurveyID & ",'" & objRS("Question _Id") & "', '" &
              > >answerChoices( answerChoice) & "', to_date('" & Now() & "','dd/mm/yyyy
              > >hh:mi:ss PM'), " & user & ")"[/color]
              >
              > Shouldn't it be:
              > CurDate= Now()
              > ssqlCheckBox = "INSERT INTO
              > Survey_User_Ans wer(Survey_Id,Q uestion_Id,Answ er_Id,Date_Answ er,
              > user_Id) VALUES (" & SurveyID & ",'" & objRS("Question _Id") & "', '" &
              > answerChoices(a nswerChoice) & "', to_date('" & CurDate & "','dd/mm/yyyy hh:mi:ss PM'), " & user & ")"
              >
              >
              > Now, please show the output you get with a
              >
              > Select to_char(Date_An swer,'dd/mm/yyyy hh:mi:ss PM') from Survey_User_Ans wer;
              >
              > in SqlPlus[/color]

              Sorry Turkbear,

              You are correct in the syntax. I was trying to get it to work and when
              I sent you the syntax I incorrectly sent you the wrong thing. Anyways,
              here is the output with the above select that you mentioned

              19/06/2006 01:55:25 PM

              Comment

              • Turkbear

                #22
                Re: Oracle and asp.....still cannot figure this out.

                On 19 Jun 2006 10:58:07 -0700, clinttoris@hotm ail.com wrote:
                [color=blue]
                >
                >Turkbear wrote:[color=green]
                >> On 19 Jun 2006 08:36:43 -0700, clinttoris@hotm ail.com wrote:
                >>[color=darkred]
                >> >[/color][/color]
                >[color=green]
                >>
                >> Now, please show the output you get with a
                >>
                >> Select to_char(Date_An swer,'dd/mm/yyyy hh:mi:ss PM') from Survey_User_Ans wer;
                >>
                >> in SqlPlus[/color]
                >
                >Sorry Turkbear,
                >
                >You are correct in the syntax. I was trying to get it to work and when
                >I sent you the syntax I incorrectly sent you the wrong thing. Anyways,
                >here is the output with the above select that you mentioned
                >
                >19/06/2006 01:55:25 PM[/color]

                That looks correct, is it not?

                The entire dateTime values are being stored and returned..




                Comment

                • clinttoris@hotmail.com

                  #23
                  Re: Oracle and asp.....still cannot figure this out.


                  Turkbear wrote:[color=blue]
                  > On 19 Jun 2006 10:58:07 -0700, clinttoris@hotm ail.com wrote:
                  >[color=green]
                  > >
                  > >Turkbear wrote:[color=darkred]
                  > >> On 19 Jun 2006 08:36:43 -0700, clinttoris@hotm ail.com wrote:
                  > >>
                  > >> >[/color]
                  > >[color=darkred]
                  > >>
                  > >> Now, please show the output you get with a
                  > >>
                  > >> Select to_char(Date_An swer,'dd/mm/yyyy hh:mi:ss PM') from Survey_User_Ans wer;
                  > >>
                  > >> in SqlPlus[/color]
                  > >
                  > >Sorry Turkbear,
                  > >
                  > >You are correct in the syntax. I was trying to get it to work and when
                  > >I sent you the syntax I incorrectly sent you the wrong thing. Anyways,
                  > >here is the output with the above select that you mentioned
                  > >
                  > >19/06/2006 01:55:25 PM[/color]
                  >
                  > That looks correct, is it not?
                  >
                  > The entire dateTime values are being stored and returned..[/color]


                  Hmmm I see. Does Oracle not store the time values or do you only see
                  this when you do a to_char? I guess that is where I am having the
                  issues. I am used to Datetime in Sql Server and actually see the whole
                  datetime as opposed to only seeing a date and then do a to_char on that
                  date. I apologize then, it is working I was just confused with how
                  oracle treats and stores the value.

                  Comment

                  • Turkbear

                    #24
                    Re: Oracle and asp.....still cannot figure this out.

                    On 19 Jun 2006 11:26:51 -0700, clinttoris@hotm ail.com wrote:
                    [color=blue]
                    >[/color]
                    [color=blue][color=green][color=darkred]
                    >> >
                    >> >19/06/2006 01:55:25 PM[/color]
                    >>
                    >> That looks correct, is it not?
                    >>
                    >> The entire dateTime values are being stored and returned..[/color]
                    >
                    >
                    >Hmmm I see. Does Oracle not store the time values or do you only see
                    >this when you do a to_char? I guess that is where I am having the
                    >issues. I am used to Datetime in Sql Server and actually see the whole
                    >datetime as opposed to only seeing a date and then do a to_char on that
                    >date. I apologize then, it is working I was just confused with how
                    >oracle treats and stores the value.[/color]


                    Right..as I stated before, Oracle, unless 'asked to by the to_char function' will not show the time component, even
                    though it is stored in the database - Do not confuse what the DISPLAY format is with how it is actually stored ( it is
                    really stored as a compound number that gets translated according to the mask requested for display - the system
                    default is DD-MON-YY )

                    This can be very, very confusing to newcomers to Oracle and there is absolutely no need to apologise....


                    Select sysdate from dual;
                    19-JUN-06

                    Select to_char(sysdate ,'mm/dd/yyyy hh:mi:ss AM') from dual;
                    06/19/2006 02:14:37 PM


                    Comment

                    • clinttoris@hotmail.com

                      #25
                      Re: Oracle and asp.....still cannot figure this out.


                      Turkbear wrote:[color=blue]
                      > On 19 Jun 2006 11:26:51 -0700, clinttoris@hotm ail.com wrote:
                      >[color=green]
                      > >[/color]
                      >[color=green][color=darkred]
                      > >> >
                      > >> >19/06/2006 01:55:25 PM
                      > >>
                      > >> That looks correct, is it not?
                      > >>
                      > >> The entire dateTime values are being stored and returned..[/color]
                      > >
                      > >
                      > >Hmmm I see. Does Oracle not store the time values or do you only see
                      > >this when you do a to_char? I guess that is where I am having the
                      > >issues. I am used to Datetime in Sql Server and actually see the whole
                      > >datetime as opposed to only seeing a date and then do a to_char on that
                      > >date. I apologize then, it is working I was just confused with how
                      > >oracle treats and stores the value.[/color]
                      >
                      >
                      > Right..as I stated before, Oracle, unless 'asked to by the to_char function' will not show the time component, even
                      > though it is stored in the database - Do not confuse what the DISPLAY format is with how it is actually stored ( it is
                      > really stored as a compound number that gets translated according to the mask requested for display - the system
                      > default is DD-MON-YY )
                      >
                      > This can be very, very confusing to newcomers to Oracle and there is absolutely no need to apologise....
                      >
                      >
                      > Select sysdate from dual;
                      > 19-JUN-06
                      >
                      > Select to_char(sysdate ,'mm/dd/yyyy hh:mi:ss AM') from dual;
                      > 06/19/2006 02:14:37 PM[/color]

                      This is perfect Turkbear. Really appreciate all your help and
                      everyone's help on this. This really clarified a lot for me. Have a
                      great day.

                      Comment

                      Working...