Hi Mahesh,
Where did you find gdb? Seems a old thing of past releases. To get the
graph or db instance follow the documentation:

Access to the databases from Functions

OrientDB always binds a special variable "orient" to use OrientDB services
from inside the functions. The most important methods are:

   - *orient.getGraph()*, returns the current transactional graph database
   
<http://www.orientechnologies.com/javadoc/latest/com/tinkerpop/blueprints/impls/orient/OrientGraph.html>
    instance
   - *orient.getGraphNoTx()*, returns the current non-transactional graph
   database
   
<http://www.orientechnologies.com/javadoc/latest/com/tinkerpop/blueprints/impls/orient/OrientGraphNoTx.html>
    instance
   - *orient.getDatabase()*, returns the current document database
   
<http://www.orientechnologies.com/javadoc/latest/com/orientechnologies/orient/core/db/document/ODatabaseDocumentTx.html>
    instance

Source: http://orientdb.com/docs/last/Functions.html

Lvc@


On 15 April 2015 at 13:57, Mahesh Wabale <[email protected]> wrote:

> Hello everyone , i want solution on this error , which is getting at the
> time of executing function .
>
>
> code of function is :
>
>
>
> //create a set of members
> // prefix = name prefix
> // n is the no of members i want to create
>
>
> for(var i=0 ;i < n ; i++){
>
>  var name=prefix+ "_" + i;
>   var member={
>     "@class":"Member",
>     "name" : name
>
>   };
>
>   var result=gdb.save(member);
>
>
> }
> gdb.commit();
> return n;
>
>
>
>
> i am giving parameter mahesh  it gives error msg on execution time as
>
>
> Erroronparsingscriptatposition#0: ErroronexecutionofthescriptScript:
> createMember------^sun.org.mozilla.javascript.internal.EcmaError:
> ReferenceError:
> "gdb"isnotdefined.(<Unknownsource>#16)in<Unknownsource>atlinenumber16ReferenceError:
> "gdb"isnotdefined.(<Unknownsource>#16)
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Best Regards,

Luca Garulli
CEO at Orient Technologies LTD
the Company behind OrientDB
http://about.me/luca.garulli

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to