Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

278
Views
Insertar una matriz en postgresql

Uso python para conectarme a mi base de datos postgresql. Analizo un relleno XML para completar mi base, por lo que tengo una matriz [] de valores para insertar una línea. Tengo algo como esto:

 cur.execute("""INSERT INTO ACTIVITYDESC VALUES (%s,%s,%s,%s,%s)""",(value[0],value[1],value[2],value[3],value[4]))

Hay una manera de hacer esto más simple como: ?

 cur.execute("""INSERT INTO ACTIVITYDESC VALUES (%s)""",(value))

Gracias por tu ayuda

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Convierte la lista en una tupla:

 t = tuple(value) cur.execute("""INSERT INTO ACTIVITYDESC VALUES %s""",(t,))
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!