<div>hi, i am using the same method what you suggest. While running the program i am getting the following error</div> <div> </div> <div>AttributeError: db_connection instance has no attribute 'paramstyle'</div> <div> </div> <div>Please rectify the error</div> <div> </div> <div>thank you</div> <div>Python Eager<BR><BR><B><I>Andy Todd <andy47@halfcooked.com></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">python eager wrote:<BR>> Hi this my code snippet. This code will not execute. And also this code <BR>> raise error.<BR>> <BR>> DatabaseError: ORA-01036: illegal variable name/number<BR>> <BR>> What is the problem. Please give me a solution. Is there any problem is <BR>> sql statment please give the correct statment, i will apply that statment.<BR>> <BR>> <BR>> _Code Snippet :_<BR>> __ <BR>> *def view_one(self,pid):<BR>> *sql_pStmt = "SELECT
FIRSTNAME,LASTNAME FROM PERSONALDETAILS <BR>> WHERE PID = ?" <BR>> cursor.execute(sql_pStmt,pid)<BR>> <BR>> Thank you<BR>> <BR>> regards<BR>> Python Eager<BR>> <BR><BR>From the cx_Oracle documentation (section 3) [1];<BR><BR>"""<BR>execute(statement, [parameters], **keywordParameters)<BR>Execute a statement against the database. Parameters may be passed as <BR>a dictionary or sequence or as keyword arguments. If the arguments are a <BR>dictionary, the values will be bound by name and if the arguments are a <BR>sequence the values will be bound by position."<BR>"""<BR><BR>From the DB-API specification [2];<BR><BR>"""<BR>paramstyle<BR><BR>String constant stating the type of parameter marker<BR>formatting expected by the interface. Possible values are<BR>[2]:<BR><BR>'qmark' Question mark style,<BR>e.g. '...WHERE name=?'<BR>'numeric' Numeric, positional style,<BR>e.g. '...WHERE name=:1'<BR>'named' Named style,<BR>e.g. '...WHERE name=:name'<BR>'format' ANSI C
printf format codes,<BR>e.g. '...WHERE name=%s'<BR>'pyformat' Python extended format codes,<BR>e.g. '...WHERE name=%(name)s'<BR>"""<BR><BR>cx_Oracle uses the 'named' parameter style, your code uses the qmark <BR>style. To find out which style is applicable check the paramstyle <BR>attribute of your connection object. e.g.;<BR><BR>>>> import cx_Oracle<BR>>>> myConnection = cx_Oracle.connect('andy47/andy47@andy47')<BR>>>> myConnection.paramstyle<BR>'named'<BR><BR>[1] http://starship.python.net/crew/atuining/cx_Oracle/html/cursorobj.html<BR>[2] http://www.python.org/peps/pep-0249.html<BR><BR>Regards,<BR>Andy<BR>-- <BR>--------------------------------------------------------------------------------<BR>From the desk of Andrew J Todd esq - http://www.halfcooked.com/<BR></BLOCKQUOTE><BR><p>
        
                <hr size=1> <a href="http://us.rd.yahoo.com/mail_us/taglines/virusmail/*http://mail.yahoo.com">Yahoo! Mail</a> - Helps protect you from nasty viruses.