Richlab Team Techblog

Thinking twice is a good idea!

Join Now
    • Multiplying Using a Sum in Oracle

      Multiplying Using a Sum in Oracle

      Here’s a example of how multiplying using logarithms: select exp(sum(ln(cd_deposito))) from anag_depositi where cd_deposito in (98,92, 95) ln(x*y) = ln(x) + ln(y) ==> exp(ln(x*y)) = exp(ln(x)) + exp(ln(y)) ==> using sum operator to implem...

    • Versioning

      Versioning

      SELECT ps_ordine, ps_variazione_ordine, versions_xid, versions_starttime, versions_endtime, versions_operation FROM sigo_ordini_mercati VERSIONS BETWEEN TIMESTAMP TO_DATE('201602181000', 'YYYYMMDDHH24MISS') AND TO_DATE('201602181200', 'YYYYMMDDHH24MI...

    • Currently running SQL statements

      Currently running SQL statements

      SELECT SUBSTR(V$SESSION.USERNAME, 1, 8) USERNAME, V$SESSION.OSUSER OSUSER, V$SQLAREA.DISK_READS DISK_READS, V$SQLAREA.BUFFER_GETS BUFFER_GETS, SUBSTR(V$SESSION.LOCKWAIT, 1, 10) LOCKWAIT, V$SESSION.PROCESS PID, V$SESSION_WAIT.EVENT EVENT, V$SQLAREA.SQ...

    • LANGUAGES TYPES MAP

      LANGUAGES TYPES MAP

      .NET Framework ADO.NET Database SQL Data String Varchar Varchar() String Nvarchar Nvarchar() String NChar Nchar() String NText NText String Text Text Double BigInt Float DateTime DateTime Datetime DateTime SmallDateTime Smalldatetime Int Int Int Int6...

    • Cube alternative sql script

      Cube alternative sql script

      La query è un esempio di come mostrare righe + riepilogo senza usare la funzionalità CUBE (sfrutta l’order by per creare campi di rottura) (select concat(LPad(rp.CDGRM, 2, '0'), LPad(g.CDSET, 2, '0'), LPad(g.CDINT, 6, '0'), g.PREZZATURA) as B...

    • Insert/Update command using statement

      Insert/Update command using statement

      ORACLE MERGE CLAUSE (EX1) MERGE INTO sigo_magmov m USING (select l.vl_costo costo_lotto, m.rowid fede from sigo_magmov m inner join sigo_lotti l on m.nr_lotto = l.nr_lotto where cd_causale = 76 and m.dt_tem >= '20120101' and not m.nr_lotto is null...

    • BACKUP

      BACKUP

      Execute the BACKUP DATABASE statement to create the full database backup, specifying: The name of the database to back up. The backup device where the full database backup is written. declare @databaseName nvarchar(1024); declare @FileName nvarchar(1...

    • HOW TO READ ONE STORED PROC. CONTENT

      HOW TO READ ONE STORED PROC. CONTENT

      sp_helptext @objname = '<storedname>'...

    • – OPENDATASOURCE X EXCEL –

      – OPENDATASOURCE X EXCEL –

      leggo un file excel da SQL SELECT * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source=c:\prova.xls; Extended Properties=Excel 8.0')...[Foglio1$] se non è abilitato il comando OPENDATASOURCE, lanciare il seguente script per abilitarlo: sp_c...

    • Decimal, float, double

      Decimal, float, double

      DECIMAL – diviso per zero dà errore – permette la rappresentazione esatta di un numero decimale – è in base 10 – decimal: precisione 28 cifre – campo finanziario DOUBLE / FLOAT – diviso per zero non dà errore &#...

    • USE COM CLSID TO GET ASSOCIATED .NET SYSTEM TYPE

      USE COM CLSID TO GET ASSOCIATED .NET SYSTEM TYPE

      How to use in your the project the COM reference “HNetCfg.HNetShare”, which can be found in the “hnetcfg.dll” server (typically located in the “C:\WINDOWS\system32\” directory). private const string CLSID_NETSHARIN...

    • BACK FROM ‘GO TO DEFINITION’

      BACK FROM ‘GO TO DEFINITION’

        – Go back from ‘Go to definition’: CTRL + MINUS – Go back from ‘Wiew code behind (F7)’ : SHIFT + F7....

    • Url Rewriting middleware

      Url Rewriting middleware

      URL redirect and URL rewrite A URL redirect is a client-side operation, where the client is instructed to access a resource at another address. This requires a round-trip to the server, and the redirect URL returned to the client will appear in the b...

    • How to use Startup.cs

      How to use Startup.cs

      Apri PDF con la documentazione su ASP.NET Core Configure public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { app.UseStaticFiles(); // For the wwwroot folder /* per poter utilizzare contenuti statici...

Url Rewriting middleware

URL redirect and URL rewrite A URL redirect is a client-side operation, where the client is instructed to access a resource at another address. This requires a round-trip to the server, and the redirect URL returned to the client will appear in the browser's address bar when the client makes a ...

Recent Posts

Scroll to see more!

Url Rewriting middleware

URL redirect and URL rewrite A URL redirect is a client-side operation, where the client is instructed to access a resource at another address. This requires a round-trip to the server, and the redirect URL returned to the client will appear in ...

How to use Startup.cs

Apri PDF con la documentazione su ASP.NET Core Configure public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { app.UseStaticFiles(); // For the wwwroot folder /* per poter utilizzare contenuti ...

Multiplying Using a Sum in Oracle

Here’s a example of how multiplying using logarithms: select exp(sum(ln(cd_deposito))) from anag_depositi where cd_deposito in (98,92, 95) ln(x*y) = ln(x) + ln(y) ==> exp(ln(x*y)) = exp(ln(x)) + exp(ln(y)) ==> using sum operator to ...

Delete Remote desktop history

How to Delete the History of RDP Connections in Windows It’s impossible to remove a computer (or computers) from the list of rdp connections using conventional Windows features, so you have to make changes to the system registry. Open the ...

Versioning

SELECT ps_ordine, ps_variazione_ordine, versions_xid, versions_starttime, versions_endtime, versions_operation FROM sigo_ordini_mercati VERSIONS BETWEEN TIMESTAMP TO_DATE('201602181000', 'YYYYMMDDHH24MISS') AND TO_DATE('201602181200', ...

Currently running SQL statements

SELECT SUBSTR(V$SESSION.USERNAME, 1, 8) USERNAME, V$SESSION.OSUSER OSUSER, V$SQLAREA.DISK_READS DISK_READS, V$SQLAREA.BUFFER_GETS BUFFER_GETS, SUBSTR(V$SESSION.LOCKWAIT, 1, 10) LOCKWAIT, V$SESSION.PROCESS PID, V$SESSION_WAIT.EVENT EVENT, ...

DBMS_LOCK (using lock in a stored)

DECLARE v_lockhandle VARCHAR2(200); v_RET INTEGER; BEGIN -- INIZIO TEST LOCK IF v_lockhandle IS NULL THEN dbms_lock.allocate_unique('LOCK_MOV', v_lockhandle); END IF; IF dbms_lock.request(v_lockhandle, dbms_lock.x_mode, 0) != 0 THEN ...

Execution queries now

SELECT SUBSTR(V$SESSION.USERNAME, 1, 8) USERNAME, V$SESSION.OSUSER OSUSER, V$SQLAREA.DISK_READS DISK_READS, V$SQLAREA.BUFFER_GETS BUFFER_GETS, SUBSTR(V$SESSION.LOCKWAIT, 1, 10) LOCKWAIT, V$SESSION.PROCESS PID, V$SESSION_WAIT.EVENT EVENT, ...

Sum previous row values in oracle

with t as ((SELECT '0' ordine, '2' mtlevel, v.cd_int, NULL dt_tem, v.cd_grm || ' ' || v.cd_int nr_tem, NULL cd_clifor, v.ds_referenza_interna ds_descrizione, null nr_lotto, 'E' cd_tipo_movimento, NVL(gi.ps_netto, 0) qta, ...

Managing errors

BEGIN -- ... -- -- statements -- -- ... -- RAISE_APPLICATION_ERROR(-20000, 'Custom error'); /*-20000 .. -20999*/ --RAISE NO_DATA_FOUND; COMMIT; EXCEPTION WHEN NO_DATA_FOUND THEN ROLLBACK; DBMS_OUTPUT.put_line('Nessun dato trovato'); WHEN OTHERS ...

Next
Go Top