• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: EOF Oracle function call
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EOF Oracle function call


  • Subject: Re: EOF Oracle function call
  • From: Don Lindsay <email@hidden>
  • Date: Wed, 21 Jan 2009 23:37:13 -0500
  • Thread-topic: EOF Oracle function call

Title: Re: EOF Oracle function call
Hello;

I just did this the other day, so you are in luck :).   Add a attribute to your table/entity, set it’s type as COLUMN, enter the column name you want to pass to the function .   Set the return type, in this case I used VARCHAR2 and set the internal data type to String.   Modify the properties for the attribute and set the read property to the function you  wish to use.  I used to_char(%P,’DD MONTH YYYY’), the %P represents the value to be passed to the function, in this case DATEID.  I set the value to ReadOnly, so I did not have to enter a function to write a value in the DATEID field.

After it is all said and done it looks like this:

       {
            allowsNull = Y;
            columnName = DATEID;   (column that is going to be passed to function)
           externalType = VARCHAR2; (External type expected, in this case VARCHAR2)
           internalInfo = {"_nameInObjectStore" = "TO_CHAR(DATEID,'DD MONTH YYYY')"; };  (This is the data you enter for your read function)
           isReadOnly = Y; (Here it is readonly  not updateable)
           name = theDateAsString;  (What you called the attribute)
           readFormat = "TO_CHAR(%P,'DD MONTH YYYY')";  (This is the data you entered for the read function)
           valueClassName = NSString;  (Internal Data Type)
           width = 11;  (External Width)
       },

It is pretty easy, from the properties file it looks hard but it is not.  Change 2 things, set the readonly property and set the read format using %P for the value that EOF should pass to your function.  And  WA-LA.

Thanks

Don


On 1/21/09 3:57 PM, "Tom Pelaia" <email@hidden> wrote:

Hi,

I am trying to call a function with a return value defined in an Oracle database. I found legacy EOF notes indicating that it was possible to do so by adding an argument named "returnValue" to the EO stored procedure, but this results in the following exception:
    [exec] PLS-00306: wrong number or types of arguments in call to 'LOGBOOK_ENTRY_WORK_ORDER_ASSOC'

Has anyone been able to call function on an Oracle database? If so, how?

I've defined my stored procedure in the model as:
{
    arguments = (
        {
            allowsNull = Y;
            columnName = "p_log_entry_id";
            externalType = NUMBER;
            name = "entryID";
            parameterDirection = 1;
            valueClassName = NSNumber;
            valueType = i;
        },
        {
            allowsNull = Y;
            columnName = "p_work_order_number";
            externalType = NUMBER;
            name = "workOrderID";
            parameterDirection = 1;
            valueClassName = NSNumber;
valueType = i;
        },
        {
            name = "returnValue";
    parameterDirection = 2;
            externalType = NUMBER;
            parameterDirection = 2;
            valueClassName = NSNumber;
    valueType = i;
        }
    );
    externalName = "logbook.logbook_pkg.logbook_entry_work_order_assoc";
    name = linkToWorkOrder;
}


best regards,
tom


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >EOF Oracle function call (From: Tom Pelaia <email@hidden>)

  • Prev by Date: Re: Prefetching many-to-many relationship [Solved]
  • Next by Date: Re: webobjects installer crashing
  • Previous by thread: EOF Oracle function call
  • Next by thread: Rép : Prefetching many-to-many relationship [Solved]
  • Index(es):
    • Date
    • Thread