Guest User

Untitled

a guest
Apr 5th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. const oracledb = require('oracledb');
  2.  
  3. let query=`UPDATE TABELA
  4. SET COL1=:info1, COL2=:info2, COL3=:info3, COL4=:info4
  5. WHERE ID=:id_col`
  6.  
  7. let connection = {
  8. user:'user'||process.env.NODE_ORACLE_USER,
  9. password:'password'||process.env.NODE_ORACLE_PASSWORD,
  10. connectString:'connectSring'||process.env.NODE_ORACLE_CONNECTIONSTRING
  11. }
  12.  
  13. let info = {
  14. in1:true,
  15. in2:'word'
  16. in3:'word'
  17. in4:'word'
  18. id:6
  19. }
  20.  
  21. let putStatement =()=> oracledb.getConnection(connection, (err, conn)=>{
  22. err? alert(err.message):
  23. conn.execute(query,[info.in1, info.in2, info.in3,info.in4,info.id],{
  24. autoCommit: true,
  25. outFormat: oracledb.OBJECT
  26. },(err, result)=> {
  27. err? alert(err.message):
  28. alert(result.rowsAffected)
  29. }
  30. });
  31.  
  32. putStatement();
Add Comment
Please, Sign In to add comment