Convert the value of timestamp in format hours
Hi allI want to convert a value of time in time stamp foramt.
How to do this?
Thank you
Olivier
Swapna,
This is the third thread where you asked the same question.
For more information on CHS and Timo, Swapna has TIMESTAMP columns in the database (not Java timestamps).
Swapna, let's make this easy. Just create a view in your database that has the additional column you want (do you, after all to have SQL to do this from another thread). Then, just to make your select EO/VO from the point of view of database.
John
Tags: Java
Similar Questions
-
replace some symbols and converts the value to a number
Hi all. I've got bp_link table with 'avalue' column VARCHAR2 (200). If I can find a different version of p here:
(a) 100%
(b) 100
(c) 100.00
(d) 100.00
(e) null
(f) symbol of space
(I hope that all versions are mentioned).
So I try to replace some symbols and convert the value to a number using the following steps:
NVL(Avalue,0) - removes the null value
Replace (NVL(Avalue,0), '%', ")-removes the symbol '% '.
Replace (Replace (NVL(Avalue,0), '%', "), ',','. ')-remove a symbol «,»
Trim (Replace (Replace (NVL(Avalue,0),'%',''),',','.')) - removes the symbol space)))
TO_CHAR (Trim (Replace (Replace (NVL(Avalue,0), '%', "), ', '.'")), "FM999999999999.90")-converts format "100.00".
But it still does not, maybe I don't see anything else.
When I just "select * from...". "it works:
Select to_char (trim (replace (replace (nvl(avalue,0), '%', "), ', '.'")), "FM999999999999.90")
as avalue of JJ bp_link where roletypeid = 9
But when I try "order by avalue" ends with error - ORA-01722: invalid number
Select to_char (trim (replace (replace (nvl(avalue,0), '%', "), ', '.'")), "FM999999999999.90")
as avalue of JJ bp_link where roletypeid = 9
order of dd.avalue
What can I do else?Maybe this will help you
http://nimishgarg.blogspot.com/2010/04/Oracle-SQL-extract-numbers-from-string.html -
I am trying to create layers with a JPEG originally published in LR6. I converted the JPEG in a TIF format for my PES 11. PSE does not recognize the file for purposes of superposition; None of the routes command works. Just to see if PES was grateful the file at all, I tried to turn the file. Fortunately, he rotates the photo and turned it back. Why the program allow me to create layers?
You click on Expert in pse before trying to add layers?
Or it is possible that the image is 16-bit/channel.
In photoshop elements go to Image > Mode and click on 8-bit/channel and see if that makes a difference.
-
PHP convert the variable date of table format
I can not explain this without showing all the code...
I have a script which basically scrape information off the myspace site and updates the information in a table. I then had the script put this in tabular form. The problem that I'm hoping to get help, I would like to change the date format, and I don't know how I can do this since it is Setup how to loop through the table. If anyone can show me a better way to do it without a loop or a way to convert the date, I'd be very happy.
18/06/2009 22:00-Thursday, June 18, 2009 22:00
<? PHP
include('simplehtmldom/simple_html_dom.php');
$myspace_url = "url I'm scraping."
ini_set ('user_agent', ' scratch/2.5');
$html = file_get_html ($myspace_url);
$i = 0;
foreach ($html-> find ('input [type = "hidden"]') as $k = > $v) {}
If ($v-> name == "calEvtLocation") {}
$shows [$i] ['location'] is $v-> value;.
}
If ($v-> name == "calEvtCity") {}
$shows [$i] ['city'] is $v-> value;.
}
If ($v-> name == "calEvtState") {}
$shows [$i] ['State'] is $v-> value;.
}
If ($v-> name == "calEvtDateTime") {}
$shows [$i] ['date'] is $v-> value;.
$i++;
}
}
? >
< table border = "0" align = "center" cellpadding = "8" cellspacing = "0" >
< b >
< e style = "text-align: left;" do-size: 12px; "> < /th > venue
< e style = "text-align: left;" do-size: 12px; ' > city < /th >
< e style = "text-align: left;" do-size: 12px; "> Status < /th >
< e style = "text-align: left;" do-size: 12px; "> date/time < /th >
< /tr >
<? PHP
foreach ($shows as $show)
{
echo "< tr >";
foreach ($show as $item)
{
echo "< td > < table > $item";
}
echo "< /tr >";
}
? >
< /table >
Move the $i ++ should not have any effect on the way in which items are displayed thereafter.
How I would deal with the table is like this:
Venue City State Date/Time {$show['Location']} {$show['City']} {$show['State']} {$show['Date']} "; } ?>ChnLinGenImp do not convert the value of units
Hello
I use the ChnLinGenImp command in a creation of such as channel below.
--> Call ChnLinGenImp(SpecChannelName,length,SpecNumber*1,0,Unit)
The question that I am running, I run the script for a conversion unit that converts the units if they are incorrect. However the part convert does not convert the IMP channel, because it is a path of IMP. Is in any way around that in addition to going to the ChnLinGen command?
Hello J,
Only two options I know in tiara 2012 are:
(1) give and make a meaningful string instead of an implicit string and let conversions of unit of the tiara to manage all
(2) manage your implicit channels separately and re-create them whenever there is a change of unit - but you have to manage the offset and the conversion factor
For the linear unit conversions as degC to degF, I could imagine DIAdem running automatically on the offset values and factor of the implicit channel, BUT not all unit conversions are linear, and there must be able to operate on the values of the channels - you can not apply a non-linear conversion to a y = mx + b equation and get another y = I x + b' equation.
Brad Turpin
Tiara Product Support Engineer
National Instruments
How to convert the value of byte in two asci characters
I have a problem that is perhaps easy to solve, but I do not know the answer.
Is it possible to convert a value of binary characters byte two asci.
For example:
There is a 8-bit value, 0.
I want to have two characters distinct ASCI (string). 0 and has.
Thanks for any help.
I have the solution. Sorry to ask this question.
Convert this byte with 'Number of hexadecimal string', separate this string in two characters and ready is.
"The value entered does not Format of the field.
If something similar has been posted, I apologize! I tried to look for it and has not been able to find the answer.
I have a form to determine the potential savings, if a customer makes our products to a competing product. Our sales staff filling in many areas that allow us to determine the annual cost that the customer currently committed, as well as the potential annual costs associated with our product. At the bottom of the page, using a simple calculation JS, it determines annual dollar savings by changing brands.
I would also like to include the annual savings as a percentage of current costs, but for some reason, I cannot get the script to work. The error message that appears indicates: "the value entered does not match the format of the field [annual percentage savings]."
Now, the two fields referenced in my script are formatted in dollars, so I don't know if this makes a difference or not. My script is below.
var f = this.getField("Potential_Annual_Savings_in_Dollars").value;
var y = this.getField("Cost_Per_Year_Current").value;
F.value = Event.Value / y.value;If (y.value < f.value) event.value = ";
Given the percentage is not strictly necessary, but it adds to the form, so that any help would be appreciated.
Thank you!
Post edited by: MelissaZoller (format)
I would use:
var f = this.getField("Potential_Annual_Savings_in_Dollars").value;
var y = this.getField("Cost_Per_Year_Current").value;
If (y<= 0)="" event.value=''>=>
else {}
Event.Value = f / y;
If (y< f)="" event.value=''>
}In this way there is no division by zero or a negative number.
Cannot convert the value &; quot; down &; quot; a Boolean value
I am trying to establish why this example gives me an error, it is intended to demonstrate the ability to return one data type other than a Boolean value to a UDF but doesn´t seems to work. Why is this? I'm using cfmx7 who shouldn´t of importance that the UDF are cf5 + thank you for any response
Hydrowizard wrote:
> Thanks for the reply Phil, sorry I forgot to put the error message is
> "unable to convert the"inferior"to a Boolean value. The return is partly false in
> the code I got rid of him now, I thought that it was always
> Thank you for this comment.
>Have your resolved your error?
If not, or for others in your so first paragraph:
You not compare function for anything so try to SEE
convert the returned value "below" in this case true or false.
that is a Boolean and failing value. If she tells you that it cannot
convert "down" to a Boolean.Now, it would give him no problem.
But then I don't know what is really stable.
Cannot convert the pdf drawings in word format available
I use adobe 8.1 and can't convert the file into a searchable documents in Word. I'm following the guidelines for the OCR character recognition, but without success. Any suggestions or a newer versio of acrobat or prhaps another application.
Try ClearScan option. The search option is the choice. You may need to use the latter since the fonts for ClearScan in some versions are created on the fly and are not system fonts.
I9 stature and convert the video in a readable format
Does anyone know of a good free video converter for the i9? I have some converters on my PC that allows you to convert video to mp4 and I used iTunes to convert also... but I add the video to convert mp4 to my i9 phone says he can't play it every time.
I would also maybe look at a paid version of any video converter offered by motorola, if there are those who support the i9
pac_80-
Looking for a converter that changes the file in .3gp format which is the standard of Mobile video.
Mark
Support Forums Manager
the value in timestamp insertion error
Hey people,
I need to insert ' 03:23:45 ' in a timestamp column.
INSERT into pc (col1)-> col1 is of type timestamp
SELECT to_date('03:23:45','hh:mi:ss') FROM dual;
its insertion but the output is 0 1 October 10
SELECT to_date('03:23:45','hh:mi:ss') FROM dual;
o/p-01/10/2010 03:23:45
Can U help me in this... .i am using oracle 11gYou must format your output like this:
select to_char(col1, 'DD-MM-YYYY HH24:MI:SS.FF6') from pc
It contains aggregate data but in the format known to oracle
Published by: Mustafa KALAYCI on 25.Eki.2010 11:26
convert the date to a string format
date in Word format
example:
30 may-2013' as thirtieth may twenty thirteen.
Thank you.Select to_char (to_date (30-may-2013 ',' Mon-DD-YYYY'), ' DDspth month year ") as double sample;
Values for timestamp default XMLTable causes ORA-01843: not one month valid
When I try to provide a default value for a timestamp value in the function XMLTABLE, I am greeted with an error - ORA-01843: not one month valid -no matter how to give this default value. If there is a value in the XML or not is irrelavant to this bug occurs. It seems to be an incomplete correction of bug number 9745897 (thread).
Select x.*
Of
XMLTable ('/ DOC' from xmltype ("< DOC > < DT > 2013-08-14T 15: 08:31 < /DT > < / DOC > '"))
DT COLUMNS timestamp default sysdate) x;
Select x.*
Of
XMLTable ('/ DOC' from xmltype ("< DOC > < DT > 2013-08-14T 15: 08:31 < /DT > < / DOC > '"))
By default systimestamp timestamp COLUMNS DT) x;
Select x.*
Of
XMLTable ('/ DOC' from xmltype ("< DOC > < DT > 2013-08-14T 15: 08:31 < /DT > < / DOC > '"))
DT of COLUMNS timestamp default to_char (systimestamp, ' ' YYYY-MM-DD "T" HH24:MI:SS)) x;)
Edit: somewhat more followed.
It works:
Select x.*
Of
XMLTable ('/ DOC' from xmltype ("< DOC > < / DOC > '"))
Date of the dt of COLUMNS by default sysdate) x;
It works, too, with the exception of its just the date and not the time
Select x.*
Of
XMLTable ('/ DOC' from xmltype ("< DOC > < / DOC > '"))
DT COLUMNS timestamp default sysdate) x;
It does not work
Select x.*
Of
XMLTable ('/ DOC' from xmltype ("< DOC > < / DOC > '"))
By default systimestamp timestamp COLUMNS DT) x;
ORA-01861: literal does not match the format string
Hello
First of all, let's check the manual for the DEFAULT clause:
Function SQL/XML XMLTABLE in Oracle XML DB
The optional parameter
DEFAULT
clause specifies the value to use when thePATH
expression results in an empty sequence (orNULL
). Hisexpr
is an XQuery expression that is evaluated to produce the default value.According to the documentation, the DEFAULT clause must specify an XQuery expression.
However, is false, the implementation only expects an expression that matches a string, the content is not interpreted.
Bottom line is, if we specify directly a string, the expression is implicitly converted into one, and everyone knows how things can go when implicit conversions appear, especially when the dates or timestamps are involved.
Now let's focus on the impact of the DEFAULT clause on the evaluation of the query.
When a DEFAULT clause is specified, Oracle has rewritten projection differently and does not use the native format of XS: DateTime to convert the value:
Select x.*
Of
XMLTable ('/ DOC' from xmltype ('))
')- 2013-08-14 T 15: 08:31
DT of COLUMNS by default systimestamp timestamp
) x
becomes:
SELECT THE EXISTSNODE (VALUE(KOKBF$), '/ DOC/DT')
WHEN 1 THEN LAUNCH (TO_TIMESTAMP (SYS_XQ_UPKXML2SQL (SYS_XQEXVAL (SYS_XQEXTRACT (VALUE(KOKBF$), '/ DOC/DT')), 50.1, 2)() as a timestamp)
ELSE CAST (TO_TIMESTAMP (TO_CHAR (SYSTIMESTAMP (6)), 'SYYYY-MM-DD "T" HH24:MI:SSXFF') AS timestamp)
END "DT".
TABLE ("SYS". "XQSEQUENCE"(EXTRACT ("SYS"." XMLTYPE"(")
(((,'/ DOC'))) ' KOKBF$ '.- 2013-08-14 T 15: 08:31
See the red part: it does not use the format parameter, the conversion depends on NLS session parameters.
When there is no DEFAULT clause, the TO_TIMESTAMP function uses an explicit format:
Select x.*
Of
XMLTable ('/ DOC' from xmltype ('))
')- 2013-08-14 T 15: 08:31
Dt timestamp - default systimestamp COLUMNS
) x
rewritten to:
SELECT CAST)
TO_TIMESTAMP)
SYS_XQ_UPKXML2SQL (SYS_XQEXVAL (SYS_XQEXTRACT (VALUE(KOKBF$), '/ DOC/DT'), 0,0,20971520, 0), 50.1, 2)
"SYYYY-MM-DD"T"HH24:MI:SSXFF"
)
BY timestamp - default systimestamp
) "DT".
TABLE ("SYS". "XQSEQUENCE"(EXTRACT ("SYS"." XMLTYPE"(")
(((,'/ DOC'))) ' KOKBF$ '.- 2013-08-14 T 15: 08:31
So yes, maybe there is a bug here.
Edit: somewhat more followed.
It works:
Select x.*
Of
XMLTable ('/ DOC' from xmltype ("
")) Date of the dt of COLUMNS by default sysdate) x;
Actually no, it does not work. Certainly, maybe it produces no error, but the result is incorrect.
As explained, the conversion is based on the NLS (NLS_DATE_FORMAT in this case) session:
SQL > show nls_date_format settings
VALUE OF TYPE NAME
------------------------------------ ----------- ------------------------------
string of NLS_DATE_FORMAT JJ/MM/RR
SQL >
SQL > select sysdate to double;
SYSDATE
--------
16/08/13
SQL > select x.*
2 from
3 xmltable ('/ DOC' passing xmltype ("
")) 4 COLUMNS dt date default sysdate) x;
DT
--------
13/08/16
Oracle first converts SYSDATE to a string using current NLS_DATE_FORMAT, having for result Aug 16, 13 '
Then this string is converted to a DATE as XS: date is 'YYYY-MM-DD' leading 13/08/16 (13 August, 0016) which is incorrect.
The obvious solution to this problem is to control how Oracle converts implicitly string to timestamp format:
SQL > alter session set NLS_TIMESTAMP_FORMAT = "YYYY-MM-DD"T"HH24:MI:SS."
Modified session.
SQL > select x.*
2 from
3 xmltable ('/ DOC' from xmltype ('))
')- 2013-08-14 T 15: 08:31
4 dt of systimestamp default timestamp COLUMNS
(5) x;
DT
---------------------------------------------------------------------------
2013-08-14 T 15: 08:31
SQL > select x.*
2 from
3 xmltable ('/ DOC' passing xmltype ("
")) 4 dt of COLUMNS by default systimestamp timestamp) x;
By default systimestamp timestamp COLUMNS DT) x
*
ERROR on line 4:
ORA-01861: literal does not match the format string
SQL > select x.*
2 from
3 xmltable ('/ DOC' passing xmltype ("
")) Cast of default timestamp COLUMNS dt (systimestamp timestamp) 4) x;
DT
---------------------------------------------------------------------------
2013 08-16 T 12: 32:58
calibrate the values of 12-bit ADC
I'd like to understand how to convert integer values of a 12-bit ADC in tensions. I use a box NI USB-6008 in differential input mode. It is 12 bits of resolution in differential mode. I use a simple VI to collect 100 samples of the differential analog input voltage 0 (AI0). When I connect AI0 + and -AI0, the tension between them must be zero. When I traced the number returned by the routine of the CQI data, I see-32768 values most of the time over a few jumps to + 32752. When to convert format I16 U16 format numbers. I see values ot + 32 768 for the most part, as well as a few jumps to + 32752.See attached shot of front block diagram of the display panel.
Looks like Labview add 4 zeros at the end of the right hand of the binary number 12 bit returned by CDA. Is there a simple way to make ADC return numbers like 0, + 1, -1, when the voltage is about zero? I could do the following:
1 convert the values returned by the ADC since I16 to U16.
2 divide by 16.
3 subtract 2048.
I teach students about the basics of analog digital conversion, and I don't want to have to explain this clumsy scheme, if I can avoid it.
Thank you.
Bill
Hi Bill,
Looks like you've discovered the complement representation two that LabVIEW uses to represent signed integers. Not adjusted data are drawn directly on the hardware registers and are represented as they are on the unit.
If you want to convert the values, you can convert as you have indicated. You can also take the opportunity to explain the complement to two of them if it's as part of your course, or you can just put the arithmetic in a VI if you want to hide.
If you look at the unsigned values, you could also explain to them that it is in the voltage range, the value is.
For example, 16-bit unsigned gives a range of 0-65535. If you have selected the voltage range is-10 to + 10 v. If you have 0V, so you should expect a reading around 32768.
Here's the wikipedia article on the complement of two for reference: http://en.wikipedia.org/wiki/Two's_complement
Convert numeric values to listoutput
I have to load a listoutput of host to an external table.The listoutput looks like
GRDNR ZAHL_DAT man
09551972 03.04.2013 1,000.00
20792116 03.04.2013 30.00
18815699 08.04.2013 1,000.00
15688068 18.04.2013 960,00
My problem is, that the value 'Man' has points of numbers.
The script for the outer table is:
CREATE TABLE MIRATOOL . EXT_LQSK74K1
(
GRDNR INTEGER ,
ZAHL_DAT DATE NULL,
MAN NUMBER (7,2) NULL
)
ORGANIZATION EXTERNAL
( ) TYPE ORACLE_LOADER
DEFAULT DIRECTORY PFAD_CSV_IN_HOST
ACCESS PARAMETERS
()RECORDS DELIMITED BY newline
BADFILE "LQSK74K1.bad"
LOGFILE "LQSK74K1.log"
fields
(FILLER1 CHAR(1)
, GRDNR TANK (8)
, FILLER2 TANK (20)
, ZAHL_DAT TANK (10) DATE_FORMAT Date mask 'dd.mm.yyyy'
, FILLER3 TANK (10)
, MAN TANK (10)
)
)
LOCATION ()PFAD_CSV_IN_HOST:' LO. SDS.LQSK74K'()
)
REJECT LIMIT of UNLIMITED
NOPARALLEL
NOMONITORING;
How I convert the value 'MAN '?
Well cordially
Klaus
One method would be to load the man as varchar2 values and then use a view with to_number and nls_numeric_characters, to convert, as shown below.
Scott@orcl12c > LO TYPE HOST. SDS. LQSK74K
GRDNR ZAHL_DAT man
09551972 03.04.2013 1,000.00
20792116 03.04.2013 30.00
18815699 08.04.2013 1,000.00
15688068 18.04.2013 960,00
Scott@orcl12c > CREATE or REPLACE DIRECTORY pfad_csv_in_host AS 'c:\my_oracle_files '.
2.
Created directory.
Scott@orcl12c > CREATE TABLE EXT_LQSK74K1
() 2
3 GRDNR INTEGER,
4 ZAHL_DAT DATE NULL,
5 MAN VARCHAR2 (10) NULL
6)
7 EXTERNAL ORGANIZATION
8 (TYPE ORACLE_LOADER
9 DEFAULT DIRECTORY PFAD_CSV_IN_HOST
10 ACCESS SETTINGS
11 (RECORDS DELIMITED BY NEWLINE
12 BADFILE "LQSK74K1.bad."
13 LOGFILE "LQSK74K1.log".
14 JUMP 1
15 fields
16 (FILLER1 CHAR (1)
17, GRDNR (8) TANK
18, FILLER2 CHAR (20)
19, ZAHL_DAT char (10) date mask date_format 'dd.mm.yyyy '.
20, FILLER3 CHAR (10)
21, MAN TANK (10)
22 )
23 )
24 LOCATION (PFAD_CSV_IN_HOST: "LO.) SDS. LQSK74K')
25)
RELEASE 26 UNLIMITED LIMIT
27 NOPARALLEL
28 NOMONITORING
29.
Table created.
Scott@orcl12c > SELECT * from ext_lqsk74k1
2.
GRDNR ZAHL_DAT MAN
---------- ---------- ----------
9551972 03.04.2013 1,000.00
792116 03.04.2013 30.00
8815699 08.04.2013 1,000.00
5688068 08.04.2013 960,00
4 selected lines.
Scott@orcl12c > man COLUMN FORMAT 999,999.00
Scott@orcl12c > test_view VIEW to CREATE or REPLACE AS
2 SELECT grdnr, zahl_dat,
3 CAST
4 (TO_NUMBER
5 (man,
6 "999G999D99."
7 ' NLS_NUMERIC_CHARACTERS = ",". ")
8 as a NUMBER (7.2)) man
9 FROM ext_lqsk74k1
10.
Created view.
Scott@orcl12c > test_view DESC
Name Null? Type
----------------------------------------- -------- ----------------------------
GRDNR NUMBER (38)
ZAHL_DAT DATE
MAN NUMBER (7.2)
Scott@orcl12c > SELECT * FROM test_view
2.
GRDNR ZAHL_DAT MAN
---------- ---------- -----------
9551972 03.04.2013 1 000,00
792116 03.04.2013 30.00
8815699 08.04.2013 1 000,00
5688068 08.04.2013 960.00
4 selected lines.
Maybe you are looking for
-
Outlook 2010: Cannot open the mail files
Hello! Help me stop Outlook 2010 error message: "Cannot open your default e-mail folders. The information store could not be opened. » Thanks in advance.
-
Hello, I work in the simulation of a model of wind turbine, and the problem is that the energy produced by the wind turbine depends on the power factor, which depends on the speed of the turbine, which I calculate from the integral of electricity. th
-
My TalkTalk email keeps asking for a password, I connect but it does not connect.
Since yesterday my TalkTalk email started asking for a log on password, I click on accept and the log on process starts, but it does not connect to Talktalk. I don't receive mails, but I can send! Concerning
-
I have a pair of discs DVD + RW that I used to create a set of recovery disks. I have since made a updated set of recovery discs and I tried to erase the old game, but I get an error indicating that the disk is read-only and can not be deleted. Y a
-
write a game of bbm to AIR for Playbook
Hello I intend to write a game for playbook with BBM and integrate with ScoreLoop. but I searched the forums and found out that there is no BBM sdk for playbook again and also I have not found any integration scoreloop sdk. just wanted to know if thi