Trying to run a query on 10g database using vbscript

Hi,
We have recently upgraded from oracle 8 to 10g and have been very impressed with the superb performance. However, we use vbscript applications on occasions to connect to our DB using ADO which now no longer work:
Set dbUser = CreateObject("ADODB.Connection")
set rec = createObject("ADODB.Recordset")
dbUser.ConnectionString = "Provider=OraOLEDB.Oracle;User Id=???;Password=???;"
dbUser.Open
rec.ActiveConnection = dbUser
rec.Open "select CUSTOMER_SURNAME FROM OURTABLE.TBL_ORDERS"
do until rec.EOF
     msgbox rec("CUSTOMER_SURNAME")     
     rec.movenext
loop
This table has thousands of records but when we run the query we only get 1 result. Does anybody have any thoughts as to why this might be?

I'm trying to run a query in a JTextField and then have that query display the output in a JTable.1. Write classes that only do JDBC. If there is any GUI code at all in them then it is wrong.
2. Test those classes and modify until they work.
3. Use those classes in your GUI code (other classes) to do what you want.
Questions about 1 and 2 go in this forum. Questions about 3 go into a GUI forum.
Use code tags when you post code.

Similar Messages

  • Trying to run a query

    I'm trying to run a query in a JTextField and then have that query display the output in a JTable. When I try to use .getText() to store the query in a string I keep getting errors about SQLException. Can anyone lend me in hand in telling me what I'm doing wrong?
    This is the error I get when the line below would say:
    query=jtf.getText();
    c:\java>java myguidemo
    Exception in thread "main" java.sql.SQLException: Invalid SQL type
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :208)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:67)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
    nt.java:1169)
    at oracle.jdbc.driver.OracleStatement.doScrollExecuteCommon(OracleStatem
    ent.java:4044)
    at oracle.jdbc.driver.OracleStatement.doScrollStmtExecuteQuery(OracleSta
    tement.java:4196)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:
    1280)
    at myguidemo.<init>(myguidemo.java:39)
    at myguidemo.main(myguidemo.java:106)
    c:\java>
    Here is what I have so far. I took out the oracle IP and login. This is a working version, but where query = "SELECT * ....." I would like that to get whatever is typed in the JTextField. Also button1-5 is supposed to display the entire table in the JTable just by clicking it. Right now I just have them to change background color to make sure they worked.
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    public class myguidemo extends JFrame implements ActionListener{
              Connection connection;
              Statement stmt;
              String query;
              ResultSet results;
              ResultSetMetaData md;
              int numrows, numcols;
              AbstractTableModel dataModel;
              Object [][] data;
    JTextField jtf;
    JTable jtb;
    JPanel jp;
    JScrollPane jsp;
    JButton button1, button2, button3, button4, button5;
    public myguidemo() throws Exception{
              Class.forName( "oracle.jdbc.driver.OracleDriver" );
              connection = DriverManager.getConnection("jdbc:oracle:thin:@);
              jp = new JPanel();
              add(jp,BorderLayout.SOUTH);
    jtb = new JTable();
    add(jtb,BorderLayout.CENTER);
    jtf = new JTextField();
    add(jtf,BorderLayout.NORTH);
    query = "SELECT * FROM PATIENT";
    stmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    results = stmt.executeQuery(query);
    md = results.getMetaData();
              numcols = md.getColumnCount();
              numrows = 0;
              while(results.next()) numrows++;
              results.beforeFirst();
              data = new Object[numrows][numcols];
              results.next();
              for(int i=0; i<numrows; i++){
                   for(int j=1; j<=numcols; j++){
                        data[i][j-1] = results.getString(j);
                   results.next();
    dataModel = new AbstractTableModel(){
         public int getColumnCount() {return numcols;}
         public int getRowCount() {return numrows;}
         public Object getValueAt(int row, int col) {return data[row][col];}
    jtf.addActionListener(this);
    jtb = new JTable(dataModel);
    jsp = new JScrollPane(jtb);
    add(jsp);
    button1 = new JButton("Doctor");
    button2 = new JButton("Medication");
    button3 = new JButton("Patient");
    button4 = new JButton("Prescription");
    button5 = new JButton("Supplier");
    jp.add(button1);
    jp.add(button2);
    jp.add(button3);
    jp.add(button4);
    jp.add(button5);
    button1.addActionListener(this);
    button2.addActionListener(this);
    button3.addActionListener(this);
    button4.addActionListener(this);
    button5.addActionListener(this);
    setTitle("CSIT");
    setSize(1280,720);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setVisible(true);
    public void actionPerformed(ActionEvent e){
    if (e.getSource() == jtf){
         jtf.setText("");
    if (e.getSource() == button1) jtb.setBackground(Color.RED);
    if (e.getSource() == button2) jtb.setBackground(Color.GREEN);
    if (e.getSource() == button3) jtb.setBackground(Color.BLUE);
    if (e.getSource() == button4) jtb.setBackground(Color.ORANGE);
    if (e.getSource() == button5) jtb.setBackground(Color.YELLOW);
    public static void main(String args[]) throws Exception{
         new myguidemo();
    Edited by: rizzo18 on Dec 12, 2009 1:46 PM
    Edited by: rizzo18 on Dec 12, 2009 2:06 PM

    I'm trying to run a query in a JTextField and then have that query display the output in a JTable.1. Write classes that only do JDBC. If there is any GUI code at all in them then it is wrong.
    2. Test those classes and modify until they work.
    3. Use those classes in your GUI code (other classes) to do what you want.
    Questions about 1 and 2 go in this forum. Questions about 3 go into a GUI forum.
    Use code tags when you post code.

  • BLOB insertion in Oracle 10g database using ojdbc14 (10g drivers)

    Hello!
    I have a situation where I am trying to insert a blob data into oracle 10g database using oracle thin
    10g drivers, <b>ojdbc14.jar</b> in <b>weblogic 8.1 sp2</b>. I have the following error happening very intermittently.
    <u><b>java.sql.SQLException: OALL8 is in an inconsistent state.</b></u>
    And this is leading to the <u><b>"No more data to read from socket"</b></u> error when I am trying to
    insert the BLOB into the database. I have gone through the bug list of SP2 and have realised there is the
    following issue fixed in SP3.
    <b>CR124933</b>
    <b>An Oracle BLOB sometimes used a pooled connection after the connection pool determined that
    the connection was available for reassignment.
    Code was added to ensure the BLOB is completely processed before closing the pool connection or
    ending the transaction.</b>
    I believe the problem arises when we try to insert BLOB into database using a refreshed connection
    from the pool.We have upgraded weblogic 8.1 from SP2 to SP4 service pack inorder to come over the above problem.
    But this still continues to behave intermittently.
    We put ojdbc14.jar in our classpath and Weblogic startup classpath looks like the following :-
    WLS_CLASSPATH=${WLS_DOMAIN_DIR}/appslib/server.jar:$PRE_CLASSPATH:${WLS_WEBLOGIC_HOME}/server/lib/weblogic.jar:
    ${WLS_WEBLOGIC_HOME}/server/lib/ojdbc14.jar:${WLS_WEBLOGIC_HOME}/server/lib:${WLS_JAVA_HOME}/lib/tools.jar:
    ${WLS_JAVA_HOME}/jre/lib/rt.jar:${WLS_WEBLOGIC_HOME}/server/lib/webservices.jar:${WLS_CONFIG_DIR}:
    ${WLS_CUSTLIB_DIR}:${WLS_BIN_DIR}:$POST_CLASSPATH
    export WLS_CLASSPATH
    CLASSPATH=${WLS_CLASSPATH}:${APP_CLASSPATH}
    export CLASSPATH
    After upgrade to SP4, there are new ojdbc14_g.jar(debug jar) and orai18n.jar jars in the ${WLS_WEBLOGIC_HOME}/server/ext/jdbc/oracle/10g directory added.
    Please let me know if I need to update classpath with the new 10g jars in the ext/lib directory or any suggestions
    to insert BLOB using the ojdbc14 10G drivers, Weblogic 8.1 environment would be appreciated.
    Following is the stack trace of the errors that I recieve:
    <Oct 6, 2005 1:29:36 PM EDT> <Error> <JDBC> <BEA-001112> <Test "select count(*) from DUAL" set up for pool
    "MHUBPoolStage" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state".>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "MHUBPoolStage" closed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001067> <Connection for pool "MHUBPoolStage" refreshed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <EJB> <BEA-010051>
    java.rmi.RemoteException: TransactionRequestManager.requestTransaction():
    Caught PersistnceException com.mortgagehub.busobj.PersistenceException: -5258: No more data to read from socket
    Please let me know if there is anything that I am missing.
    Thanks
    Pradeep G

    pradeep g wrote:
    Hello!
    I have a situation where I am trying to insert a blob data into oracle 10g database using oracle thin
    10g drivers, <b>ojdbc14.jar</b> in <b>weblogic 8.1 sp2</b>. I have the following error happening very intermittently.
    > <u><b>java.sql.SQLException: OALL8 is in an inconsistent state.</b></u>
    And this is leading to the <u><b>"No more data to read from socket"</b></u> error when I am trying to
    insert the BLOB into the database. I have gone through the bug list of SP2 and have realised there is the
    following issue fixed in SP3.
    > <b>CR124933</b>
    <b>An Oracle BLOB sometimes used a pooled connection after the connection pool determined that
    the connection was available for reassignment.
    Code was added to ensure the BLOB is completely processed before closing the pool connection or
    ending the transaction.</b>
    > I believe the problem arises when we try to insert BLOB into database using a refreshed connection
    from the pool.We have upgraded weblogic 8.1 from SP2 to SP4 service pack inorder to come over the above problem.
    But this still continues to behave intermittently.
    We put ojdbc14.jar in our classpath and Weblogic startup classpath looks like the following :-
    > WLS_CLASSPATH=${WLS_DOMAIN_DIR}/appslib/server.jar:$PRE_CLASSPATH:${WLS_WEBLOGIC_HOME}/server/lib/weblogic.jar:
    ${WLS_WEBLOGIC_HOME}/server/lib/ojdbc14.jar:${WLS_WEBLOGIC_HOME}/server/lib:${WLS_JAVA_HOME}/lib/tools.jar:
    ${WLS_JAVA_HOME}/jre/lib/rt.jar:${WLS_WEBLOGIC_HOME}/server/lib/webservices.jar:${WLS_CONFIG_DIR}:
    ${WLS_CUSTLIB_DIR}:${WLS_BIN_DIR}:$POST_CLASSPATH
    export WLS_CLASSPATH
    CLASSPATH=${WLS_CLASSPATH}:${APP_CLASSPATH}
    export CLASSPATH
    > After upgrade to SP4, there are new ojdbc14_g.jar(debug jar) and orai18n.jar jars in the ${WLS_WEBLOGIC_HOME}/server/ext/jdbc/oracle/10g directory added.
    > Please let me know if I need to update classpath with the new 10g jars in the ext/lib directory or any suggestions
    to insert BLOB using the ojdbc14 10G drivers, Weblogic 8.1 environment would be appreciated.
    > Following is the stack trace of the errors that I recieve:
    > <Oct 6, 2005 1:29:36 PM EDT> <Error> <JDBC> <BEA-001112> <Test "select count(*) from DUAL" set up for pool
    "MHUBPoolStage" failed with exception: "java.sql.SQLException: OALL8 is in an inconsistent state".>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001128> <Connection for pool "MHUBPoolStage" closed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <JDBC> <BEA-001067> <Connection for pool "MHUBPoolStage" refreshed.>
    <Oct 6, 2005 1:29:36 PM EDT> <Info> <EJB> <BEA-010051>
    java.rmi.RemoteException: TransactionRequestManager.requestTransaction():
    Caught PersistnceException com.mortgagehub.busobj.PersistenceException: -5258: No more data to read from socket
    Please let me know if there is anything that I am missing.
    > Thanks
    > Pradeep GHi. This is something we'd like to diagnose. How is your application
    getting using and closing pool connections? The initial symptom
    seems to be an internal oracle problem... Are you using standard
    JDBC or oracle-specific calls?
    Joe

  • Error while trying to run Bex Query -------- Field symbol is not assigned.

    Hello Every body,
    I am facing the following error after giving some value in Selection screen and trying to run the Bex Query
    ERROR : Field symbol is not assigned.
    Thanks in advance,
    Praveen

    can u plz give details of variables, what it is build on and the value u r inputing,
    also is thr any dump.
    double click on the error message it shows u. it will give u the detailed error message. post that too

  • I run out of memory when trying to run a query

    I need help with a query. I am trying to extract Total Qty Sold ( and eventually get this data by month), but when I would run the query asking for QTY I get "System Out Of Memory". I removed that party of the query asking for Qty and posted what I came up with below. Any Help is greatly appreciated.
    SELECT T0.[ItemCode], T0.[ItemName], T1.[FirmName], T0.[CardCode], T0.[SuppCatNum], T2.[ItmsGrpNam], T0.[U_U_CMG_PROGRAM], T0.[U_U_CMG_CATEG], T0.[U_CMG_STATUS], T0.[U_CMG_STORES], T0.[U_CMG_COLOR], T0.[U_CMG_LOCAT], T0.[MinLevel], T0.[MinOrdrQty]
    FROM OITM T0  INNER JOIN OMRC T1 ON T0.FirmCode = T1.FirmCode INNER JOIN OITB T2 ON T0.ItmsGrpCod = T2.ItmsGrpCod

    Hi,
    Welcome you post on the forum.
    Try this fist:
    SELECT T0.ItemCode, T0.ItemName, T1.FirmName, T0.CardCode, T0.SuppCatNum, T2.ItmsGrpNam, T0.MinLevel, T0.MinOrdrQty
    FROM OITM T0
    INNER JOIN OMRC T1 ON T0.FirmCode = T1.FirmCode
    INNER JOIN OITB T2 ON T0.ItmsGrpCod = T2.ItmsGrpCod
    WHERE T0.ItemCode Like '[%0\]%'
    Thanks,
    Gordon

  • Running JAXB2 in a 10g Database

    Hi All,
    We have some java business logic which uses JAXB2. We now would like to be able to call / store this java code inside the database. It's a 10g database, which I understand has the 1.4 JVM, so I've retrotranslated the code (and the JAXB2 dependencies) and created a compatible jar. The loadjava command^1^ completes successfully, however when I try and execute the code which unmarshals the XML, I get the following error: Caused by: java.lang.RuntimeException: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found
    The ContextFactory is definitely in the jar file. Looking through the generated DB trace file I see the following:
    creating : class com/sun/xml/bind/v2/ContextFactory with resolver ((* london) (* PUBLIC) (org/apache/* -) (jp/gr/xml/relax/* -) (com/bea/* -) (javax/management/* -) (com/thoughtworks/xstream/* -) (org/jvnet/* -) (com/sun/xml/fastinfoset/* -) (sun/misc/* -))
    but then, instead of resolving the class:
    skipping : class com/sun/xml/bind/v2/ContextFactory
    Why would the ContextFactory be skipped? Is there any way I can force the loadjava command to resolve it?
    1. The server-side loadJava command I use is: call sys.dbms_java.loadjava( '-force -verbose -resolve /scripts/p3/db_sql/cta23001.jar','((* london) (* PUBLIC) (org/apache/* -) (jp/gr/xml/relax/* -) (com/bea/* -) (javax/management/* -) (com/thoughtworks/xstream/* -) (org/jvnet/* -) (com/sun/xml/fastinfoset/* -) (sun/misc/* -))' );

    Hi:
    You can find Jaxb related classes implemented by Oracle into ${ORACLE_HOME}/lib/xml.jar but not all classes should be installed, please look at Ant task named unpack-jaxb-classes at:
    [http://dbprism.cvs.sourceforge.net/viewvc/dbprism/cms-2.1/tasks/cms.xml?revision=1.19&view=markup]
    this Ant task extract all Jaxb required classes which can be installed into an Oracle 10g/11g database, see the Task pre-install which install this jar into SYS's schema.
    To see how to use Jaxb marshall/unmarshall operation please take a look at the method processRequestAction, inside the code you can see how to instantiate the marshaller and unmarshaller:
    [http://dbprism.cvs.sourceforge.net/viewvc/dbprism/cms-2.1/src/com/prism/cms/action/Controller.java?revision=1.8&view=markup]
    Best regards, Marcelo.

  • How do you query Oracle RDF database using Java program?

    Does anyone know how to get data out of the oracle RDF database using Java?
    I'm running the following java code and it returns basically null values. My guess is that the get_triple() function returns a dataset other than resultset. I've tried searching the Oracle web site. Am I supposed to be using CLOB object? Any help would be appreciated. Thanks
    sql = "SELECT a.triple.GET_TRIPLE() AS triple FROM family_rdf_data a";
    ResultSet rs = stmt.executeQuery( sql ) ;
    while ( rs.next() )
    System.out.println( rs.getString(1) ) ;
    rs.close() ;

    get_triple() returns an object, and the code would be different from the code of retrieving a string. Some sample code for retrieving objects is at http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.html
    get_subject(), get_property() return strings so the code below should work. get_object() returns a CLOB so different handling would be required and there is some sample code at the link above.
    Melli

  • I am trying to run windows on a MacBook Pro using bootcamp.

    Can anyone help? I am trying to run windows 7 on my MacBook Pro, 17 inch late 2011,
    Mac OS X Lion 10.7.5
    Intel HD Graphics 3000 384 MB
    This what I've done
    I used disk utility to format a 8g flash drive in MS-DOS (FAT) format. Then I went on the microsoft site and made sure I was downloading the correct system for my Mac, using the correct bootcamp (4). I went with the 32 bit. I then purchased the full .iso windows 7 32 bit. I downloaded it and saved it to the previous flash drive. I went into bootcamp and downloaded the support software to the same USB flash drive. Then I ticked the box in bootcamp that says install windows 7, i partitioned the hard drive 40G windows and click install. The error message is that the disk can't be found. ok, not using a disk, but when I go back into my USB flash drive it says bootable :no. I hope this all makes sense to someone and you can help.
    How can I make this USB bootable so bootcamp can install it? Where did I go wrong? Please be very step by step as I'm new at this.

    The Boot Camp instructions are located here: http://www.apple.com/support/bootcamp/
    The Boot Camp Discussion Community is located here: https://discussions.apple.com/community/windows_software/boot_camp

  • Cloning a 10g Database using DBCA and templates

    I have created a template from a 10G database (structure and data) and want to use this template and data to create a clone of the database on another server using the DBCA on the standby server. Where does DBCA ask for the names of the templates of my clone database? It seems to only have templates for its pre-existing databases (wharehouse, general purpose, custom, etc.).

    Thanks. I figured this out on my own and seems work fine. My problem is I am connected over a Window network domain and the transfer speed is very slow. I finally had to kill the job and manually move the critical control, init, redo, and data files that DBCA missed. I also had to use the DBCA again to create the EM DBconsole server as well as copy over the, initPROD.ora file as well as the tnsnames.ora, listener.ora and sqlnet.ora files over to the $ORACLE_HOME/Network/Admin directory. SPFILE was create using create spfile command, I had to perform a recover database once in the initial startup of the database clone.
    If I do this operation again I will move datafiles and DBCA template components from the server to a USB SCCI Drive connected locally to the source server then connect this remote disk to the target server rather than transfer files over a domain network.
    Any other tips that anyone can over on cloning a database using DBCA in 10G please let me know any things to avoid, traps, bugs, best practices would be greatly appreciated.
    RR.

  • Running a query On OIM Database inside an adapter task

    Hi,
    How can I run a SQL query to get some value from OIM database table inside an adapter task? How do I get Db connection without using JDBC API inside adapter task?
    Thanks in advance

    create a variable in the adapter factory of type object , map to adapter references- > qualifier database reference.
    you can then use this variable, in your method signature where it requires a database instance. using this database instance you can run sql queries.
    if you need to run a stored procedure, then simply create an adapter -> Fucntional Task-> Stored procedure.

  • How many sessions can run simultaneously in oracle 10g database

    Dear Experts,
    Please tell me .
    Thanks

    Going into further details, if you are asking about number of concurrent sessions >that can access a block then it is defined by the INITRANS and MAXTRANS >parameters for the segment (which defaults to 2 for table segment, 1 for index >segment). There is more to say about that ITL slots: for Oracle 9i at least there can only be a maximum of 255 ITL slots whatever the data block size: for small block size, the maximum of ITL slots is about 50% of the data block size and and can be lower than 255.
    See Metalink note:
    Subject: INITRANS relationship with DB_BLOCK_SIZE.
    Doc ID: Note:151473.1 Type: BULLETIN
    Last Revision Date: 27-SEP-2006 Status: PUBLISHED
    I don't know if this is still valid for Oracle 10g.

  • Querying an Oracle Database Using XSL

    I know from years of experience as an Oracle DBA that to suggest that a program generate SQL is anathema, but I'm going to ask anyway!
    Is there currently (or soon) to be a means of submitting XSL (or, perhaps, some variant based on the most recently published "standard") to an Oracle database and receiving an XML result set?
    Note that I have not mentioned writing any SQL myself. I'm either looking for some middleware to translate the XSL "query" into the appropriate SQL query (with appropriate after-query transformations) or for the database engine itself to be able to parse and optimize XSL.
    I just read a position paper (dated 1998) on this site that says that Oracle intends to closely follow developments in the world of XML Query. And, I've read in a "Byte" article ("Where Are The XML Apps We Can See And Touch? Report From XML DevCon 2001", April 2001, Jon Udell) that Steve Muench had demonstrated some means of super-imposing an XML schema over top of a database in order to query it via XPath. Where does the product stand in regards to this type of functionality?
    Thanks in advance,
    David Park
    [email protected]

    For your reference:
    1/XML SQL Utility(XSU) in XDK for Java (also with PL/SQL API)
    http://technet.oracle.com/tech/xml/xdk_java
    - The XSU can transform data retreived from object-relational database tables or views into XML.
    - The XSU can extract data from a XML document and using a canonical mapping, insert the data into the appropriate columns/attributes of a table or a view.
    - The XSU can extract data from a XML document and apply this data to updating or deleteing values of the appropriate columns/attributes.
    2/ The documents for XMLType and DBUri(available in Oracle9i).
    http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/appdev.901/a88894/adx05xml.htm#1012692
    3/ Oracle Text also have XPATH-based search.
    http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/text.901/a90122/csectio4.htm#33034

  • Problem querying an Oracle Database using PHP

    Hi there, im rather new to Oracle so pardon my ignorance if this is completely obvious but I am creating a web form that queries an oracle database, firstly is a user form which looks like this.
    <br><br>
    Search for Investments<br>
    <form action="query.php" method="POST"><br>
    <input type = "text" name = "invest"><br>
    <input type="submit" value="Search" name="submit" /><br>
    </form><br>
    -----------------------<br><br>
    and the php script which looks like this<br><br>
    -----------------------<br><br>
    <?php<br><
    print "<HTML><PRE>";<br><br>
    require_once('connect.php');<br>
    select_data($conn);<br><br>
    $invest = $_POST['invest'];<br>
    echo "Returning results related to $invest";<br><br>
    function select_data($conn)<br>
    { $stmt = ociparse($conn,"select * from investmentbase where INVTYPE='$invest'");<br>
    ociexecute($stmt,OCI_DEFAULT);<br><br>
    echo "<table border = 1 class=results>";<br><br>
    echo "<tr>";<br>
    echo "<td>Reference Number</td>";<br>
    echo "<td>User ID</td>";<br>
    echo "<td>Investment Type</td>";<br>
    echo "<td>Investment Description</td>";<br>
    echo "<td>Amount Required</td>";<br>
    echo "<td>Due Date<td>";<br>
    echo "</tr>";<br><br>
    while (ocifetch($stmt)){<br>
    echo "<tr>";<br>
    echo "<td>";<br>
    echo ociresult($stmt,"INVREF")." ";<br>
    echo "</td>";<br>
    echo "<td>";<br>
    echo ociresult($stmt,"USERID")." ";<br>
    echo "</td>";<br>
    echo "<td>";<br>
    echo ociresult($stmt,"INVTYPE")." ";<br>
    echo "</td>";<br>
    echo "<td>";<br>
    echo ociresult($stmt,"INVDESCRIPTION")." ";<br>
    echo "</td>";<br>
    echo "<td>";<br>
    echo ociresult($stmt,"AMOUNTREQUIRED")." ";<br>
    echo "</td>";<br>
    echo "<td>";<br>
    echo ociresult($stmt,"REQUIREDATE");<br>
    echo "</td>";<br>
    echo "</tr>";<br><br>
    }<br>
    echo "</table>";<br>
    }<br><br>
    ocilogoff($conn);<br>
    print "</PRE></HTML>";<br>
    ?> <br><br>
    When i search for a value that is in the database no results are returned, however the form is definitely posting the variable as the echo statement on the PHP script displays it. Any ideas would be gratefully appreciated
    Many Thanks
    Paul

    Do you need to set $invest before calling do_select() and pass it as a
    parameter? Also, watch out for SQL Injection security risks. Try
    using a bind variable.
    $invest = $_POST['invest'];
    echo "Returning results related to $invest";
    select_data($conn, $invest);
    function select_data($conn, $invest)
      $stmt = ociparse($conn,"select * from investmentbase where INVTYPE=:ibv");
      ocibindbyname($stmt, ':ibv', $invest);
      ociexecute($stmt,OCI_DEFAULT);
      . . .Although the PHP 4 naming style for oci8 functions can be used with
    PHP 5, I know there is a possibility you are using the PHP 4 OCI8
    extension. If you are, then upgrade at least OCI8. There are some
    notes on this in
    Re: frustrations with oci_fetch_array()
    -- cj

  • Unable to connect to 10g database using Devloper 6i and SQLPLUS 8

    Dear all Developers,
    I have installed 10g with patch 10.2.0.3 and developer 6i, i am not able to access the database with Forms Devloper 6i, Report Devloper 6i and SQLPLUS 8 (installed by default with DS) when i try to initiate connection the sessions crashes. (DB character set AL32UTF8)
    Please note we already have ORACLE RAC 10g version 10.2.0.3 (DB character set AR8MSWIN1256) developer can connect to this db with no errors
    Please suggest how i can solve this problem
    Thanks
    Zeeshan Sheikh

    First of all you need to be on Patch set 18 of Oracle Forms 6i -- but I think you will still have problems with the character set you are using... but you'll need to search out details.

  • Significant difference in response times for same query running on Windows client vs database server

    I have a query which is taking a long time to return the results using the Oracle client.
    When I run this query on our database server (Unix/Solaris) it completes in 80 seconds.
    When I run the same query on a Windows client it completes in 47 minutes.
    Ideally I would like to get a response time equivalent on the Windows client to what I get when running this on the database server.
    In both cases the query plans are the same.
    The query and plan is shown below :
    {code}
    SQL> explain plan
      2  set statement_id = 'SLOW'
      3  for
      4  SELECT DISTINCT /*+ FIRST_ROWS(503) */ objecttype.id_object
      5  FROM documents objecttype WHERE objecttype.id_type_definition = 'duotA9'
      6  ;
    Explained.
    SQL> select * from table(dbms_xplan.display('PLAN_TABLE','SLOW','TYPICAL'));
    PLAN_TABLE_OUTPUT
    | Id  | Operation          | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)|
    |   0 | SELECT STATEMENT   |           |  2852K|    46M|       | 69851   (1)|
    |   1 |  HASH UNIQUE       |           |  2852K|    46M|   153M| 69851   (1)|
    |*  2 |   TABLE ACCESS FULL| DOCUMENTS |  2852K|    46M|       | 54063   (1)|
    {code}
    Are there are configuration changes that can be done on the Oracle client or database to improve the response times for the query when it is running from the client?
    The version on the database server is 10.2.0.1.0
    The version of the oracle client is also 10.2.0.1.0
    I am happy to provide any further information if required.
    Thank you in advance.

    I have a query which is taking a long time to return the results using the Oracle client.
    When I run this query on our database server (Unix/Solaris) it completes in 80 seconds.
    When I run the same query on a Windows client it completes in 47 minutes.
    There are NO queries that 'run' on a client. Queries ALWAYS run within the database server.
    A client can choose when to FETCH query results. In sql developer (or toad) I can choose to get 10 rows at a time. Until I choose to get the next set of 10 rows NO rows will be returned from the server to the client; That query might NEVER complete.
    You may get the same results depending on the client you are using. Post your question in a forum for whatever client you are using.

Maybe you are looking for