Convert long DDMMYY
Hello
I am getting server date string in todays date DDMMYY format e.g. is 180811. I want to convert long. I used HttpDateParser, but it does support this format. How can we achieve this?
Thank you
@simon_hain: thank you. Now it works very well...
String PROMOTIONDate = "20";
Nouvelle_date = Nouvelle_date + date.substring (4, 6) + "-" + date.substring (2, 4) + "-" + date.substring (0, 2);
but I'm not loving the manual scan.
Tags: BlackBerry Developers
Similar Questions
-
Hello
I'm migration 8i to 11 GR 2 using exp/imp
I have tables with Long Raw columns
an easy way to convert them to blob, because currently they are created as Long Raw?
Thank youHello
Tom described it on his site: http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:13213885403654
If you google, you will find many other examples.If you have the choice to do in 8i or 11 GR 2.
Herald tiomela
http://htendam.WordPress.com -
procedure for converting long on the clob type
Please you need to process long migrate on the clob, with variables type
V_SRC_TABLE (LONG) to V_TRAGT_TABLE (CLOB)
SOURCE AND TARGET HAVE TWO COLUMNS
SOURCE_TABLE
VARACHAR2
LONG
TARGET_TABLE
VARACHAR2
CLOBHello
Assuming you want to convert data always source_table target_table knowing the column names, let's say:
SQL> CREATE TABLE source_table(col1 VARCHAR2(10), col2 LONG); Table created. SQL> CREATE TABLE target_table(col1 VARCHAR2(10), col2 CLOB); Table created.
You can simply copy the data using SQL:
INSERT INTO target_table SELECT col1, TO_LOB(col2) FROM source_table;
Or, as a procedure:
CREATE OR REPLACE PROCEDURE migrate_to_clob IS BEGIN EXECUTE IMMEDIATE 'INSERT INTO target_table SELECT col1, TO_LOB(col2) FROM source_table'; END;
It will be useful.
-
convert long varchar use views
I want to get varchar2 column search_condition (dba_constraints), but get an error:
Select constraint_type, table_name, getSerCon (rowid)
of dba_constraints
ORA-01445: cannot select ROWID, or sample, join without table views preserved key
create or replace function getSerCon)
p_rowid in rowid) return varchar2 as
l_data long;
Start
Select condition_de_recherche from l_data dba_constraints where rowid = p_rowid;
Return substr (l_data, 1, 4000);
end;
Can not you advide me how to convert.DBA_CONSTRAINTS is a view based on many SYS belonging to tables. So there is no own ROWID. This is why your code does not work. Now the combination of the owner, table_name, constraint_name is unique, so that you can change the function to use instead. Also, search this forum for other solutions with long
SY.
-
Hi all. Why I get this error? :_|
create or replace function mike.getHighValue)
p_owner varchar2,
p_table varchar2,
p_part_name varchar2
) return varchar2 as
l_data long;
Start
Select high_value from dba_tab_partitions l_data
where table_owner = p_owner
and table_name = p_table
and nom_partition = p_part_name;
Return substr (l_data, 1, 4000);
end;
------
Select mike.getHighValue (high_value) from dba_tab_partitions;
ORA-00997: illegal use of the LONG data typeWhen you select ' select mike.getHighValue (high_value) from dba_tab_partitions;
you do not pass the correct values, you need to select as follows:
Select mike.getHighValue ('SH', 'SALES', 'SALES_1995') in the dba_tab_partitions';
-
Why is there a long column in user_tab_partition?
Hi all
While I was working on a project of partitions, I realize that I had to work with long files.
It turns out I realized that it was quite obsolete:
Convert long to varchar2 or clob pure Oracle SQL
Conversion from long to varchar2
"Why do you have a column of LONG data type?
LONG data type has been deprecated since CLOB were introduced about 10 years ago. Oracle does not recommend you use LONG data type and it is there than to support backward compatibility. »
Not all wrong, by the data dictionary seems full of craft:
http://docs.Oracle.com/CD/B14117_01/server.101/b10755/statviews_1058.htm
So I wonder, because the effort is given to discourage and de-motivate people from using LONG data types, why oracle is not refresh its data was thinking?
Because I wanted to be to operate in this column (do a SHIFT to see the high value and low value of the previous score), I had huge problems to do.
How could have out us of Oracle on the topic?
Not being don't not an Oracle database designer, I can't speak for Oracle, but I see that the user_tab_partitions of view and it relies on the base tables have been designed well before that Oracle introduced the LOB data type. Change the data type of a database table, we hear all code that refers to this column must be updated. New SYS objects use LOBS, but most of the time Oracle has not returned and modified existing objects. Maybe in version 20 (i.e. at some point remote in time).
- -
IMHO - Mark D Powell-
PS - A change to a base table data type would be also means existing data on the upgrade will need to be converted. Potentially existing a requirement of your time which is another reason to not change the data type.
-
LONG - instr and grid... Select
Hello
Two queries:
(a) how to search for a character/combination of characters in a column
(b) how to perform a backup of a table that contains a LONG column (may contain other types of data such as the number, etc. varchar columns.)
I tried to use INSTR and CREATE (INSERT)... SELECT the options, but both failed with errors.
SQL> CREATE TABLE T1(C1 LONG); Table created SQL> INSERT INTO T1 VALUES (';Z00:101CGEZZP1904300M5'); 1 row inserted SQL> SELECT INSTR(C1,'ZP') FROM T1; SELECT INSTR(C1,'ZP') FROM T1 ORA-00932: inconsistent datatypes: expected NUMBER got LONG SQL> CREATE TABLE T2 AS SELECT * FROM T1; CREATE TABLE T2 AS SELECT * FROM T1 ORA-00997: illegal use of LONG datatype SQL>
Hello
LONG is an old format with a lot of limitations that will make your life miserable. If you need to copy your table to another, take this opportunity to convert long on the CLOB type using the to_lob() function.
create table t1(id long); create table t2 (id clob); insert into t2 (id) select to_lob(id) from t1;
Best regards
Nikolai -
How to insert the value of a LONG data type?
Hi all
Developers what to change the type of data in the PRODUCTS table.
PRODUCT
======
ID number (10) not null,
NAME varchar2 (50) not null,
DESCR varchar2 (250) not null
They want the DESCR to change datataype at LENGTH
So I got back it up first:
create the table product_bak in select * from product;
remove the product;
change the product table change (descr, null);
Edit the product table change (long descr);
Insert into select product * from product_bak;
ORA - 997 - illegal use of LONG data type
How can I recover my data?
Thank you very much.Use TO_LOB to convert long on the CLOB type, then use TO_CHAR to convert CLOB VARCHAR2.
-
ORA-00932: inconsistent data types should had LONG
Hello
I would like to convert LONG LOB. I get the following error.
Does anyone have an idea?SQL> desc all_views Name Null? Typ ----------------------------------------- -------- ---------------------------- OWNER NOT NULL VARCHAR2(30) VIEW_NAME NOT NULL VARCHAR2(30) TEXT_LENGTH NUMBER TEXT LONG TYPE_TEXT_LENGTH NUMBER TYPE_TEXT VARCHAR2(4000) OID_TEXT_LENGTH NUMBER OID_TEXT VARCHAR2(4000) VIEW_TYPE_OWNER VARCHAR2(30) VIEW_TYPE VARCHAR2(30) SUPERVIEW_NAME VARCHAR2(30) SQL> SELECT to_lob(text) from all_views 2 where rownum <= 1; SELECT to_lob(text) from all_views * FEHLER in Zeile 1: ORA-00932: inconsistent datatypes expected got LONG
TO_LOB are usable in the SELECT an INSERT statement
SQL> create table t 2 (text clob) 3 / Table created. SQL> SQL> insert into t 2 SELECT to_lob(text) from all_views 3 where rownum <= 1; 1 row created. SQL> SQL> select * 2 from t 3 ; TEXT -------------------------------------------------------------------------------- select "FILE#","BLOCK#","CLASS#","STATUS","XNC","FORCED_READS","FORCED_WRITES"," {code} http://www.lc.leidenuniv.nl/awcourse/oracle/server.920/a96540/functions139a.htm
-
False alarm: the compiler bug?
This happens with CVI 2010 SP1.
Compiling this code, I get "WARNING: Conversion from '__int64' to 'long' could lose data... ' on the 'z = y' line.
Please note this line does not have any variable __int64.
More strange: if I comment any line of the "case", the warning disappears: the warning when are present four or more instructions "box.
However, the generated code works perfectly, to a quick test.
#define A 0x00000000 #define B 0x00000001 #define C 0x00000002 #define D 0x00000003 #define MASK 0x00000003 void CompilerBug() { __int64 x=0; int y,z; switch(x & MASK) { case A: y=0; break; case B: y=1; break; case C: y=2; break; case D: y=3; break; } z = y; }
I will be happy if someone can confirm this behavior.
Thank you
At first glance, the warning seems to be false. The conversion from __int64 to long don't actually takes place. Instead, case expressions are converted long __int64. The behavior of the switch statement seems correct and therefore the warning can be ignored.
We have not yet investigated the cause of this error, but you can follow the matter with bug ID 363456. In the meantime, it would be more prudent to ensure that your switch expression and case expressions are of the same type where we have not fully defined errors.
-
JSON format - Date and special characters
Hi all
I had a JSON server in which, I have a few text values and date.
- How can I convert special characters to normal String.e.g. Comma etc. ?
- How can I convert long date, a string in the format e.g. "1345670466960-0400"?
I really appreciate any help above.
Solved... Where the above closure. For others, I will post the solution.
Special characters-
QByteArray buffer(bufSize, 0); int read = reply->read(buffer.data(), available); //response = QString(buffer); -- Wrong way to convert the bytes. response = QString::fromUtf8(buffer); // right way, so special character handled itself.
Day fromatting - for example "/ Date (1345670466960-0400).
QString getStringDate(QString k){ QDateTime date = QDateTime::fromTime_t(getDate(k)); QString strDate = date.toString("MM/dd/yyyy HH:mm:ss"); return strDate; } long getDate(QString k) { long rc = 0; QString v = k; if (v.length() > 0 ) { int b = v.indexOf("/Date("); if (b >= 0) { b += 6; int e = v.indexOf(')', b); if (e > b) { QString s = v.mid(b, e); int sign = 1; if (s.indexOf('-') > 0 || s.indexOf('+') > 0) { sign = s.indexOf('-') > 0 ? -1 : 1; e = sign < 0 ? s.indexOf('-') : s.indexOf('+'); s = s.mid(0, e); } bool *ok = false; s = s.mid(0, s.length() - 3); //trimming it for seconds only.... rc = s.toLong(ok, 0); } } } return rc; }
-
How to generate keys for persistent object?
How these keys are generated?
PersistentStore.getPersistentObject (0xa1a569278238dad2L);
Create a string like:
com.foo.myFoobar.store
The highlight in the JDE Editor, right click, and select "convert long."
-
If you look at the documentation of the API for net.rim.device.api.system.PersistentObject, you will see an example like this:
long MY_DATA_ID = 0x33abf322367f9018L; Hashtable myHashtable = new Hashtable(); PersistentObject persistentObject = PersistentStore.getPersistentObject( MY_DATA_ID );
Whence this long signerId? You just do it and hope that nobody takes the same value? Is it supposed to represent a company, a single application, or a coherent piece of persistent data, in this application? The javadoc for the methods that take the signerId as a parameter doesn't say a lot. Any clarification would be greatly appreciated.
You can create a string that is unique to your application and create a hash value.
For example:
com.mycompany.MyApp.Data
If you use the JDE, you can select a channel like this in the editor, open the context menu and select "convert long."
-
Problem with shorts and arithmetic byte.
I'm doing some tests involving long, int, short, and byte.
lT, lS are long
He, here is are of type int.
sT, sA, sS are short
bT, bA, bS are bytes
Now I have some expressions of the form: xT = xT + xA
This compiles for long and int, but for the short and byte, I get an error of precision.
The problem is that arithmetic more small that int is made to int and then converted in byte or short as appropriate.
int convert to int.
int converts long and long long turns.
Thus, there is no problem with int and long.
However sT = sT + his causes a compilation related to the precision error.
This seems like a bug to me, because you might same conditions of overflow with long and whole (ints).
Is this a bug with our J2ME app or a "characteristic". If it's a feature, can someone point me to a link on the web where it says this...?
Thank you
-Donald
The + operator return type is int, unless one of the operands is long, in which case the return type is long. It's like that with JAVA in general, not just the bb or the micro-publishing.
byte b1 = 1, b2 = 2;
B1 = (byte) (b1 + b2); needs expressed
B1 = b2; didn't need castingYes, it's a bit silly. You get used to it after awhile.
Cheers, Barak.
-
dbms_xmlgen. GetXml with single quotes
Can you get it someone please let me know what is wrong with this query. I try to convert the long and CLOB type. I wanted to convert long to varchar2 and to do this, I am to convert the long to clob or varchar2 clob.
The query works fine when doing a rownum = 1 in the dynamic query but I would like to read carefully all the constraints so tried the underside and its failure with an error message for an unexpected end of SQL command.
-with rownum
SELECT dbms_lob.substr (longtoclob, 4000, 1) text
of the double.
(select (dbms_xmlgen.getxml ("SELECT t.search_condition ALIASLONG
OF All_Constraints t WHERE rownum = 1')) longtoclob
the double) Y where DBMS_LOB. GETLENGTH (Y.longtoclob) > 0;
-generic query
Select (SELECT (dbms_xmlgen.getxml (Q'[select search_condition in all_contstaints where cosntraint_name = ']' | constraint_name |))) Q '[']')) text, constraint_name from
ALL_CONSTRAINTS
where rownum < = 3;
-generic query
Select (SELECT (dbms_xmlgen.getxml (Q'[select search_condition in all_contstaints where cosntraint_name = ']' | constraint_name |))) Q '[']')) text, constraint_name from
ALL_CONSTRAINTS
where rownum<>
'A few' bad stuff here:
-keyword SELECT extra
-typos in names of objects
-DBMS_XMLGEN.getXML will give you a CLOB that represents a dataset XML to canonical format, not the search_condition directly necessary
It is more what you are looking for, but know it's slow:
select constraint_name , xmlcast( dbms_xmlgen.getxmltype( 'select search_condition from all_constraints where constraint_name = ' || dbms_assert.enquote_literal(constraint_name) ) as varchar2(4000) ) as text from all_constraints where rownum <= 3 ;
(XMLCAST is 11g only, use the extractValue on lower versions)
Maybe you are looking for
-
When I log into my bank address online or Web site secure my business does the page is garbled with some Chinese characters but the same page is OK on Safari.
-
Hello I have problems with the installation of XP PRO on this new laptop XP Home doesn't suite my needs. Namely, I get the following errors: Energy saving: Installs properly, when he tries to run after the installation or startup, it dies with "Fatal
-
Again, I got a notice for windows update, then it screw up the start. Got the 8001E2B995 error. Several times I had to restore, but this time I had to reboot several times to get the job of the computer. Everytimes I had to restore I had to reload my
-
11 brand Canon 7 d raw codec software
I have a mark 11 photo canon 7 d camera and can not open the raw files. I use photoshop elements 11 on a HP computer with vista 64 operating system. What can I do?
-
Not being not aware of size limits of HARD drive for older readers, I just installed a new 3 TB drive HARD couple with a MB that has standard BIOS and isn't UEFI, nor has he a BIOS Mode Legacy. I can only use MBR, GPT not, when you configure the HARD