PHP - ORA-01747: invalid user.table.column, table.column, or column specification

L. Zen

I'm trying to update a table called RAC_PV at my oracle database but the query is returning that error when i run my application. I thing everyting is right because i run the same query on sqldeveloper (but with manual values) and when i change the variable $preco_medio to a number like 1, it works on the application. Here's my code:

$preco_medio = number_format(($v_interna_real / $encargo + $vipe_real) / $v_interna_t + $vipe_t , 2, ",", ".") ;

sc_exec_sql("update RAC_PV set PRECO_MEDIO = $preco_medio where rac_anopv = {ano} and rac_mespv = {mes} and codempresa = $id_empresa and codpainel = 6 and cod_prod1 = '$id_produto'");

My table name and the column names are right and checked, my variables like {ano}, {mes}, $id_produto and $preco_medio are all corretly seted. This sc_exec_sql("query here") works fine. Maybe the problem is in the $preco_medio ? I've never used that number_format but when a echo this the number shows right for me like 3,123.03 .

Can anyone help me?

sticky bit

3,123.03

That's not a number literal, that's two numbers, 3 and 123.03, one of which is apparently interpreted as column name. Remove the grouping , in the number literal expression or use TO_NUMBER() and a string literal with the formatted number representation.

The best way however would be not to build queries by string concatenation but parametrized queries. String concatenation is prone to SQL Injection. Also parametrized queries find the right representation for the DBMS (usually and mostly) automatically, avoiding such problems you have here.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

org.hibernate.exception.SQLGrammarException: ORA-01747: invalid user.table.column, table.column, or column specification

From Dev

Getting error while creating trigger- PL/SQL: ORA-01747: invalid user.table.column, table.column, or column specification

From Dev

Php column table width

From Dev

PHP table linkable column

From Dev

no column was specified for column [x] of [table] and invalid column name

From Dev

tidyr - spread "Invalid column specification"

From Dev

ORA-01735: invalid ALTER TABLE option (While trying to drop DEFAULT on a COLUMN)

From Dev

ORA-01735: invalid ALTER TABLE option (While trying to change DEFAULT on a COLUMN)

From Dev

PHP Echo Table Column Alignment

From Dev

Invalid table alias or column reference b

From Dev

Getting invalid column name using a pivot table

From Dev

Uncaught error: Invalid type for google table column

From Dev

Getting invalid column name using a pivot table

From Dev

Foreign key refers invalid column in referred table

From Dev

Invalid column name for table type parameter

From Dev

How to hide column from user in MySQL table

From Dev

Remove table column based on user group membership

From Dev

How to Insert Into User Defined Type Column Table

From Dev

How to insert into a table with a column named 'when' and 'user'

From Dev

CREATE TABLE failed ORA 00957 Duplicate column name

From Dev

ORA-01400: Cannot insert null into (TABLE.COLUMN) (Hibernate)

From Dev

CREATE TABLE failed ORA 00957 Duplicate column name

From Dev

Update a column in a table based on column in another table

From Dev

How to strip text in table column according to column width in PHP

From Dev

How to sort a table on 1 column and then sort on another column in PHP

From Dev

php function not adding column to database table

From Dev

check mysql column in table for duplicates in php

From Dev

PHP not storing the date in MySQL table column

From Dev

select count(column) from table of mysql in php

Related Related

  1. 1

    org.hibernate.exception.SQLGrammarException: ORA-01747: invalid user.table.column, table.column, or column specification

  2. 2

    Getting error while creating trigger- PL/SQL: ORA-01747: invalid user.table.column, table.column, or column specification

  3. 3

    Php column table width

  4. 4

    PHP table linkable column

  5. 5

    no column was specified for column [x] of [table] and invalid column name

  6. 6

    tidyr - spread "Invalid column specification"

  7. 7

    ORA-01735: invalid ALTER TABLE option (While trying to drop DEFAULT on a COLUMN)

  8. 8

    ORA-01735: invalid ALTER TABLE option (While trying to change DEFAULT on a COLUMN)

  9. 9

    PHP Echo Table Column Alignment

  10. 10

    Invalid table alias or column reference b

  11. 11

    Getting invalid column name using a pivot table

  12. 12

    Uncaught error: Invalid type for google table column

  13. 13

    Getting invalid column name using a pivot table

  14. 14

    Foreign key refers invalid column in referred table

  15. 15

    Invalid column name for table type parameter

  16. 16

    How to hide column from user in MySQL table

  17. 17

    Remove table column based on user group membership

  18. 18

    How to Insert Into User Defined Type Column Table

  19. 19

    How to insert into a table with a column named 'when' and 'user'

  20. 20

    CREATE TABLE failed ORA 00957 Duplicate column name

  21. 21

    ORA-01400: Cannot insert null into (TABLE.COLUMN) (Hibernate)

  22. 22

    CREATE TABLE failed ORA 00957 Duplicate column name

  23. 23

    Update a column in a table based on column in another table

  24. 24

    How to strip text in table column according to column width in PHP

  25. 25

    How to sort a table on 1 column and then sort on another column in PHP

  26. 26

    php function not adding column to database table

  27. 27

    check mysql column in table for duplicates in php

  28. 28

    PHP not storing the date in MySQL table column

  29. 29

    select count(column) from table of mysql in php

HotTag

Archive