-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error saving field of type CLOB #363
Comments
please use english language |
Error saving field of type CLOB
Displays this error:
|
hmm isnt this:
give it a try, but i might be wrong |
Displays this error:
|
ah okay its nested.... try:
your code passes two args each with one array.. that is wrong |
same error above |
You don't need to use updateLob for CLOB. You can directly set it's value like a string. updateLOB is only necessary if you are updating a BLOB columns. $dados = \DB::table('mytable')->where('id', $id)->update([
'name' =>'demo update blob',
'content' => 'blob content here'
]); |
When I use UPDATE only it throws the error below.
|
Make sure that clob field bindings is at the end of statement like the one did on laravel/framework#13469. |
Yes, I do exactly the way you mentioned above
|
I just tried from a fresh install app. All works well. // migration
Schema::create('demos', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->text('content');
});
// tinker
DB::table('demos')->insert(['name' => 'test', 'content' => 'asdasd']); // true
DB::table('demos')->whereId(1)->update(['name' => 'texxxst', 'content' => 'asdasd edited blob content']); // true |
When I enter less than 3000 characters it works. The problem is when you exceed this amount |
maybe it's something how your columns are defined.... but i works for me too on a local test app! so it must be on your side |
@mstaack , Did you try to insert more than 3000 characters? |
Help me, please. |
@luiz-andrade I just tried saving 3575 chars on an article and it works for me. This might be on your oci8 driver / environment. I tested on the ff:
|
inserted using |
Excuse the insistence, but I really need to sort this out. On the error in line 63, I discovered through the documentation the in function saveLob() the $parameter variable should start at: 1 and not 0, here http://php.net/manual/en/pdostatement.bindparam.php
Changed it stays this way 98 public function saveLob(Builder $query, $sql, array $values, array $binaries)
99 {
100 $id = 0;
101 $parameter = 1;
102 $statement = $this->prepareStatement($query, $sql);
103
104 $parameter = $this->bindValues($values, $statement, $parameter);
105
106 $countBinary = count($binaries);
107 for ($i = 0; $i < $countBinary; $i++) {
108 $statement->bindParam($parameter, $binaries[$i], PDO::PARAM_LOB, -1);
109 $parameter++;
110 }
111
112 // bind output param for the returning clause.
113 $statement->bindParam($parameter, $id, PDO::PARAM_INT, 10);
114 if (! $statement->execute()) {
115 return false;
116 }
117
118 return (int) $id;
119 } When
Put when
|
@luiz-andrade it was inserted using $model = Model::find(1);
$model->clob = 'test';
$model->save(); Anyways, can you please submit a PR on your findings? Thanks! |
@yajra, Did not work. |
this works for me:
environment configured with: php 7.3, oracle 11g |
Boa tarde. Não estou conseguindo salvar um dado do tipo clob
Estou fazendo desta forma
Apresenta este erro:
System details
The text was updated successfully, but these errors were encountered: