Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

plsql

Using SELECT inside COALESCE

April 9, 2024 by Tarik

You should place parenthesis around the selects: coalesce( (SELECT ID FROM Stmt G WHERE G.CLAIMNO=C.CLNUMBER) , (select StmtSeq.nextval from dual) )

Categories sql Tags oracle, oracle-sqldeveloper, plsql, sql Leave a comment

Ugly formatting in SQL*Plus

April 8, 2024 by Tarik

Increase the linesize, e.g SET LINESIZE 32000 or use SET WRAP OFF (but this will truncate long values)

Categories sql Tags oracle, oracle10g, plsql, sql, sqlplus Leave a comment

What are some online compilers to compile and run PL/SQL? [closed]

April 6, 2024 by Tarik

Update 2024-01-17: SQL Fiddle no longer works for Oracle and seems to have lost many old fiddles. See the other answer for a more up-to-date list. SQL Fiddle Here is a trivial example of use: http://sqlfiddle.com/#!4/8cf15/5

Categories sql Tags oracle11g, plsql, saas, sql Leave a comment

What is the point of dbms_lob.createtemporary()?

January 9, 2024 by Tarik

In earlier times you were always forced to use DBMS_LOB package. Then in Oracle 10g a feature called “SQL semantics for LOB” was introduced and now you can use the simplified syntax. In CREATETEMPORARY you can specify the duration of the LOB in SQL semantic you cannot. In your case the LOB is freed in … Read more

Categories oracle Tags lob, oracle, plsql Leave a comment

When should database synonyms be used?

January 7, 2024 by Tarik

It is excellent for staging mock tables when testing. For example, if your source tables contain millions of records and you want to test a small subset of data, you can use synonyms to re-direct the source table to a smaller table you control so you can stage various scenarios. In this way, you can … Read more

Categories sql Tags database-design, oracle, plsql, sql, synonym Leave a comment

UTL_FILE.FOPEN() procedure not accepting path for directory?

January 1, 2024 by Tarik

Since Oracle 9i there are two ways or declaring a directory for use with UTL_FILE. The older way is to set the INIT.ORA parameter UTL_FILE_DIR. We have to restart the database for a change to take affect. The value can like any other PATH variable; it accepts wildcards. Using this approach means passing the directory … Read more

Categories oracle Tags oracle, oracle9i, plsql, utl-file Leave a comment

Oracle “ORA-01008: not all variables bound” Error w/ Parameters

December 31, 2023 by Tarik

The ODP.Net provider from oracle uses bind by position as default. To change the behavior to bind by name. Set property BindByName to true. Than you can dismiss the double definition of parameters. using(OracleCommand cmd = con.CreateCommand()) { … cmd.BindByName = true; … }

Categories sql Tags oracle, oracle10g, plsql, sql Leave a comment

How do I print output in new line in PL/SQL?

December 29, 2023 by Tarik

You can concatenate the CR and LF: chr(13)||chr(10) (on windows) or just: chr(10) (otherwise) dbms_output.put_line(‘Hi,’||chr(13)||chr(10) ||’good’ || chr(13)||chr(10)|| ‘morning’ ||chr(13)||chr(10) || ‘friends’);

Categories sql Tags oracle, plsql, sql Leave a comment

get string from right hand side

December 29, 2023 by Tarik

If you want to list last 3 chars, simplest way is select substr(‘123456’,-3) from dual;

Categories oracle Tags oracle, plsql Leave a comment

Is it possible to CONTINUE a loop from an exception?

December 26, 2023 by Tarik

The CONTINUE statement is a new feature in 11g. Here is a related question: ‘CONTINUE’ keyword in Oracle 10g PL/SQL

Categories oracle Tags oracle, plsql Leave a comment
Older posts
Page1 Page2 … Page11 Next →

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa