Guest User

Untitled

a guest
Feb 21st, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. --Table creation
  2. CREATE TABLE TEST_DATA
  3. ("PK" VARCHAR2(100),
  4. "TESTNOTE" VARCHAR(100)
  5. )
  6. )
  7.  
  8. --Sequence creation
  9. CREATE SEQUENCE SEQ_TEST_TABLE
  10. INCREMENT BY 1 MINVALUE 1
  11. CACHE 20 NOCYCLE
  12.  
  13.  
  14. //PHP code example, require include for ADODB library
  15.  
  16. $bindVariables = array('PK' => 'SEQ_TEST_TABLE.nextval',
  17. 'TESTNOTE' => 'SOME INFORMATIONS');
  18.  
  19. $insertQuery = "INSERT INTO TEST_TABLE (PK)
  20. VALUES (:PK, :TESTNOTE)";
  21.  
  22. try {
  23. $result = $dbDbi->execute($insertQuery,$bindVariables);
  24. } catch(Exception $e) {
  25. echo $e->getMessage();
  26. }
Add Comment
Please, Sign In to add comment