oracle-sqldeveloper

Is there any hash function in PL/SQL?

倖福魔咒の 提交于 2019-11-28 10:57:13
I'm looking for a Hash function in PL/SQL, to get the hash of a varchar. I found a package in Oracle 10 called dbms_crypto with a function dbms_crypto.hash and even other package dbms_sqlhash.getHash, however where I called them, I've got a message like it cannot find them... Does somebody know how can I call them?? Is there any other package? Here's my code DECLARE l_textToHash VARCHAR2(19) := 'toto123'; l_ccn_raw RAW(128) := utl_raw.cast_to_raw(l_textToHash); l_encrypted_raw RAW(2048); BEGIN dbms_output.put_line('CC: ' || l_ccn_raw); l_encrypted_raw := dbms_crypto.hash(l_ccn_raw, 3); dbms

Date query ran in PL/SQL Developer shows time, but does not show in Oracle SQL Developer

試著忘記壹切 提交于 2019-11-28 10:29:43
问题 The same query ran in PL/SQL Developer shows time, however it does not show in Oracle SQL Developer. Is there a way to get the time in SQL Developer? In SQL Developer: In PL/SQL: This is the details of the date field: 回答1: You can change this in the Tools / Preferences dialog of SQL developer: Select Database / NLS Parameters in the tree view on the left. Then put dd/mm/yyyy hh24:mi:ss into the Date Format field. Press OK to close the dialog. 回答2: To make it simple: use to_char() function, it

Directly export a query to CSV using SQL Developer

社会主义新天地 提交于 2019-11-28 07:26:38
Using SQL Developer to run queries works good, but I would save a lot of time if I instead of first running the query and then right click the result set and go through the export to csv routine. I was wondering whether it is a way in SQL Developer to: 1) Write the query, and then select that the result of the query should be exported to disk. 2) Write a queue of several queries, each of them writing their results to disk. Alex Poole You can use the spool command (SQL*Plus documentation, but one of many such commands SQL Developer also supports) to write results straight to disk. Each spool

Split string oracle into a single column and insert into a table

久未见 提交于 2019-11-28 07:00:05
问题 I have a table with column data in below format(Row# just to indicate row number). Row#1 :test.doc#delimiter#1234,test1.doc#delimiter#1235,test2.doc#delimiter#1236<br> Row#2 :fil1.txt#delimiter#1456,fil1.txt#delimiter#1457 I want to split the string using comma(,) as delimiter, list all in one single column and insert into a new table. output should be something like this (Row# just to indicate row number): Row#1:test.doc#delimiter#1234<br> Row#2:test1.doc#delimiter#1235<br> Row#3:test2.doc

Remove Column Header into the Output Text file

妖精的绣舞 提交于 2019-11-28 06:56:41
问题 I want to create a flat file (text file) of my query from Oracle SQL Developer. I have successfully created the text file using SPOOL, thru a script text file, but i want to remove the header of each column into my output. I am getting this output: Header000001 Header000002 ------------ ------------ Adetail1 Bdetail1 Adetail2 Bdetail2 Adetail3 Bdetail3 But, I want to get this output: Adetail1Bdetail1 Adetail2Bdetail2 Adetail3Bdetail3 I already tried the command "set heading off", but a

How to export data with Oracle SQL Developer?

自作多情 提交于 2019-11-28 06:08:55
How to export Oracle DB data using SQL Developer? I need all data, tables, constraints, structure and so on. In SQL Developer, from the top menu choose Tools > Data Export. This launches the Data Export wizard. It's pretty straightforward from there. There is a tutorial on the OTN site. Find it here . Eddie Canales In version 3 , they changed " export " to " unload ". It still functions more or less the same. If, at some point, you only need to export a single result set, just right click "on the data" (any column of any row) there you will find an export option. The wizard exports the

How to find the error causing ora-06575?

穿精又带淫゛_ 提交于 2019-11-28 04:57:48
问题 Recently I had to write an oracle function, and the error ora-06575 popped up awfully a lot. Usually it was because of missing colon from assignment, such as: z = 5 (vs. z := 5) Or a missed ';' at the end of a statement. Anyway, I was able to create the function, but it failed during execution with that error, and gave no hint as to where the problem was (except that it was in the function). I wrote same function in MSSQL and Sybase, and both of those actually tried to point me to the place

What is the setting to view the time part with date in Oracle PL/SQL developer?

纵然是瞬间 提交于 2019-11-28 04:55:17
问题 I have a table named AUDIT which saves all the modifications done on an account. There is a field AUDIT_DATE which contains the date on which a particular modification has been done. Now the problem is, in one of my colleagues Oracle PL/SQL developer, I can see the time as well as the date in the AUDIT_DATE column, but in my Oracle PL/SQL developer, I can't see the time part. So I believe some setting is not properly done in my Oracle PL/SQL developer and that's why I can't see the time part.

insert if not exists oracle

你离开我真会死。 提交于 2019-11-28 04:39:16
I need to be able to run an Oracle query which goes to insert a number of rows, but it also checks to see if a primary key exists and if it does, then it skips that insert. Something like: INSERT ALL IF NOT EXISTS( SELECT 1 WHERE fo.primary_key='bar' ) ( INSERT INTO schema.myFoo fo ( primary_key, value1, value2 ) VALUES ('bar','baz','bat') ), IF NOT EXISTS( SELECT 1 WHERE fo.primary_key='bar1' ) ( INSERT INTO schema.myFoo fo ( primary_key, value1, value2 ) VALUES ('bar1','baz1','bat1') ) SELECT * FROM schema.myFoo; Is this at all possible with Oracle? Bonus points if you can tell me how to do

How can I avoid “raw variable length too long” errors in SQL Developer?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 03:30:36
问题 I am updating a BLOB with large mount of text and I get this error: SQL Error: ORA-06502: PL/SQL: numeric or value error: raw variable length too long Is there any way around it? The text is 2,670 characters long, being converted via utl_i18n.string_to_raw , as explained in How do I edit BLOBs (containing JSON) in Oracle SQL Developer?, and is all on one line in the query. Update: The BLOB in question already contains text that is 2,686 characters long, which is longer than the text I am