Welcome Guest, Not a member yet? Register   Sign In
Null in postgres
#1

[eluser]pendalpusher[/eluser]
maybe I am searching for the wrong thing, I can't believe I could not find anything about this...

anyway

I have a pretty big data object that is getting inserted into a postgres table

the object is coming over something like this.
Code:
..a lot of stuff before
[customer_po_number] => '11119'
[date_text_printed] => ''
[job_description] => 'BOOK'
[date_stripped] => ''
[date_proof_delivered] => ''
[qty_ordered] => '500'
[unit_price] => '.25000'
.. a lot of stuff after

I am just trying to insert the entire object into a postgres table using active record
Code:
$this->db->insert('client_data',$data_object);

when I try and do this .. postgres errors out at the first '' empty field. I assume because it is looking the NULL.

I tried filling the '' values with NULL but it still errors out complaining that the value 'NULL' is not valid. I assume again because of the quotes.

Is there anyway around this besides hand coding it? This insert has over 125 fields.

Thanks in advance. And I apologize if this question has been asked before, I did try and search.




Theme © iAndrew 2016 - Forum software by © MyBB