How to convert the number to SQL?
How can I convert the number in SQL?The problem is that I use .NET and the Oraclenumber seems to be too big.
Number of database - what I get when I select
-----------'12'--------------------------------------'12'
-12, 1-12, 10' <-this 0 should not be there
-----------'12,12'-----------------------------------'12,12'
-12, 123'---12, 1230' <-this 0 should not be there
-----------'12,1234'-------------------------------- '12,1234'
I don't know why this happens?
Now, I tried to select with to_char (COLUMN1), but when I have values like "' 0,15 ' in the base, I get in select ', 15' when I convert with to_char?"
Anyone know a solution?
Kind regards
Simon
Edited by: user3654758 the 30.09.2010 02:02
with mytable as
(select 12 n of all the double union)
Select 12.1 in union double all the
Select 12.12 in union double all the
Select 12.123 in all the double union
Select double 12.1234)
Select case when trunc (n) = n then
TO_CHAR (n, 'FM9999999999999999999')
on the other
TO_CHAR (n, 'FM9999999999999999999D9999999')
end
FROM MyTable;
Edited by: hartmutm the 30.09.2010 02:21
I changed it a bit, because you have a problem with the separator decimal escape in the previous code.
Tags: Database
Similar Questions
-
How to convert the number in time
Hai All
How to convert number of datetime function
I have number 0825 in a table t1 and another table, I have a column of type date
How can I subtract
0825 respondent
Concerning
Srikkanth.M
Published by: Srikkanth.M on April 3, 2010 01:18Try
SELECT ( INTIME - TO_DATE(TO_CHAR(Intime,'DD-MON-YYYY')||' '|| TO_CHAR(0825,'0000'),'DD-MON-YYYY HH24:MI') ) * 24*60 time_diff FROM T1;
* 009 *.
-
How to convert the number and time of storage in my table
Hai all
I have a table called present in that certain fields are
Code varchar
Name varchar
Date of the respondent
outtime date
eTime number
number of wtime
number of cutmin
SO I Wtime calculated by Outtime sub - intimate and now I need to calculate the time additional IE Etime
So for all employees working hours are 0830 so I need for less 0830 train employees working hours
How can I convert this at 0830 and sub with Wtime and to get the exact time
Thanks in advance
srikkanth. MHello!
Outtime - intimate is a figure which means days
0830 8.5 hours and that's 1/24 * 8.5 days.
Lets say I work today between 0700 and 1510
Follow my example
SQL> with data as ( 2 select to_date('02.04.2010 15:10','DD.MM.YYYY HH24:MI') outdate , 3 to_date('02.04.2010 07:00','DD.MM.YYYY HH24:MI') indate , 4 1/24 * 8.5 need_to_work from dual ) 5 select round((outdate - indate - need_to_work) * 1444) etime_in_minutes from data 6 / ETIME_IN_MINUTES ---------------- -20 SQL>
Again you can now convert minutes to hours or test whether etime is negative or what...
Then in your case update statement would be
update attendance set etime = round((outtime - intime - 1/24*8.5) * 1444) where
T
Published by: ttt on 1.4.2010 22:17
-
How to convert the number in months?
Hi friends
I have data in the table like this
Month
01
02
03
04
I want to convert in months. e, g
01 if it should appear January
02 if it should appear February
What is the SQL query? Help, please.
rgads
with
months as
(by selecting '01' mnth throughout double Union
Select '02' of any double union
Select '03' in double union
Select '04' double
)
Select mnth, to_char (to_date (mnth, 'mm'), 'Month') mnth_name
of the month
MNTH MNTH_NAME 01 January 02 February 03 March 04 April Concerning
Etbin
misread - must be a number
with
months as
(select 1 month of all the double union)
Select 2 Union double all the
Select 3 in all the double union
Select 4 double
)
Select mnth, to_char (to_date (to_char (mnth), 'mm'), 'Month') mnth_name
of the month
-
How to count the number of columns in an oracle table using sql
How to count the number of columns in an oracle table using sqlYou must put the name of the table in capital letters
As
SELECT COUNT(1) FROM user_tab_columns WHERE table_name = 'EMP'; or SELECT COUNT(1) FROM user_tab_columns WHERE table_name = UPPER('Emp');
Concerning
Arun -
How to convert the hierarchical query of SQL Server (CTE) to Oracle?
How to convert the hierarchical query of SQL Server (CTE) to Oracle?
WITH cte (col1, col2) AS
(
SELECT col1, col2
FROM dbo. [tb1]
WHERE col1 = 12
UNION ALL
SELECT c.col1, c.col2
FROM dbo. [tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
)
DELETE one
FROM dbo. [tb1] AS an INNER JOIN b cte
ON a.col1 = b.col1Hello
Something like this maybe:DELETE FROM dbo.tb1 a WHERE EXISTS ( SELECT 1 FROM dbo.tb1 b WHERE a.co11 = b.col1 AND a.col2 = b.col2 START WITH b.col1 = 12 CONNECT BY b.col2 = PRIOR b.col1)
Although you need to do here is to check that CONNECT it BY SELECT, returns records you wait first, then the DELETION should work too.
-
How to convert the precision extended float to float in C++
Hello
Could someone me please how to convert the extended precision (floatExt) float normal float in C++?
What is the difference in the float between Labview and C++ data type?
When I tried to receive a range of float of a function of the DLL generated by Labview in C++, data are bad.
Thank you
Victor King
You can search for numeric data types in LabVIEW help for more information on the different types of data. Before sending the data to the C++ application, you can use the function of Double precision on digital / range of Conversion to convert number to Double precision.
-
Convert the number to a HEXADECIMAL 4-digit string
Hello
I would like to know if it is possible to convert a number to a HEXADECIMAL string 4 digit.
Now I convert the number to a table with ' generation array "and this table that I convert it with an"array of bytes to a string.
While when I type in the number 30, the channel will show 1E (HEX, 2 digits).
But when I type a number greater than 255, it continues to show FF (255)
If I do the 'picture to build' bigger and add an element, the string indicates a 4 digit Hex number.
Now, I would like to know how I can show one number, greater than 255 in the chain with 4 digits.
So I actually need to divide the number in 2 tables before building the table, isn't it?
I hope that you understand my purpose?
So when I type in "1235", I want a string indicating "04E5" and not "FF".
The function that you want to use is number to a hexadecimal string. Set the width of 4
http://zone.NI.com/reference/en-XX/help/371361H-01/Glang/number_to_hex_string/
Moreover, 0x04E5 is decimal 1 253
-
How to convert a number to a 10-bit array that will go in an external DAC (AD7533)
Hello
This here is my situation. I'm using with LABVIEW to program a CPU in the following way:
1 Laview calculates the values of a sine wave, according to the number of loop iteration. (i.e. generating a value of the sine at different frequencies).
2. it is adjusted between-/ + 1.
3. I connect an array of digital output ports to an external, independent, four quadrants, 10 - bit DAC. The part is AD7533, and I hope I can use it in bipolar configuration.
My question is, how do I convert the number of sine wave (or triangal, sqr, etc.) in a table of values of T/F can I stream through my DAC and output a sine wave signal?
I tried number Boolean array with the calculated value of sinus, but do not give me any bits of hard.
All suggestions greatly apprec.
RTom
Post what you have done so far. Are starting you with a a U16 or I16 whole bit (or more)? How do you do the scaling between +/-1 and an integer. It should be just a matter of using the table number of Boolean and then using a subset of the table to reduce up to 10 items boolean. If you are starting with an integer I16, it may be a matter of taking the element of corresponding table of the sign bit and the 9 elements that correspond to the less significant bits, to put together to make an array of 10 elements.
-
How to determine the number of characters in a PDF file?
Acrobat.com, how to determine the number of characters or words in a PDF file?
Hi unk2,
There is no feature in Acrobat.com online services to a number of characters. But, you could use ExportPDF to convert your PDF files to Word format and then create your character count in Word.
Please let us know if you need help.
Best,
Sara
-
How to count the number of nodes under each parent in any given xml
How to count the number of nodes under each parent in any given xml. for example the xml below was
books has 3 childern, library [1] has 4, [2] library has 6 and bookshop [3] has 2. is it possible to get the number of tags in a childnode duplicate IE library [1]
Book1 Tagus repeated twice... vice versa. do we need to make plsql lie we can achieve through sql
< book >
< library >
ABC < book1 > < / book1 >
BCA < book2 > < / book2 >
ACR < book1 > < / book1 >
Lac < Book4 > < / Book4 >
< / book >
< library >
ABC < book1 > < / book1 >
BCA < book2 > < / book2 >
ACR < book3 > < / book3 >
ACR < book3 > < / book3 >
tray of < bookn_1 > < / bookn_1 >
adjusted cost base < bookn > < / bookn >
< / book >
< library >
ABC < book1 > < / book1 >
BCA < book2 > < / book2 >
< / book >
< / books >
I tried this... query.
Select
XMLQUERY ('count($doc/Books/Bookstore[1]/descendant::*)' in the way of xmltype ("< books >
< library >
ABC < book1 > < / book1 >
ACR < book1 > < / book1 >
Lac < Book4 > < / Book4 >
< / book >
< library >
ABC < book1 > < / book1 >
BCA < book2 > < / book2 >
< / book >
(< / books > ')
as 'doc' of happy return) .getNumberVal () as node_count
of the double
Select
XMLQUERY ('count($doc/Books/descendant::*)' in the way of xmltype ("< books >
< library >
ABC < book1 > < / book1 >
ACR < book1 > < / book1 >
Lac < Book4 > < / Book4 >
< / book >
< library >
ABC < book1 > < / book1 >
BCA < book2 > < / book2 >
< / book >
(< / books > ')
as 'doc' of happy return) .getNumberVal () as node_count
of the double
How can I get the counts for each parent in a single query
Published by: user7955917 on August 24, 2012 07:26Generic function how you want the query to be.
If the structure is known in advance, as in your example a 'books' and then a 'library' root element, it's as simple as:
SQL> select x1.parent_id, x2.child_name, count(*) 2 from tmp_xml t 3 , xmltable( 4 '/books/bookstore' 5 passing t.object_value 6 columns parent_id for ordinality 7 , child_list xmltype path '*' 8 ) x1 9 , xmltable( 10 '/*' 11 passing x1.child_list 12 columns child_name varchar2(30) path 'name()' 13 ) x2 14 group by x1.parent_id, x2.child_name 15 order by x1.parent_id, x2.child_name 16 ; PARENT_ID CHILD_NAME COUNT(*) ---------- ------------------------------ ---------- 1 book1 2 1 book2 1 1 book4 1 2 bookn 1 2 bookn_1 1 2 book1 1 2 book2 1 2 book3 2 3 book1 1 3 book2 1 10 rows selected
If you want a generic solution that works without knowledge of the structure, you will need a recursive approach, and most importantly, you should know which nodes in distinct, I suppose that the leafs?
Also, please help if you can provide the link of reference on the function name() years what are the other expression, that I can use after the path
You can start reading the documentation: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_xquery.htm#CBAGCBGJ
The clause PATH expects a XQuery expression however before 11.2, we can put only simple XPath expressions.
-
Hi all
Could someone knows how to find the number of users connected to the database without connection with sql * more
y at - it a command to find?
example, we have 10 databases in a server, how to find the number of users connected to the special data base without connecting to database(v$session)?
the Oracle version:-10g, 11g
Operating system:-OEL4, OEL5, AIX, Solaris
any help will be appreciated.
Thanks in advance.
Thank you.
Kind regards
Rajesh.but you can say total number of connection with the above given the command? It would also be useful to know.
See you soon,.
LKM -
How to count the number of data records?
Hey guys, how to count the number of records, I had on a data object variable?
Im having a result of sql query in a variable like this:
oDB.resolveNode("#command").query.select.value = "SELECT * FROM Customers WHERE CliNombre LIKE ' % ' + input1 +" %' ";
oDB.open ();
oDB.first ();
So I need to count the number of records retrieved by this SQL query at the moment. Help please
Then move the cursor back to the first record after you have your account.
There is a keyword count in SQL that will allow you to get the account of your request. You can run that first - get your account, and then run the actual query to get the Recordset. This would require a separate data connection. Some examples of code.
var xfa.event.newText = inName;
If (inName == "") {}
App.Alert ("you must enter a name--try again!")
}
var nIndex = 0;
While (xfa.sourceSet.nodes.item (nIndex) .name! = "DataConnection2")
{
nIndex ++;
}oDB = xfa.sourceSet.nodes.item (nIndex) .racing var (1); pertaining to the specified data connection node
App.Alert (ODB.saveXML ("Pretty"));var nIndex = 0;
While (xfa.sourceSet.nodes.item (nIndex) .name! = "DataConnection3")
{
nIndex ++;
}
var oDBCount = xfa.sourceSet.nodes.item (nIndex) .racing (1); pertaining to the specified data connection node
Configure sql call DB to get the number of records that match the criteriaoDBCount.nodes.item (1).query.setAttribute ("text", "commandType");
oDBCount.nodes.item (1).query.select.nodes.item (0) .value = "Select count (*) from table1 where AcctNumber = '" + inName + "'";
oDBCount.open)
oDBCount.close)Configure sql call DB to get the specified employee number
oDB.nodes.item (1).query.setAttribute ("text", "commandType");
oDB.nodes.item (1).query.select.nodes.item (0) .value = "Select * from table1 where AcctNumber = '" + inName + "'";
App.Alert (ODB. Nodes.Item (1) .saveXML ("Pretty"));now connect to the DB and get a recording
oDB.open)
oDB.close ();Note the SQL command use the keyword count (take a look at the oDBCount section). This will return a number of return to the cllaer. When I set up the data connection, a node count (*) that appeared there. I dragged to the form and it has created a field called count that the onus at this node. When the query is executed, the number of resulting records returns to this field. You can have hidden it so that your users can not see it and also to change the binding votes to zero, so it is not included in the data file that is submitted when the form is complete.
Paul
-
How to change the number of minutes for the exercise of the activity of the application
How to change the number of minutes for the exercise of the activity of the application
Hello
It is not currently possible to change the goal of daily exercise.
If you want to suggest that Apple consider adding this option, you can submit a request here:
-
How to adjust the number of rings on 6s before answering iPhone begins
How to adjust the number of rings on iPhone 6s before the beginning of voicemail?
Contact your operator. That is controlled by them. It is not based on the number of rings, it is based on time.
Maybe you are looking for
-
Are there risks in downloading / using VMware?
I want to check if I'll be able to run a workshop manual of car on my Macbook pro (mid-2009, El Capitan). The website offering it says it will take me to download and install VMware fusion, then VMware player. Does anyone know if there is a risk for
-
How to reset the map of IO on a Tecra 9100
Hello I would like to know how I can reset my tecra 9100 IO card, because I ve found just below the Mini PCI slot a reset option, why am I doing this? Well, this is just a test...! because my mini PCI slot does not work for a few days and I think a r
-
How can I create a photo book using Photos app on an iPad mini?
I know how to create a photo book using Photos on a MacBook Pro app. I want to know if a photo book can be created using the Photos app on my iPad mini. If so, how?
-
I have a HP Officejet 6500 wireless that does not print color only black ink Solutions/similar problem?