1

これは を使用してpostmodernいます。

これは機能します:

(sql (:INSERT-ROWS-INTO 'SCRAPE :COLUMNS 'TERM 'NAME 'ADDRESS :VALUES
  '(("wine" "Bubba Wine & Spirits"
 "1234 N San Fake Rd,")
    ("wine" "Wine Shop"
     "123 Not Real Blvd,")
    ("wine" "Some Wine Group"
     "777 S Does Not Exist Ave,"))))

戻り値:

"INSERT INTO scrape (term, name, address) 
 VALUES (E'wine', E'Bubba Wine & Spirits', E'1234 N San Fake Rd,'), 
        (E'wine', E'Wine Shop', E'123 Not Real Blvd,'), 
        (E'wine', E'Some Wine Group', E'777 S Does Not Exist Ave,')"

これは機能しません:

(defvar *sql* '(:INSERT-ROWS-INTO 'SCRAPE :COLUMNS 'TERM 'NAME 'ADDRESS :VALUES
  '(("wine" "Bubba Wine & Spirits"
 "1234 N San Fake Rd,")
    ("wine" "Wine Shop"
     "123 Not Real Blvd,")
    ("wine" "Some Wine Group"
     "777 S Does Not Exist Ave,"))))

(sql *sql*)

これは私に与えます:

Value (:INSERT-ROWS-INTO 'SCRAPE :COLUMNS 'TERM 'NAME 'ADDRESS
       :VALUES
       '(("wine" "Bubba Wine & Spirits"
          "1234 N San Fake Rd,")
         ("wine" "Wine Shop" "123 Not Real Blvd,")
         ("wine" "Some Wine Group" "777 S Does Not Exist Ave,"))) can not be converted to an SQL literal.
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [ABORT] Exit debugger, returning to top level.

Backtrace:
  0: ((SB-PCL::FAST-METHOD CL-POSTGRES:TO-SQL-STRING (T)) #<unavailable argument> #<unavailable argument> (:INSERT-ROWS-INTO 'SCRAPE :COLUMNS 'TERM 'NAME 'ADDRESS ...))
  1: ((SB-PCL::FAST-METHOD SQL-ESCAPE (T)) #<unavailable argument> #<unavailable argument> (:INSERT-ROWS-INTO 'SCRAPE :COLUMNS 'TERM 'NAME 'ADDRESS ...))
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SQL *SQL*) #<NULL-LEXENV>)
  3: (EVAL (SQL *SQL*))
  4: (SB-EXT:INTERACTIVE-EVAL (SQL *SQL*) :EVAL NIL)
  5: (SB-IMPL::REPL-FUN NIL)
  6: ((LAMBDA () :IN SB-IMPL::TOPLEVEL-REPL))
  7: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA # :IN SB-IMPL::TOPLEVEL-REPL) {BFC3BFD}>)
  8: (SB-IMPL::TOPLEVEL-REPL NIL)
  9: (SB-IMPL::TOPLEVEL-INIT)
 10: ((FLET #:WITHOUT-INTERRUPTS-BODY-223764 :IN SB-EXT:SAVE-LISP-AND-DIE))
 11: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))

したがって、私は非常に明らかに混乱して(sql *sql*)おり、一生エラーメッセージを解読することはできません.

4

2 に答える 2