SQL problem - help needed ASAP!!

Hey guys,
Doing a college project... would really appreciate some help. I am trying to use a variable in the where clause of a select cursor in PL/SQL. The code is this:
procedure results(p_search_entry varchar2, p_search_field varchar2) is
cursor c_results is
select * from physics_b where p_search_field = p_search_entry;
begin
for cv_results in c_results
loop
-- loop through actions
end loop;
The problem is that I don't know how to get the where clause to accept the variable passed into the procedure as the field name. Does anyone know the syntax for this?
Thanks very much!
Niall

This isn't the correct forum for this kind of question. The SQL and PL/SQL forum PL/SQL is probably best.
That said, you can't do what you want that way.
You can do
procedure results (p_search_entry in varchar2)
cursor c_result is
select * fro physics_b where subject=p_search_entry;(assuming subject is a column in physics_b)
You can't use a variable to represent a column directly. You need to build the statement as a string and then use execute immediate.
statement:='select * fro physics_b where '||p_search_field||' = :1';
-- this bit is probably bad syntax.
execute immediate statement using p_search_entry;Look up execute immediate and bind variables

Similar Messages

  • 9i Developer suite login problem. help needed ASAP

    i installed oracle 9i developer suite, my problem is i can't login. this is the error ora12560: TNS: oracle adapter error.
    or
    if i put the hostname it displays a no listener error and closes. i tried to create a listener in net configuration assistant, but i can't see it in services.
    i'm using windows XP. and not conneted to any machine.
    do i need any changes on my window settings?
    please help...
    thanks
    here is my listener.ora
    ABC =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\OraHome)
    (PROGRAM = extproc)
    tnsnames.ora
    TEST.ABC =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ABC)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = test.ABC)
    ORACLE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = oracle)

    check your operating system network protocole is TCP/IP is installed if so check is there any problem with these protocoles. this error is encounter generally due operating system network protocoles it is not an oracle error. here is discription.
    TNS-12560 TNS:protocol adapter error
    Cause: A generic protocol adapter error occurred.
    Action: Check addresses used for proper protocol specification. Before reporting this error, look at the error stack and check for lower level transport errors.For further details, turn on tracing and re-execute the operation. Turn off tracing when the operation is complete.

  • Error messages help need asap!!!!

    hi this is my code and I need help with what i need to do and how to do it to get rid of the error messages
    CREATE OR REPLACE FUNCTION
    no_of_task_types (x NUMBER)
    RETURN NUMBER IS
    my_val NUMBER;
    BEGIN
    SELECT COUNT(distinct t.task_type_no)
    INTO my_val
    FROM employee e, assignment a, task t
    WHERE e.employee_id = x
    AND e.employee_no = a.employee_no
    AND t.task_id = a.task_id
    RETURN tasktotal;
    END;
    SHOW ERRORS
    these are the error messages:
    Warning: Function created with compilation errors.
    Errors for FUNCTION NO_OF_TASK_TYPES:
    8/1     PL/SQL: SQL Statement ignored
    13/27     PL/SQL: ORA-00933: SQL command not properly ended

    Hi,
    Welcome to the forum!
    Don't say things like "urgent" or "asap" (as in your title, "error messages help need asap!!!!"). It's rude.
    971848 wrote:
    hi this is my code and I need help with what i need to do and how to do it to get rid of the error messages
    CREATE OR REPLACE FUNCTION
    no_of_task_types (x NUMBER)
    RETURN NUMBER IS
    my_val NUMBER;
    BEGIN
    SELECT COUNT(distinct t.task_type_no)
    INTO my_val
    FROM employee e, assignment a, task t
    WHERE e.employee_id = x
    AND e.employee_no = a.employee_no
    AND t.task_id = a.task_id
    RETURN tasktotal;
    END;
    SHOW ERRORS
    these are the error messages:
    Warning: Function created with compilation errors.
    Errors for FUNCTION NO_OF_TASK_TYPES:
    8/1     PL/SQL: SQL Statement ignored
    13/27     PL/SQL: ORA-00933: SQL command not properly endedIt looks like you're missing a semicolon at the end of line 13; that's why the statement beginning at line 8 can't be understood.
    Also, you store a number in my_val, but never use that number, and you have a variable called tasktotal that's never defined. Should my_val and tasktotal be the same variable?
    Perhaps this is what you want:
    CREATE OR REPLACE FUNCTION
           no_of_task_types (x NUMBER)
    RETURN NUMBER IS
        tasktotal   NUMBER;
    BEGIN
        SELECT  COUNT(distinct t.task_type_no)
        INTO    tasktotal
        FROM    employee e, assignment a, task t
        WHERE   e.employee_id = x
        AND     e.employee_no = a.employee_no
        AND     t.task_id        = a.task_id;          -- ; at end is important
        RETURN tasktotal;
    END;
    /This question doesn't have anything to do with SQL*Plus, so maybe the SQL*Plus forum isn't the best place for it. This is strictly a PL/SQL problem; in the future, post questions like this in the PL/SQL. The FAQ page for that forum, {message:id=9360002} , can really help you.

  • Help needed asap! Will my IPAD 3G wifi work in another country with the sim of a 3G services provider?

    Help needed asap! I want to buy an IPAD 3G + Wifi before I return to my country from the US. The problem is that I have GSM service providers in my country that provide 3G services but I am wondering if their SIM card would work in the IPAD? In other words, can I get an unlocked IPAD 3G wifi? Thanks for helping out

    The AT&T 3G iPads (which are GSM/sim based) in the US are not locked (the Verizon models are CDMA based so they effectively are). So as long as you can get a sim in your own country you shouldn't have a problem

  • SQL Server2008 help needed

    Having trouble with SQLServer 2008 (not MySQL) and my database connection in Dreamweaver CS6.  My document type is set as .asp using VBScript.  I can list the table information  but cannot use the insert wizard to add new records.  I don't get any errors after creating the insert form, but no records get inserted.  I'm not a VBScript expert, but do I have to manually write some code to insert records?  How do I attach it to a button?

    Thanks for the quick reply.  I won't be back in the office for a few days, but I'll try to post it when I get back in.  It's pretty much the code generated from the Dreamweaver Insert Record wizard.  I see where the submit button is created and the value is set but the action on the form is set to MM_insert, so I don't see where the submit code is actually called.
    Date: Wed, 3 Oct 2012 12:06:14 -0600
    From: [email protected]
    To: [email protected]
    Subject: SQL Server2008 help needed
        Re: SQL Server2008 help needed
        created by bregent in Dreamweaver General - View the full discussion
    This post should be moved to the app dev forum.  Please post the code from your form and the insert script pages.
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4746757#4746757
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4746757#4746757
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4746757#4746757. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Dreamweaver General by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Blackberry Storm Problems..​.Help Needed ASAP

    Soooo...for some strange reason i bought a BB Storm : /  when i got it (yesterday), i charged it and it charged up fine. but the battery ran down rather quickly. So i am now tryin 2 charge it up again and it is not giving one bit of charge. i just left it for 3 hours and came back to check it and it went dead...i did a battery pull twice and still nothing. what is my next move???

    Hi and Welcome to the Community!
    Please try this sequence...note that, throughout the entire 4h15m process, your BB must remain connected to a known-good wall charger (not PC USB):
    With the battery inside, connect your BB to the wall charger
    Leave it alone for 2 hours, no matter what the LED or the display does
    Remove the battery
    Wait 15 minutes
    Insert the battery
    Wait another 2 hours, no matter what the LED or the display does
    This has been known to "kick start" some BBs.
    It is also possible that your battery or BB has experienced a problem...to test, this sequence is needed:
    Obtain a known good and already fully charged additional battery...use it in your BB and see what happens
    Obtain access to a known good and identical BB...use your battery in it and see what happens
    The results of this will indicate if it's your BB or your battery that has the problem.
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • CE505 boot problem. Help needed, ASAP

    One day old (still rocks! :)) working CE-505 stop booting with:
    --- boot msg ---
    Press any key to stop auto-boot...
    0
    auto-booting...
    boot device (flash,net) [ net]:
    file name [ ce505-cache-231.bin]:
    cache IP address [ 192.168.0.99]:
    IP network mask [ 255.255.255.0]:
    server IP address [ 192.168.0.10]:
    protocol (rcp,ftp,tftp) [ tftp]:
    flags [ 0]:
    Loading from the network
    Attaching network interface fei0... done.
    Attaching network interface lo0... done.
    Loading... Starting at 0x108000...
    #!ImageInfo
    # +--------------------+
    # | CISCO CE image |
    # +--------------------+
    SUPPORTED_PRODUCTS=CE505,CE550
    UNCOMPRESSED_CKSUM=0xf17c87d3
    UNCOMPRESSED_SIZE=0x3578b8
    COMPRESSED_CKSUM=0xd6ab0b3
    COMPRESSED_SIZE=0x167cdb
    This image supports models CE505,CE550 and this appliance is a 00000.
    Press any key to stop auto-boot...
    --- boot msg ---
    And start timer again :( I tryed booting from network because flash boot fails similar above. I see IOS booting message and then boot counter again :(
    Can any one help me with this issue?
    P.S. Sorry for my english.

    It's me again with another CE 505. I van't understand what happens, but one day flash boot fail and i try to boot from network:
    auto-booting...
    boot device (flash,net) [ net]:
    file name [ ce505-cache-251.bin]:
    cache IP address [ 10.10.10.120]:
    IP network mask [ 255.255.255.0]:
    server IP address [ 10.10.10.10]:
    protocol (rcp,ftp,tftp) [ tftp]:
    flags [ 0]:
    Loading from the network
    Attaching network interface fei0... done.
    Attaching network interface lo0... done.
    Loading... image read failed: Image is not for x86 CPU: errno=0x16
    Error loading file: errno = 0x31.
    Can't load boot file!!
    Why CE can't boot? I downloaded image from anothe working CE
    Thank you.

  • HELP Needed ASAP! Curve Not Turning On, Red Flashing Lights!

    Hi,
    I have a Blackberry curve 8310. I plugged my curve into my mac to do a software update. Midway through, my phone shut off and hasn't worked since. The battery is fully charged. The phone is off and won't turn on. Additionally, there is a red LED light blinking twice every few seconds. I think I found an article on blackberry.com's knowledge database that diagnosed my issue, but my problem now is that because the curve isn't turning on/off, it's not connecting to my mac's desktop manager. So I can't do anything the article tells me to do. What should I do now? I need help ASAP!
    Here's the link to the article: http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB19915
    Thanks in advanced!

    Hello Asmro and welcome to the BlackBerry Support Community Forums.
    It can take up to 30 minutes for the Mac to connect to the BlackBerry.
    I would remove your battery and connect to the BlackBerry Desktop Manager. Once it comes up there is no software installed, re-insert the battery and follow the article KB19915.
    Let me know how you make out.
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • SQL Syntax - help needed

    Guys,
    Help me understand the syntax please!! With PL/SQL I have achieved a task quite easily, with a branch of code to include or exclude some part of the query - no problem. But to use SQL ......
    If i have a variable on a page, say :p10_open_or_closed
    .. and I set the value of this to the text "Is Not Null"
    How can I incorporate this into an SQL query, say
    Select ID, Date1, Date2, Comment
    From Table1
    where Date1 Is Not Null
    Is there a way of substituting the ":p10_open_or_closed" variable into this query?
    ie
    Select ID, Date1, Date2, Comment
    From Table1
    where Date1 ":p10_open_or_closed"
    Thanks.

    Thanks for your help gents.
    Originally, I had a PL/SQL Statement constructing the code as needed, as Rekha
    suggested.
    if :P1_OPEN_OR_CLOSED = 1 then
    q:=q||' and ';
    q:=q||' p.ACTUAL_INSTALL_DATE is null ';
    end if;
    if :P1_OPEN_OR_CLOSED = 2 then
    q:=q||' and ';
    q:=q||' p.ACTUAL_INSTALL_DATE is not null ';
    end if;
    But, to use a Tabular form, where users can update fields of multiple records on screen then submit for a MRU, the option of PL/SQL code is not allowed, only SQL. So Phil UK, no it's not an elegant way of doing things, but I'm forced to use SQL, yeah?
    There are definitely ways that I can filter for the solution I am after, but they all involve more in depth solutions (that are not that great). Thus, I asked at this forum.
    Andy, your solution works :~) which makes me very happy. I'm not sure how just now but I'll learn from it.
    Thanks again.

  • SQL Query Help Needed

    I'm having trouble with an SQL query. I've created a simple logon page wherein a user will enter their user name and password. The program will look in an Access database for the user name, sort it by Date/Time modified, and check to see if their password matches the most recent password. Unfortunately, the query returns no results. I'm absolutely certain that I'm doing the query correctly (I've imported it directly from my old VB6 code). Something simple is eluding me. Any help would be appreciated.
    private void LogOn() {
    //make sure that the user name/password is valid, then load the main menu
    try {
    //open the database connection
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:LawOffice2000", "", "");
    Statement select = con.createStatement();
    String strTemp = "Select * From EMPLOYEES Where INITIALS = '" + txtUserName.getText() + "' Order By DATE Desc, TIME Desc";
    ResultSet result = select.executeQuery(strTemp);
    while(result.next()) {
    if (txtPassword.getPassword().toString() == result.getString("Password")) {
    MenuMain.main();
    else {
    System.out.println("Password Bad");
    System.out.println(txtUserName.getText());
    System.out.println(result.getString("Password"));
    break; //exit loop
    //close the connection
    con.close(); }
    catch (Exception e) {
    System.out.println("LawOfficeSuite_LogOn: " + e);
    return; }
    }

    The problem is here: "txtPassword.getPassword().toString() == result.getString("Password"))"
    Don't confuse String's equals() method with the equality operator '=='. The == operator checks that two references refer to the same object. If you want to compare the contents of Strings (whether two strings contain the same characters), use equals(), e.g. if (str1.equals(str2))...
    Example:String s1 = "foo";
    String s2 = new String("foo");
    System.out.println("s1 == s2: " + (s1 == s2)); // false
    System.out.println("s1.equals(s2): " + (s1.equals(s2))); // trueFor more information, check out Comparison operators: equals() versus ==

  • SQL Report help needed

    Hi All,
    I am creating a report which is having 2 sql queries ,1 for the main columns that i need to show and 2 from total sum and count.
    Report is something as given below
    SET TAB OFF;
    set linesize 1500;
    set pagesize 50;
    SET FEEDBACK OFF;
    SET WRAP OFF
    COLUMN today NEW_VALUE VAR1 NOPRINT;
    TTITLE LEFT 'ABC Inc.' SKIP 1 -
    LEFT 'Daily Report' SKIP 1 -
    LEFT 'As Of ' VAR1 SKIP 2
    BTITLE LEFT SKIP 'Page No : ' FORMAT 9999999999 SQL.PNO SKIP 3;
    COL SR_NO HEADING 'Seq'               FORMAT 999999;
    COL REFNO HEADING 'Ref No'                FORMAT A20;
    COL ORIG_NAME HEADING ' Branch Name'      
         FORMAT A50;
    SELECT      ROWNUM                SR_NO,
         REF_NO                REFNO,
         ORIGIN_NAME               BRNAME
    FROM BANK
    WHERE PASS_CD=101
    SELECT      ' Failure Count : '|| NVL(COUNT(DECODE(CODE,1,CODE,NULL)),0) ||
         ' Failure Total Amt : '|| NVL(SUM(DECODE(CODE,799,AMT,NULL)),0)
         || CHR(10) ||     
         ' Successful Count : '|| NVL(COUNT(DECODE(CODE,000,CODE,NULL)),0) ||
    ' Successful Total Amt: '|| NVL(SUM(DECODE(CODE,000,AMT,NULL)),0)
    FROM BANK;
    CLEAR BREAKS;
    CLEAR COLUMN;
    TTITLE OFF;
    When i am running this second query output is going to secong page and title is repeated again and same as 1rst page is showing page no-1
    Kindly help me,i want the output on the same page at bottom.
    Thanks

    i think its only work in ISQL* PLUS enivironment iam
    not sure.It does work in SQL*Plus
    is that i can use in the package??http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12048.htm

  • Oracle Forms - need to update multi-record block - Help needed asap

    Hi,
    We are using Oracle apps release 11i - Oracle forms 6i.
    I have a field "project_start_date" in project_block in a custom form. There is another multi-record block called role_block in the same custom form and it has a field named start_date. Requirement is when ever I make change in the project_start_date in project_block, that should reflect in role_block.start_date. I tried different means and could update only the very first record of the multi-record block - role_block. I need to update all the records in the role_block with the same project_start_date. Used looping and several other methods. But could not achieve. Any help is really appreciated.
    Thanks
    Akil

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Application Development in PL/SQL » Forms which you can get more quick response
    Regard
    Helios

  • Pagination problem, help needed to finish it

    Hi friends,
    I am in need to use pagination in my Web Application, since i have a tons of values to display as a report. I develop a pagination logic, tested it seperately and it works fine.When i try to implement it to current project it works, but no result was displayed as it displayed in testing..
    Here is the file i tested seperately..
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page import="com.rajk.javacode.servlets.dbmodel"%>
    <%
    int count=0;
    int userid = 0;
    String g = null;
    dbmodel db=new dbmodel();
    Statement ps = null;
    ResultSet rs = null;
    db.connect();
    String SQL = "select * from tbl_rmadetails";
    ps=db.con.createStatement();
    rs=ps.executeQuery(SQL);
    rs.last();
    count= rs.getRow();
    rs.beforeFirst();
    int currentrs;
    int pagecount=(count/2);
    if((pagecount*2)+1>=count)
    pagecount++;
    out.println("<table width=363 height=20 align=center border=0 cellpadding=0 cellspacing=0><tr><td>");
    for(int i=1;i<pagecount;i++)
    out.println("<font face=verdana size=1><a href=pagination.jsp?pagenum="+ i +"&userid="+ userid +">["+ i +"]</a></font>");
    String pagenum=request.getParameter("pagenum");
    if(pagenum==null)
    out.println("<br><strong><font face=verdana size=1 color=white>Page 1 of " + (pagecount-1) +"</font></strong>");
    currentrs=0;
    else
    out.println("<br><strong><font face=verdana size=1 color=white>Page " + pagenum + " of " + (pagecount-1) + "</font></strong>");
    pagecount=Integer.parseInt(pagenum);
    currentrs=(2*(pagecount-1));
    out.println("</td></tr></table>");
    //messageboard
    String sql="select * from tbl_rmadetails order by date LIMIT " + currentrs + ",2";
    rs=ps.executeQuery(sql);
    while(rs.next())
    %>
    <br>
    <table width="363" height="64" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    <tr>
    </td>
    <td width="126" height="19" align="center" valign="top"><font face="verdana" size="1"><strong><%=rs.getString("serial_no")%></strong></font></td>
    <td width="126" height="19" align="center" valign="top"><font face="verdana" size="1"><strong><%=rs.getString("status")%></strong></font></td>
    </tr>
    </table></td>
    </tr>
    </table>
    <%
    rs.close();
    %> And here is the file in which i want to implement the pagination..
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page import="com.rajk.javacode.servlets.dbmodel"%>
    <%
    int x1=0;
    int userid = 0;
    int count = 0;
    String raj=request.getParameter("q");
    String temp=null;
    String SQL = null;
    String SQLX = null;
    int currentrs;
    try
    dbmodel db=new dbmodel();
    Statement ps = null;
    ResultSet rs = null;
    db.connect();
    if(raj.equals("All Vendor"))
    SQL = "SELECT * FROM tbl_rmadetails,tbl_customer,tbl_item,tbl_vendor WHERE tbl_rmadetails.customer_id=tbl_customer.customer_id AND tbl_rmadetails.item_id=tbl_item.item_id AND tbl_rmadetails.vendor_id=tbl_vendor.vendor_id AND tbl_rmadetails.status='STS'";
    else
    SQL = "SELECT * FROM tbl_rmadetails,tbl_customer,tbl_item,tbl_vendor WHERE tbl_rmadetails.customer_id=tbl_customer.customer_id AND tbl_rmadetails.item_id=tbl_item.item_id AND tbl_rmadetails.status='STS' AND tbl_rmadetails.vendor_id=tbl_vendor.vendor_id AND tbl_rmadetails.vendor_id='"+raj+"'";
    ps=db.con.createStatement();
    rs=ps.executeQuery(SQL);
    rs.last();
    count= rs.getRow();
    rs.beforeFirst();
    rs.close();
    int pagecount=(count/6)+1;
    if((pagecount*6)+1>=count)
      pagecount++;
    //out.print(count);
    %>
    <%
    for(int i=1;i<pagecount;i++)
    out.println("<font face=verdana size=1><a href=http://localhost:8080/rmanew/sendtovendor.jsp?pagenum="+ i +"&userid="+ userid +">["+ i +"]</a></font>");
    String pagenum=request.getParameter("pagenum");
    if(pagenum==null)
    out.println("<br><strong><font face=verdana size=1 color=white>Page 1 of " + (pagecount-1) +"</font></strong>");
    currentrs=0;
    else
    out.println("<br><strong><font face=verdana size=1 color=white>Page " + pagenum + " of " + (pagecount-1) + "</font></strong>");
    pagecount=Integer.parseInt(pagenum);
    currentrs=(6*(pagecount-1));
    if(raj.equals("All Vendor"))
    SQLX = "SELECT * FROM tbl_rmadetails,tbl_customer,tbl_item,tbl_vendor WHERE tbl_rmadetails.customer_id=tbl_customer.customer_id AND tbl_rmadetails.item_id=tbl_item.item_id AND tbl_rmadetails.vendor_id=tbl_vendor.vendor_id AND tbl_rmadetails.status='STS' LIMIT"+currentrs+",6";
    else
    SQLX = "SELECT * FROM tbl_rmadetails,tbl_customer,tbl_item,tbl_vendor WHERE tbl_rmadetails.customer_id=tbl_customer.customer_id AND tbl_rmadetails.item_id=tbl_item.item_id AND tbl_rmadetails.status='STS' AND tbl_rmadetails.vendor_id=tbl_vendor.vendor_id AND tbl_rmadetails.vendor_id='"+raj+"' LIMIT"+currentrs+",6";
    rs=ps.executeQuery(SQLX);
    if(rs!=null)
    while(rs.next())
    %>
    <link rel="stylesheet" type="text/css" href="chromejs/stvcss.css" />
    <table width="100%" border="0">
    <tr bgcolor="#0066CC">
    <td align="center"><span class="style2">Date</span></td>
    <td align="center" class="style2">Product Details</td>
    <td align="center" class="style2">Serial No</td>
    <td align="center" class="style2">Fault Desc</td>
    <td align="center" class="style2">Customer Name</td>
    <td align="center" class="style2">Vendor Name</td>
    <tr>
    <tr bgcolor="#CCCCCC">
    <td align="center"><%=rs.getDate("date")%></td>
    <td align="center"><%=rs.getString("item_description")%></td>
    <td align="center"><%=rs.getString("serial_no")%></td>
    <td align="center"><%=rs.getString("fault_desc")%></td>
    <td align="center"><%=rs.getString("customer_name")%></td>
    <td align="center"><%=rs.getString("vendor_name")%></td>
    </tr>
    </table>
    <%
    else
    out.println("Result Set is empty");
    catch(Exception e)
    System.out.println("Error: " + e);
    response.setContentType("text/xml");
    response.setHeader("Cache-Control", "no-cache");
    %>The output i got when i ran this page is..
    [1]
    And no records displayed matching the query, but there is a lot of datas in DB as a result of the queries i mentioned here..
    Please help me friends...

    Debug your code. Check what happens and what happens not.
    You could make it much easier if you wrote Java code in Java classes rather than JSP files. Now it's one big heap of mingled -and thus hard to maintain/test/reuse- code.

  • Linked lists problem -- help needed

    Hello again. I've got yet another problem in my C++ course that stems from my use of a Mac instead of Windows. I'm going to install Parallels so I can get Windows on my MacBook and install Visual Studio this week so that I don't have to deal with these discrepancies anymore, but in the meanwhile, I'm having a problem here that I don't know how to resolve. To be clear, I've spent a lot of time trying to work this out myself, so I'm not just throwing this up here to have you guys do the work for me -- I'm really stuck here, and am coming here as a last resort, so I'll be very, very appreciative for any help that anyone can offer.
    In my C++ course, we are on a chapter about linked lists, and the professor has given us a template to make the linked lists work. It comes in three files (a header, a source file, and a main source file). I've made some adjustments -- the original files the professor provided brought up 36 errors and a handful of warnings, but I altered the #include directives and got it down to 2 errors. The problematic part of the code (the part that contains the two errors) is in one of the function definitions, print_list(), in the source file. That function definition is shown below, and I've marked the two statements that have the errors using comments that say exactly what the errors say in my Xcode window under those two statements. If you want to see the entire template, I've pasted the full code from all three files at the bottom of this post, but for now, here is the function definition (in the source file) that contains the part of the code with the errors:
    void LinkedList::printlist( )
    // good for only a few nodes in a list
    if(isEmpty() == 1)
    cout << "No nodes to display" << endl;
    return;
    for(CURSOR = FRONT_ptr; CURSOR; CURSOR = CURSOR-> link)
    { cout << setw(8) << CURSOR->name; } cout << endl; // error: 'setw' was not declared in this scope
    for(CURSOR = FRONT_ptr; CURSOR; CURSOR = CURSOR-> link)
    { cout << setw(8) << CURSOR->test_grade; } cout << endl; // error: 'setw' was not declared in this scope
    As you can see, the problem is with the two statements that contain the 'setw' function. Can anyone help me figure out how to get this template working and get by these two errors? I don't know enough about linked lists to know what I can and can't mess with here to get it working. The professor recommended that I try using 'printf' instead of 'cout' for those two statements, but I don't know how to achieve the same effect (how to do whatever 'setw' does) using 'printf'. Can anyone please help me get this template working? Thank you very, very much.
    For reference, here is the full code from all three files that make up the template:
    linkedlist.h (header file):
    #ifndef LINKED_LINKED_H
    #define LINKED_LINKED_H
    struct NODE
    string name;
    int test_grade;
    NODE * link;
    class Linked_List
    public:
    Linked_List();
    void insert(string n, int score);
    void remove(string target);
    void print_list();
    private:
    bool isEmpty();
    NODE *FRONT_ptr, *REAR_ptr, *CURSOR, *INSERT, *PREVIOUS_ptr;
    #endif
    linkedlist.cpp (source file):
    #include <iostream>
    using namespace std;
    #include "linkedlist.h"
    LinkedList::LinkedList()
    FRONT_ptr = NULL;
    REAR_ptr = NULL;
    PREVIOUS_ptr = NULL;
    CURSOR = NULL;
    void Linked_List::insert(string n, int score)
    INSERT = new NODE;
    if(isEmpty()) // first item in List
    // collect information into INSERT NODE
    INSERT-> name = n;
    // must use strcpy to assign strings
    INSERT -> test_grade = score;
    INSERT -> link = NULL;
    FRONT_ptr = INSERT;
    REAR_ptr = INSERT;
    else // else what?? When would this happen??
    // collect information into INSERT NODE
    INSERT-> name = n; // must use strcpy to assign strings
    INSERT -> test_grade = score;
    REAR_ptr -> link = INSERT;
    INSERT -> link = NULL;
    REAR_ptr = INSERT;
    void LinkedList::printlist( )
    // good for only a few nodes in a list
    if(isEmpty() == 1)
    cout << "No nodes to display" << endl;
    return;
    for(CURSOR = FRONT_ptr; CURSOR; CURSOR = CURSOR-> link)
    { cout << setw(8) << CURSOR->name; } cout << endl; // error: 'setw' was not declared in this scope
    for(CURSOR = FRONT_ptr; CURSOR; CURSOR = CURSOR-> link)
    { cout << setw(8) << CURSOR->test_grade; } cout << endl; // error: 'setw' was not declared in this scope
    void Linked_List::remove(string target)
    // 3 possible places that NODES can be removed from in the Linked List
    // FRONT
    // MIDDLE
    // REAR
    // all 3 condition need to be covered and coded
    // use Trasversing to find TARGET
    PREVIOUS_ptr = NULL;
    for(CURSOR = FRONT_ptr; CURSOR; CURSOR = CURSOR-> link)
    if(CURSOR->name == target) // match
    { break; } // function will still continue, CURSOR will
    // mark NODE to be removed
    else
    { PREVIOUS_ptr = CURSOR; } // PREVIOUS marks what NODE CURSOR is marking
    // JUST before CURSOR is about to move to the next NODE
    if(CURSOR == NULL) // never found a match
    { return; }
    else
    // check each condition FRONT, REAR and MIDDLE
    if(CURSOR == FRONT_ptr)
    // TARGET node was the first in the list
    FRONT_ptr = FRONT_ptr -> link; // moves FRONT_ptr up one node
    delete CURSOR; // deletes and return NODE back to free memory!!!
    return;
    }// why no need for PREVIOUS??
    else if (CURSOR == REAR_ptr) // TARGET node was the last in the list
    { // will need PREVIOUS for this one
    PREVIOUS_ptr -> link = NULL; // since this node will become the last in the list
    REAR_ptr = PREVIOUS_ptr; // = REAR_ptr; // moves REAR_ptr into correct position in list
    delete CURSOR; // deletes and return NODE back to free memory!!!
    return;
    else // TARGET node was the middle of the list
    { // will need PREVIOUS also for this one
    PREVIOUS_ptr -> link = CURSOR-> link; // moves PREV nodes' link to point where CURSOR nodes' points
    delete CURSOR; // deletes and return NODE back to free memory!!!
    return;
    bool Linked_List::isEmpty()
    if ((FRONT_ptr == NULL) && (REAR_ptr == NULL))
    { return true; }
    else
    { return false;}
    llmain.cpp (main source file):
    #include <iostream>
    #include <string>
    #include <iomanip>
    using namespace std;
    #include "linkedlist.h"
    int main()
    Linked_List one;
    one.insert("Angela", 261);
    one.insert("Jack", 20);
    one.insert("Peter", 120);
    one.insert("Chris", 270);
    one.print_list();
    one.remove("Jack");
    one.print_list();
    one.remove("Angela");
    one.print_list();
    one.remove("Chris");
    one.print_list();
    return 0;

    setw is the equivalent of the field width value in printf. In your code, the printf version would look like:
    printf("%8s", CURSOR->name.c_str());
    I much prefer printf over any I/O formatting in C++. See the printf man page for more information. I recommend using Bwana: http://www.bruji.com/bwana/
    I do think it is a good idea to verify your code on the platform it will be tested against. That means Visual Studio. However, you don't want to use Visual Studio. As you have found out, it gets people into too many bad habits. Linux is much the same way. Both development platforms are designed to build anything, whether or not it is syntactically correct. Both GNU and Microsoft have a long history of changing the language standards just to suit themselves.
    I don't know what level you are in the class, but I have a few tips for you. I'll phrase them so that they answers are a good exercise for the student
    * Look into const-correctness.
    * You don't need to compare a bool to 1. You can just use bool. Plus, any integer or pointer type has an implicit cast to bool.
    * Don't reuse your CURSOR pointer as a temporary index. Create a new pointer inside the for loop.
    * In C++, a struct is the same thing as a class, with all of its members public by default. You can create constructors and member functions in a struct.
    * Optimize your function arguments. Pass by const reference instead of by copy. You will need to use pass by copy at a later date, but don't worry about that now.
    * Look into initializer lists.
    * In C++ NULL and 0 are always the same.
    * Return the result of an expression instead of true or false. Technically this isn't officially Return Value Optimization, but it is a good habit.
    Of course, get it running first, then make it fancy.

  • Error in Jdeveloper 10g in Remote deployment : Help Needed ASAP

    Hi,
    Am trying to deploy the simple application to remote oracle IAS server from Jdeveloper 10g. It is not allowing me to deploy any application remotely. The deployment log window shows following message:
    Target platform is Oracle9i Application Server (AppServerConnection1).
    Wrote WAR file to C:\jdev10g\jdev\mywork\Business Insight\Project1\deploy\webapp1.war
    Wrote EAR file to C:\jdev10g\jdev\mywork\Business Insight\Project1\deploy\webapp1.ear
    Invoking DCM servlet client...
    C:\jdev10g\jdk\jre\bin\javaw.exe -Djava.protocol.handler.pkgs=HTTPClient -jar C:\jdev10g\jdev\lib\oc4j_remote_deploy.jar http://as18schgefage:1811/Oc4jDcmServletAPI/ ias_admin **** redeploy /home/ias/unified C:\jdev10g\jdev\mywork\Business Insight\Project1\deploy\webapp1.ear webapp1 home
    Initializing log
    Servlet interface for OC4J DCM commands
    Command timeout defined at 600 seconds
    Executing DCM command...
    Executing command redeploy /home/ias/unified C:\jdev10g\jdev\mywork\Business Insight\Project1\deploy\webapp1.ear webapp1 home
    Command = INVALID_COMMAND
    #### Invalid command: redeploy /home/ias/unified C:\jdev10g\jdev\mywork\Business Insight\Project1\deploy\webapp1.ear webapp1 home
    Opening connection to Oc4jDcmServlet
    Setting userName to ias_admin
    Sending command to DCM servlet
    #### Could not send command to Oc4jDcmServlet
    Closing connection to Oc4jDcmServlet
    #### DCM command did not complete successfully (-6)
    #### HTTP return code was -6
    Exit status of DCM servlet client: -6
    Elapsed time for deployment: 4 seconds
    #### Deployment incomplete. #### Mar 16, 2005 9:20:03 AM
    Please help asap.
    Regards,
    Ujwala

    1. Re-test your connection from JDev to AS and it must success.
    I suggest to create a new OC4J instance on AS and fill
    the instance name on the dialog window while
    creating AS Connection on JDev. i.e OC4J instance name (optional)
    2. For JDev 9.0.5.x/10.1.2 using AS 9.0.4,
    don't forget to install ADF Runtime Libraries on AS.
    3. Make sure your AS support JDK/J2SE version as in JDev.
    JDev 10.1.2 need AS to use JDK version 1.4.2_04-b05.
    You can download it from http://java.sun.com/products/archive/j2se/1.4.2_04/index.html
    and install it.
    To cek your ORACLE_HOME/jdk/bin/java -fullversion
    Regs,
    Ferry Situmorang

Maybe you are looking for

  • Org.xml.sax.SAXParseException with XML Report Publish

    Anyone see the following error in XML Report Publisher? This happened after I ran Employee W2 XML Interface and ran XML Report Publisher for the output of the PDF output. --XDOException java.lang.reflect.InvocationTargetException      at sun.reflect.

  • 10.1.3.3.0 cloning issue

    I am trying to clone a 10.1.3.3.0 SOA apps tier, I've run prepare.pl, created a tar file, extracted it on the target node and then run clone.pl but it gets so far then creates hundreds of opmn processes saying: ps -ef | grep opmn "/oracle/product/10.

  • Exception while performing Target Reconciliation

    My target is a CSV file which contains fields for empid (mapped as key field),firstname,lastname,emailid and status (mapped to OIM_OBJECT_STATUS) I can see the reconciliation data in Reconciliation event window in Design console but I am getting the

  • Cannot use adobe flash player

    I have been trying to download adobe flash player. Screen says download was sucessful. When i need flash player to view it says I do not have and gives me another option to download. I use Windows 7 and google. Went thru questionaire and system was f

  • Could someone please help me with itunes update and backing up old ipod?

    Hello, was attempting to back up old ipod touch to laptop (in order to set up new ipod) but message read that cannot connect because it requires itunes version 10.6.3 or later. itunes will not update on laptop. Any ideas? your help would be much appr