CREATE OR REPLACE FUNCTION insertuser
     (username VARCHAR,
      emails VARCHAR, 
      address VARCHAR, 
      creditcard INTEGER, 
      purchase VARCHAR,
      product_id VARCHAR,
      number_of_products INTEGER)

I keep getting the error

ERROR: syntax error at end of input
LINE 10: ^

SQL state: 42601
Character: 181

Why is this happening and how can I fix it?

I've tired to add parentheses and refreshed just in case my server timed out

1 Answers

0
Community On

Try like this, i guess your command isn't complete. You do not have return values and, BEGIN END Use command, like this:

 CREATE [OR REPLACE] FUNCTION     function_name [ (parameter [,parameter]) ]
 RETURN return_datatype IS | AS  [declaration_section]
 BEGIN 
 executable_section [EXCEPTION exception_section]
 END [function_name];

Check like this, command in [ ] isn't necessary.