oracle-sqldeveloper

How to enter binds for a multi-valued parameter in SQL Developer

荒凉一梦 提交于 2019-12-02 00:42:13
问题 I have a lot of SQL with named parameters that I need to be able to execute in SQL Developer. For SQL where the parameters are scalar values it's easy to paste the SQL into a worksheet and SQL Developer will prompt me (in a dialog with the title "Enter Binds") to enter the parameter values. But for cases where the parameter needs to hold multiple values, like this: select count(*) from foo where foo.id in (:ids) where, say, :ids needs to be replaced with 1,2,3 so that the query executed is

How to enter binds for a multi-valued parameter in SQL Developer

回眸只為那壹抹淺笑 提交于 2019-12-01 21:27:17
I have a lot of SQL with named parameters that I need to be able to execute in SQL Developer. For SQL where the parameters are scalar values it's easy to paste the SQL into a worksheet and SQL Developer will prompt me (in a dialog with the title "Enter Binds") to enter the parameter values. But for cases where the parameter needs to hold multiple values, like this: select count(*) from foo where foo.id in (:ids) where, say, :ids needs to be replaced with 1,2,3 so that the query executed is select count(*) from foo where foo.id in (1,2,3) I try entering the values into the dialog (and I've

Check Constraint Calling a Function Oracle SQL developer

a 夏天 提交于 2019-12-01 20:59:16
Is it possible in Oracle SQL developer to do something like this CREATE FUNCTION fnCheckValid(accountidd IN NUMBER) RETURN NUMBER IS retval NUMBER(4,0); BEGIN SELECT COUNT(accountid_fk) INTO retval FROM tbl_AccountAuthentications WHERE accountid_fk = accountidd; RETURN(retval); END; / ALTER TABLE tbl_AccountAuthentications ADD CONSTRAINT chkCheckvalid CHECK(fnCheckValid(accountid_fk) <= 1); The error i keep getting is Error starting at line 999 in command: ALTER TABLE tbl_AccountAuthentications ADD CONSTRAINT chkCheckvalid CHECK(fnCheckValid(accountid_fk) <= 1) Error report: SQL Error: ORA

Is it safe to use ROWID to locate a Row/Record in Oracle?

蓝咒 提交于 2019-12-01 19:40:14
I'm looking at a client application which retrieves several columns including ROWID , and later uses ROWID to identify rows it needs to update: update some_table t set col1=value1 where t.rowid = :selected_rowid Is it safe to do so? As the table is being modified, can ROWID of a row change? "From Oracle 8 the ROWID format and size changed from 8 to 10 bytes. Note that ROWID 's will change when you reorganize or export/import a table. In case of a partitioned table, it also changes if the row migrates from a partition to another one during an UPDATE ." http://www.orafaq.com/wiki/ROWID I'd say

how to make sql developer display non-English character correctly instread of displaying squares?

你。 提交于 2019-12-01 18:42:17
in sql developer--preference Environment--encoding is already set to 'UTF-8' Code Editor--fonts was set to 'Verdana' Database--NLS--Language was set to 'American' The data in db was written by Java in UTF-8 encoding (95% percent sure) What else I need to do to make it displayed correctly? Note: the squares characters are actually Chinese characters. Problem solved. Using font 'Microsoft YaHei' sqldeveloper uses the system fonts from the host machine. On my Win8 system there is a font that has glyphs for very many unicode characters and thus works for many unicode characters. 'Arial Unicode MS'

string literal too long - how to assign long xml data to clob data type in oracle 11g r2

妖精的绣舞 提交于 2019-12-01 14:04:21
问题 I need to assign a very large xml data of around 30,000 lines to a CLOB data type in oracle database 11g r2. I am using this command in Oracle Sql Developer. When I use the following command, at first I get 7 prompts for entering quote value and then when statement execution completes, I get - 'string literal too long` error. update tablename set columnName = 'large xml data' where id=1; I used seven double (single quotes) inside the xml data to escape the single quotes. How to assign this

SQL Update,Delete And Insert In Same Time

我的梦境 提交于 2019-12-01 13:14:14
问题 I just curious about something. Let said i have a table which i will update the value, then deleted it and then insert a new 1. It will be pretty easy if i write the coding in such way: UPDATE PS_EMAIL_ADDRESSES SET PREF_EMAIL_FLAG='N' WHERE EMPLID IN ('K0G004'); DELETE FROM PS_EMAIL_ADDRESSES WHERE EMPLID='K0G004' AND E_ADDR_TYPE='BUSN'; INSERT INTO PS_EMAIL_ADDRESSES VALUES('K0G004', 'BUSN', 'ABS@GNC.COM.BZ', 'Y'); however, it will be much more easy if using 'update' statement. but My

Oracle SQL Developer export sources for version control

人盡茶涼 提交于 2019-12-01 12:37:28
We have big database with a lot of stuff and I want to use version control (Git) to manage changes. There are a lot of articles how to do it step by step but one piece is missing for me. Is there standard or recommended way for file structure of whole database (data excluded) and how it can be obtained from existing database? It is a lot of sources, procedures, functions, packages, etc. Version control articles show how to manage few files from version control perspective. But they suggest that each file should be selected and saved to file system separately. Is there way to export/import all

Oracle SQL Developer export sources for version control

£可爱£侵袭症+ 提交于 2019-12-01 11:06:17
问题 We have big database with a lot of stuff and I want to use version control (Git) to manage changes. There are a lot of articles how to do it step by step but one piece is missing for me. Is there standard or recommended way for file structure of whole database (data excluded) and how it can be obtained from existing database? It is a lot of sources, procedures, functions, packages, etc. Version control articles show how to manage few files from version control perspective. But they suggest

Parsing large XML file with PL/SQL

时光怂恿深爱的人放手 提交于 2019-12-01 07:25:22
问题 I'm trying to parse quite large XML file. FIle is large enough to make impossible to use VARCHAR2, so I've decided to use CLOB. Code looks fine, but I still get an error. Here is sample of xml file I'm parsing: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <SeznamOvmIndex> <Subjekt> <Zkratka>CUZK</Zkratka> <ICO>00025712</ICO> <Nazev>Český úřad zeměměřický a katastrální</Nazev> <AdresaUradu> <AdresniBod>25133616</AdresniBod> <UliceNazev>Pod sídlištěm</UliceNazev> <CisloDomovni>1800<