aam / oracledart

Let Dart talk to Oracle
BSD 2-Clause "Simplified" License
11 stars 2 forks source link

insert into SQL not working #9

Closed hasan3ysf closed 10 years ago

hasan3ysf commented 10 years ago

error14 Hi Alex, I created this SQL statement: var resultset1 = oracleConnection.select("insert into ppl (personid, lastname, firstname) values (2,'Hasan','Dana')");

but got an error saying "ORA-24374: define not done before fetch or execute and fetch" as attached.

thanks

aam commented 10 years ago

Hi Hasan,

can you share rest of your code following insert statement? Have you checked the database - whether insert actually did succeed?

Thanks.

hasan3ysf commented 10 years ago

Hi Alex, The insert happened in the database, ! I tried using update SQL statement with 0.0.7 edition, same thing happened, error appeared, but update had been executed.

Below the code I used.

import 'package:oracledart/oracledart.dart';

void main() { print("Hello, World!");

connect( "SYSTEM", "..system password ..", "(DESCRIPTION=" "(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))" "(CONNECT_DATA=(SERVICE_NAME=XE)(SERVER=DEDICATED)))") .then(
(oracleConnection) { print('hi from inside the block');

var resultset1 = oracleConnection.select("insert into ppl (personid, lastname, firstname) values (4,'Hasan','Yara')");
resultset1.next();
  }, 
  onError: (error) {
    print("Failed to connect: $error");
  }
  );

}

aam commented 10 years ago

Hi Hasan,

Got it.

There is no result set produced by insert or update, so this is actually as expected.

Hope this helps.

On Jul 9, 2014 3:41 PM, Hasan Yousef notifications@github.com wrote:

Hi Alex, The insert happened in the database, ! I tried using update SQL statement with 0.0.7 edition, same thing happened, error appeared, but update had been executed.

Below the code I used.

import 'package:oracledart/oracledart.dart';

void main() { print("Hello, World!");

connect( "SYSTEM", "..system password ..", "(DESCRIPTION=" "(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))" "(CONNECT_DATA=(SERVICE_NAME=XE)(SERVER=DEDICATED)))") .then(

(oracleConnection) { print('hi from inside the block');

var resultset1 = oracleConnection.select("insert into ppl (personid, lastname, firstname) values (4,'Hasan','Yara')"); resultset1.next(); }, onError: (error) { print("Failed to connect: $error"); } );

}

Reply to this email directly or view it on GitHubhttps://github.com/aam/oracledart/issues/9#issuecomment-48523904.

hasan3ysf commented 10 years ago

:) thanks, the error gone once I removed the resultset1.next();

aam commented 10 years ago

Great! Thanks for confirmation.

On Jul 9, 2014 3:57 PM, Hasan Yousef notifications@github.com wrote:

:) thanks, the error gone once I removed the resultset1.next();

Reply to this email directly or view it on GitHubhttps://github.com/aam/oracledart/issues/9#issuecomment-48526031.