Re: DBDATE / DBMONEY in SQL ändern ??



On Tue, 2007-07-10 at 14:19 +0100, Marco Greco wrote:

Carsten Haese wrote:
On Tue, 2007-07-10 at 09:39 +0000, hoffiman@xxxxxxxxxxxxxx wrote:
Hallo zusammen,

ich möchte ein Daten in die Datenbank landen - in den Daten ist das
Datum mit 2007-07-10 angegeben.

Ich möchte die Daten aber nicht mit dbload sondern mit dem Befehl load
laden.

ist es möglich das Datumsformat unter SQL zu ändern.

Wenn ich die Enviorment Variable DBDATE ändere dann gilt das gleich
für die ganze Season und ich muss unter Unix laden.

Danke und Gruß

Matthias

[Note that this list is usually in English. Your chances of reaching a
knowledgeable person increase dramatically if you restate your question
in English.]

Mir ist keine Möglichkeit bekannt, das Datumsformat durch einen
SQL-Befehl zu verändern. Eine Möglichkeit wäre es, die Daten zuerst in
eine Hilfstabelle zu laden. Die Hilfstabelle würde identisch zur
Zieltabelle aussehen, außer das Date-spalten durch Char(10)-spalten
ersetzt sind. Danach kann man dann die Daten in die Zieltabelle
übertragen und die Datumsspalten mit mdy(x[6,7],x[9,10],x[1,4]) in
richtige Daten übersetzen.

In English:

I'm not aware of a way to set the date format with an SQL command. One
possibility would be to load the data into an auxiliary table that is
identical to the target table except that date columns are replaced by
char(10) columns. You can then transfer the data to the target table and
translate the date columns with mdy(x[6,7],x[9,10],x[1,4]) into real
dates.

Hope this helps,

Dates and datetimes have their own storage format which is independent of any
string representation.
You have several options to format string representation of dates, from the
DBDATE environmental variable to the TO_CHAR function.

I fail to see how that helps the OP. He wants to get the date from the
string, not the string from the date, and for reasons he doesn't make
entirely clear, he doesn't want to set the DBDATE variable.

--
Carsten Haese
http://informixdb.sourceforge.net


.



Relevant Pages

  • Re: DBDATE / DBMONEY in SQL =?ISO-8859-1?Q?=E4ndern_=3F=3F?=
    ... [Note that this list is usually in English. ... I'm not aware of a way to set the date format with an SQL command. ... You can then transfer the data to the target table and ... Dates and datetimes have their own storage format which is independent of any ...
    (comp.databases.informix)
  • Re: DBDATE / DBMONEY in SQL =?ISO-8859-1?Q?=E4ndern_=3F=3F?=
    ... You can then transfer the data to the target table and ... Dates and datetimes have their own storage format which is independent of any ... You have several options to format string representation of dates, ... DBDATE environmental variable to the TO_CHAR function. ...
    (comp.databases.informix)
  • Re: And so we come to SA vs England...
    ... dramatic elements. ... And it was a 2nd string SA side. ... That try that Vd Linde scored against the English - never in your life ...
    (rec.sport.rugby.union)
  • Re: Could not convert variant of type (Null) into type (String)
    ... My English is pretty bad too... ... -If you are setting a field in you SQL database which is requiring a string ... Working through these issues I found it useful to watch the database ...
    (borland.public.delphi.database.ado)
  • Re: Substituting the main menu bar(s)
    ... The tooltip/Menu text string is only one string, which is delimited by '\n', ... language but if worst comes to worst in the default hardcoded language. ... like everything to be in English, partly because my user guide is in ... But you could get around this by having two dictionaries ...
    (microsoft.public.vc.mfc)