Oci_fetch_object example for newbie

Hello,
I'm new to PHP5. I would like to learn how to use OCI_FETCH_OBJECT to display my Oracle tables. I see how to use OBJECT... looks like it's similar to all the other OCIFETCH_ functions. But what I don't know how to do is refer to the object's attributes.
For example, here's my code... but how to PRINT the object's column? Here's snippet of my code:
$query = 'select * from emp';
$stmt = oci_parse($conn, $query);
$exec = oci_execute($stmt);
while ( $row = oci_fetch_object($stmt) )
    print "<br><hr /><br>";
    print "<pre>";
    print_r($row);
    print "</pre>";
    // ***** this is the part I don't understand  *****
    $obj = new stdClass();
    print "NAME: " . $obj->NAME . "<br />";
}Help?
TIA
PS: My BREAK tags seem to be chopped by the Forum.
Message was edited by:
vl

<?php
$conn = oci_connect("hr", "hrpwd", "//localhost/XE");
$stid = oci_parse($conn, 'select * from employees');
oci_execute($stid);
while ($row = oci_fetch_object($stid)) {
//  var_dump($row);
    echo "EMPLOYEE_ID=".$row->EMPLOYEE_ID."\n";
    echo "FIRST_NAME=".$row->FIRST_NAME."\n";
     echo "LAST_NAME=".$row->LAST_NAME."\n";
     echo "EMAIL=".$row->EMAIL."\n";
     echo "PHONE_NUMBER=".$row->PHONE_NUMBER."\n";
     echo "HIRE_DATE=".$row->HIRE_DATE."\n";
     echo "JOB_ID=".$row->JOB_ID."\n";
     echo "SALARY=".$row->SALARY."\n";
     echo "COMMISSION_PCT=".$row->COMMISSION_PCT."\n";
     echo "MANAGER_ID=".$row->MANAGER_ID."\n";
     echo "DEPARTMENT_ID=".$row->DEPARTMENT_ID."\n";
?>

Similar Messages

  • FYI   OIM API Examples for newbies

    Hi All,
    I found this page about 6 months ago when I first started learning how to write adapters and such. I also didn't like the design console much and found these command line API examples to be both educational and useful.
    enjoy
    http://zerointech.com/idm-articles.html
    Fred

    Did you do the following step while putting in jars in the lib directory under eclipse base directory:
    *10.3 Postinstallation Requirements for the Design Console* in the link:
    http://download.oracle.com/docs/cd/E14049_01/doc.9101/e14064/design_console.htm#CHDIJJGI
    I know that you cannot get OIM Design Console running without this mandatory step and Eclipse + OIM behaves the same way.

  • Examples for RAS/BOE/Viewer SDK for Business Objects XI 3.1 (12.0)

    Hi, I am a newbie in Business Objects.
    I am trying to find some examples on how to view reports on separate Application server (JBoss) and retrieve reports from Business Objects server. Us I understood from forums/guides I need to use Viewer SDK or (BOE/RAS SDK).
    However I cannot find any examples for above mentioned SDKs to start from something.
    OIne of the places I came across is here: http://devlibrary.businessobjects.com/businessobjectsxi/en/en/Viewers_SDK/default.htm indeed it is only for v11, as well as others places I came across.
    Can anyone guide me with this?
    Thank you!

    Hello.
    Java samples can be found at the following location:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/BusinessObjectsSDKSampleApplications
    Specifically, Business Objects Enterprise (including the Viewers SDK) samples can be found at the following location:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/JavaBusinessObjectsEnterpriseSDKSamples
    RAS SDK samples can be found at the following location:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/JavaRASSDK+Samples
    Hope this helps.
    Regards.
    - Robert

  • Example for Using WDR_SELECT_OPTIONS and SALV_WD_TABLE in one View

    Hello,
    I need an Example for Using the WD-Components WDR_SELECT_OPTIONS and SALV_WD_TABLE
    in one view. Can anybody help me?
    Thanks
    Toto

    Hello,
    Please see these:
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3439404a-0801-0010-dda5-8c14514d690d]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/21706b4b-0901-0010-7d93-c93b6394bc1d]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/39c54fe7-0b01-0010-0eb6-d63ac2bdd637]
    [/people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application]
    [/people/thomas.jung3/blog/2005/12/21/webdynpro-abap-alv]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8]
    Regards.

  • Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Could u plz help me to find simple example for how to save data file in a spread sheet or any other way in the real time controller for Sbrio 9642 using memory or usb flash memory

    Here are a few Links to a helpful Knowledge Base article and a White Paper that should help you out: http://digital.ni.com/public.nsf/allkb/BBCAD1AB08F1B6BB8625741F0082C2AF and http://www.ni.com/white-paper/10435/en/ . The methods for File IO in Real Time are the same for all of the Real Time Targets. The White Paper has best practices for the File IO and goes over how to do it. 
    Alex D
    Applications Engineer
    National Instruments

  • Which is better for newbies?

    Which is better for newbies, Jgrasp or Netbeans? I need something that explains errors more thoroughly than Jgrasp.

    Here's my code with 3 errors. Now bear in mind that my program has compiled completely and ran correctly up to this method. All I'm trying to do with this method is get the average of all grades in a multi-array. I researched and found some code that was similar to what I needed to do but it's not working out yet. All other methods in my program work perfectly but I can't get this one to compile.
    public double getMean(int allGrades[][])
              int total = 0;
              for (int grade : allGrades)
              total += grade;
         System.out.println("Total is "+getMean(grades));     
              return total/allGrades.length;
    } // end class GradeBookGradebook.java:100: illegal start of type
              return total/allGrades.length;
              ^
    Gradebook.java:100: <identifier> expected
              return total/allGrades.length;
              ^
    Gradebook.java:100: <identifier> expected
              return total/allGrades.length;
              ^
    3 errors

  • Example for 4 or 3 level Hierarchail Seq ALV report?

    i need the example for 4 or 3 level heirarchial sequential ALV report. ?

    Hi,
    Hierarchail Seq ALV may not support 3rd 4th levels.For this type of requirement you may go to tree report.
    Refer the below links for tree report.
    [http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm|http://www.****************/Tutorials/ALV/ALVTreeDemo/demo.htm]
    DWDM -  transaction for sample/demo programs for controls
    sample Program
    BCALV_TREE_01                  ALV Tree Control: Build Up the Hierarchy Tree
    BCALV_TREE_02                  ALV Tree Control: Event Handling
    BCALV_TREE_03                  ALV Tree Control: Use an Own Context Menu
    BCALV_TREE_04                  ALV Tree Control: Add a Button to the Toolbar
    BCALV_TREE_05                  ALV Tree Control: Add a Menu to the Toolbar
    BCALV_TREE_06                  ALV tree control: Icon column and icon for nodes/items
    BCALV_TREE_DEMO                Demo for ALV tree control
    BCALV_TREE_DND                 ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_DND_MULTIPLE        ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_EVENT_RECEIVER      Include BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER01
    BCALV_TREE_ITEMLAYOUT          ALV Tree: Change Item Layouts at Runtime
    BCALV_TREE_MOVE_NODE_TEST      Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO         Program BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY              Verifier for ALV Tree and Simple ALV Tree
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • PAPI Web Service (PAPI-WS) Example for Oracle BPM Studio

    Here is the location of a step-by-step explanation on how to use PAPI Web Service (PAPI-WS) to create a work item instance and then run the instance inside an activity in a process running on Oracle BPM Studio.
    http://www.4shared.com/file/128256802/f20abc7a/PAPI-WS_for_Oracle_BPM_Studio.html
    Be sure to use the project that is in the zip file for this example.
    If you need an example of how to use PAPI-WS on Oracle BPM Enterprise, go to this thread: PAPI Web Service (PAPI-WS) Example for Oracle BPM Enterprise Standalone
    If you need a step-by-step example of how to use PAPI (the Java API) go to this thread: Creating a new work item instance in a process using PAPI
    Hope this helps,
    Dan

    Hi,
    Is there any sample code showing PAPI-WS with VS 2008? AFAIK, there is a sample using VS 2005 and WSE 3.0, but I'm interested in using VS 2008/WCF.
    Regards,

  • PAPI Web Service (PAPI-WS) Example for Oracle BPM Enterprise Standalone

    Here is the location of a step-by-step explanation on how to use PAPI Web Service (PAPI-WS) to create a work item instance and then run the instance inside an activity in a process running on Oracle BPM Enterprise Standalone.
    http://www.4shared.com/file/128249957/9bd6ef61/PAPI-WS_for_Oracle_BPM_Standalone.html
    Be sure to use the project that is in the zip file for this example.
    To see how to invoke PAPI-WS when using Oracle BPM Studio, go to this thread: PAPI Web Service (PAPI-WS) Example for Oracle BPM Studio
    If you need a step-by-step example of how to use PAPI (the Java API) go to this thread: Creating a new work item instance in a process using PAPI
    Hope this helps,
    Dan

    Dan,
    I tried in both studio and Standalone.
    From Studio :*
    1. The Url for the Webservice is (http://localhost:8585/papiws/PapiWebServiceEndpoint?wsdl). From studio by default port number was 8585.From this studio wsdl URL(http://localhost:8585/papiws/PapiWebServiceEndpoint?wsdl),I did n't see any wsdl text in the browser.
    From Standalone :*
    1. In BPM Admin Center, I have selected *"PAPI Web Services"* check box(Page 5 of your document).
    2. In The BPM Admin Center, I have clicked on *"Start BPM Web Applications"*.
    3. After Stand alone server started *"Launch PAPI WebServices Console"* link was enabled,And I clicked on that link.It opened a browser with URL (http://localhost:8686/papiws/PapiWebService)
    Oracle® BPM PAPI Web Services
    Service Name 'PapiWebService'
    Style: Document Literal Wrapped
    SSO Enabled: false
    WS-Security UsernameToken Profile Authentication Enabled: false
    HTTP Basic Authentication Enabled: true
    Preset Authentication Enabled: false
    MTOM Optimization for attachments Enabled*: false
    Endpoint: http://localhost:8686/papiws/PapiWebServiceEndpoint
    WSDL: http://localhost:8686/papiws/PapiWebServiceEndpoint?wsdl
    I have copied wsdl URL(http://localhost:8686/papiws/PapiWebServiceEndpoint?wsdl) and pasted it into a browser's URL field.I did n't see any wsdl text in the browser,but I see following error
    HTTP Status 404 - Servlet PapiWebServiceServlet is not available
    type Status report
    message Servlet PapiWebServiceServlet is not available
    description The requested resource (Servlet PapiWebServiceServlet is not available) is not available.
    Apache Tomcat/5.5.15
    Edited by: Prabhasankar on Dec 24, 2010 9:10 AM

  • Example for LVUserEvent

    Hi,
    I am looking for examples for using LVUserEvent.
    In found this:
    http://zone.ni.com/devzone/cda/epd/p/id/1480
    but the zip-archive is not including any vi, only c-code and the dll, so I have difficulties to understand how it works.
    I am looking for examples, how to fire events from my VisualStudio2005 C-DLL to labview evebt structure.
    Werner

    huerttlen wrote:
    Your 3rd example is exactly the one, I am missing the vi in the zip: where do I find the vi to play with this ?
    There is only one LLB in that zip file. Attaching here.
    Mathan
    Attachments:
    LVUserEvent.llb ‏38 KB

  • Example for loading a csv file into diadem from a labview application

    Hi everyone, i'm using labview 8.2 and DIAdem 10.1.
    I've been searching in NI example finder but I had no luck so far.
    I have already downloaded the labview connectivity VIs.
    Can anyone provide a example that can help me loading a csv file into diadem from a labview application?
    Thanks

    Hi Alexandre.
    I attach an example for you.
    Best Regards.
    Message Edité par R_Duval le 01-15-2008 02:44 PM
    Romain D.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    NIDays 2010 : Conférence mondiale de l'instrumentation virtuelle
    >>Détails et Inscription<<
    Attachments:
    Classeur1.csv ‏1 KB
    Load CSV to Diadem.vi ‏15 KB

  • Syntax errors in examples for UTL_LMS

    The examples for UTL_LMS in
    Oracle® Database PL/SQL Packages and Types Reference
    10g Release 2 (10.2)
    Part Number B14258-01
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_lms.htm
    contain syntax errors
    Correct would be
    DECLARE
       s varchar2(200);
       i  pls_integer;
    BEGIN
       i:= utl_lms.get_message(26052, 'rdbms', 'ora', 'french', s);
       dbms_output.put_line('before format, message is: '||s);
       dbms_output.put_line('formatted message is: '||utl_lms.format_message(s, 9, 'my_column_name'));
    END;
    /and
    DECLARE
      s varchar2(200);
      i pls_integer;
    BEGIN
       i:=utl_lms.get_message(601, 'rdbms', 'oci', 'french', s);
       dbms_output.put_line('OCI--00601 is: '||s);
    END;
    /

    Hello Martin,
    This is a known problem with wlst-jython. One cannot catch syntax errors
    programmatically. The only way is to avoid loading properties file
    that may cause syntax errors.
    I am curious though how can a user enter invalid properties via a script?
    thanks,
    -satya
    Martin Gustavsson wrote:
    Hi,
    When there are syntax errors in WLST-script, the calling program will get no information about this.
    In our case the calling program is ANT. If the user enters invalid properties it could cause syntax errors in the WLST script. But the ANT task always receive a successfull code back and doesn't know that it went wrong.
    What is the workaround for this? How can I from WLST return a fail code so that ANT does not continue?
    Regards,
    Martin

  • Hi Experts, need an example for abap unit test(ABAP OO)?

    Hi Experts,
    I want to do abap unit test for the developed programs, could anyone please give me an example program of development(a simple is ok, just use it to test)? and an abap unit test example for the program, what I want is to use object oriented abap, thanks in advance!
    Merry Christmas to you all.
    Kind regards
    Dawson

    Hi
    Below documents will give you more information,
    http://help.sap.com/saphelp_nw04/helpdata/en/a2/8a1b602e858645b8aac1559b638ea4/content.htm
    ABAP Testing and Troubleshooting [original link is broken]
    http://bi.offis.de/publicProject/g16cglafhqva.htm
    regards
    Nagaraju

  • I need code example for server act as client and vice versa

    Hi all,
    I want code example for performing both server and clients using RMI. I mean Server will act as client and client will act as server. So a single program will act as both client and server .
    Please give example, it will helpful to complete my project. I am struggling in this stage. Its like peer to peer action.
    Thanks & Regards
    R.Ragupathi

    1. The tutorial shows you how to do cleint/server.
    2. Search on the topic "callback" to see how cleint and server roles can be reversed.

  • I need the coding example for encapsulation

    hi all
    i need the coding example for encapsulation
    thanks in advance

    hi all
    i need the coding example for encapsulation
    thanks in advanceI see a man, hes trapped on the other side.. what Sam?... yes ... hes wearing a hood, he's a hooded gentleman, perhaps a monk who practised the black arts.... he says... "google for the answer"...

Maybe you are looking for

  • How to Capture warning message in SHDB recording

    Hi SDN, I am getting problem in Recording FB03 through SHDB. when i am clicking on save as complete button i am getting a warning message as duplicate entry. when click on enter button the actuval object got saved bu from recording it is not captured

  • Refiner based on URL

    I have 2 Content Sources crawled to URL1 and URL2. While searching in 'Everything' navigation link, I need to have a URL1 refiner on the left that shows only contents from URL1. Can I do that?

  • Maintain State of a Tree Table

    Hi, I am using Tree Table with EJB Datacontrol. I am fetching child records on Disclose icon of a treetable. I have added context menu on tree table to navigate to another taskflow. I want to maintain the same state i.e. Tree Table should be in Expan

  • Unable to Start the Weblogic Console, "The domain edit lock error persists"

    Hi, I have read a post regarding "The domain edit lock is owned by another session in exclusive mode" error in Weblogic server Using JDeveloper, I am also getting the same error when I ran the JDeveloper, But to change the settings I am Unable to ope

  • Exporting tiff to jpeg - loss of light

    Hello, Since a couple of days when I export tiff files to jpeg the exported image looks darker. If I reimport it the histogram is evidently changed. It looks like something messed up in preferences but I didn't make any changes (at least I didn't do