Sometimes while running queries some of the views don't work due to the default language settings in SQL developer being different to one's the views refer. Use the below query to set the language.
alter session set nls_language = 'AMERICAN'
Sometimes the error ORA-00942 table or view not found comes up due to being in a different schema. It is pain to enter schema. before all the tables.
Ex- select * from ap_invoices_all
gives me ORA-00942 due to the restricted access we have in our site.
Change the schema in the session to avoid this error.
alter session set current_schema=APPS
Now the above select query works without any issues.
Tuesday, 19 May 2015
Converting CLOB to VARCHAR2 in SQL
I wanted to convert a CLOB type column in VARCHAR2 and use the same in a query. Below is a simple way using substr and to_char. Using this approach you can use the CLOB type like any VARCHAR2 column.
SELECT to_char(substar(CLOB_COLUMN,1,100)) error FROM table_name
WHERE to_char(substar(CLOB_COLUMN,1,100)) LIKE'%ORA%'
SELECT to_char(substar(CLOB_COLUMN,1,100)) error FROM table_name
WHERE to_char(substar(CLOB_COLUMN,1,100)) LIKE'%ORA%'
Subscribe to:
Posts (Atom)
Integrations Lead - Lessons learnt
Integrations have been my passion for a while but like anything tech there is no credit given when things go right but always heaps of pres...
-
For most outbound interfaces bursting to content server and then picking the file from UCM is the best approach for large extracts. Default...
-
While developing Cloud integrations I could not find a single place for all details like InterfaceID or jobdefinitionname or job name etc. ...
-
You can use valueset(Ex-ORG_LEVEL1) to use the query table functionality in Fast Formulas. Below is sample how you pass parameters(P_ORG_ID)...