[cx-oracle-users] Copying tables between two schemas? SQ*PLUS
Brought to you by:
atuining
From: Robert L. <rlu...@pi...> - 2011-11-07 01:29:44
|
Recommend using the Oracle built in export/pump functionality. Also, depending on size of the data you might consider using Oracle transportable tablespaces. I guess trying to get you to consider the built in functionality present in Oracle and operating system. Why add complexity by adding Python and cx-oracle? -----Original Message----- From: cx-...@li... [mailto:cx-...@li...] Sent: Tuesday, November 01, 2011 10:23 PM To: cx-...@li... Subject: cx-oracle-users Digest, Vol 65, Issue 1 Send cx-oracle-users mailing list submissions to cx-...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/cx-oracle-users or, via email, send a message with subject or body 'help' to cx-...@li... You can reach the person managing the list at cx-...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of cx-oracle-users digest..." Today's Topics: 1. Re: expecting None or a string (Anurag Chourasia) 2. Re: expecting None or a string (Anthony Tuininga) 3. Python users: Oracle Unstructured Data with Multimeda SIG (Christopher Jones) 4. Copying tables between two schemas? SQ*PLUS COPY? (Victor Hooi) ---------------------------------------------------------------------- Message: 1 Date: Tue, 25 Oct 2011 00:48:11 +0530 From: Anurag Chourasia <anu...@gm...> Subject: Re: [cx-oracle-users] expecting None or a string To: cx-...@li..., and...@we... Message-ID: <CAN...@ma...> Content-Type: text/plain; charset="iso-8859-1" Actually, upon reading the link sent by Andres further, I could make it to work by changing cursor.execute(query) to cursor.execute(str(query)) Regards, Anurag On Tue, Oct 25, 2011 at 12:40 AM, Anurag Chourasia < anu...@gm...> wrote: > Thanks for the response Andreas but I am already passing string type > objects in the substitution variables. > > This is really strange as this was working fine before and works fine from > most places.. > > > On Tue, Oct 25, 2011 at 12:30 AM, Andreas Mock <and...@we...>wrote: > >> Hi Anurag,**** >> >> ** ** >> >> searching for your error message with google brought this**** >> >> as one of the top results. Probably it helps:**** >> >> http://www.velocityreviews.com/forums/t691384-problem-about-cx_oracle.html >> **** >> >> ** ** >> >> Best regards**** >> >> Andreas Mock**** >> >> ** ** >> >> ** ** >> >> *From:* Anurag Chourasia [mailto:anu...@gm...] >> *Sent:* Monday, October 24, 2011 8:39 PM >> *To:* cx-...@li...; lar...@gm... >> *Subject:* Re: [cx-oracle-users] expecting None or a string**** >> >> ** ** >> >> The print returns this**** >> >> ** ** >> >> SELECT count(*) FROM T WHERE NBR = '1' and ID='1'**** >> >> ** ** >> >> Both NBR and ID are varchar in my case.**** >> >> ** ** >> >> This query works fine when executed directly using Oracle PL/SQL Plus**** >> >> ** ** >> >> Regards,**** >> >> Anurag**** >> >> ** ** >> >> On Tue, Oct 25, 2011 at 12:05 AM, Larry Martell <lar...@gm...> >> wrote:**** >> >> On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia >> <anu...@gm...> wrote: >> > Hi All, >> > I am getting an error "expecting None or a string" when executing a >> simple >> > SQL Query as this. >> > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) >> > print query >> > cursor.execute(query) >> > This was working fine before and I have neither changed the code nor >> update >> > cx_Oracle or Oracle version etc.**** >> >> Well, what do you get when you print out the query? nrb or id probably >> don't have the value you think. >> >> >> ------------------------------------------------------------------------- ----- >> The demand for IT networking professionals continues to grow, and the >> demand for specialized networking skills is growing even more rapidly. >> Take a complimentary Learning@Cisco Self-Assessment and learn >> about Cisco certifications, training, and career opportunities. >> http://p.sf.net/sfu/cisco-dev2dev >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users**** >> >> ** ** >> >> >> ------------------------------------------------------------------------- ----- >> The demand for IT networking professionals continues to grow, and the >> demand for specialized networking skills is growing even more rapidly. >> Take a complimentary Learning@Cisco Self-Assessment and learn >> about Cisco certifications, training, and career opportunities. >> http://p.sf.net/sfu/cisco-dev2dev >> _______________________________________________ >> cx-oracle-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 2 Date: Mon, 24 Oct 2011 19:58:09 -0600 From: Anthony Tuininga <ant...@gm...> Subject: Re: [cx-oracle-users] expecting None or a string To: cx-...@li... Message-ID: <CAE...@ma...> Content-Type: text/plain; charset=ISO-8859-1 If that is the case, let me suggest that you were using Unicode without meaning to. You can also upgrade to 5.1 which allows you to pass Unicode as query strings. Anthony On Mon, Oct 24, 2011 at 1:18 PM, Anurag Chourasia <anu...@gm...> wrote: > Actually, upon reading the link sent by Andres further, I could make it to > work by changing > cursor.execute(query) > to > cursor.execute(str(query)) > > Regards, > Anurag > > On Tue, Oct 25, 2011 at 12:40 AM, Anurag Chourasia > <anu...@gm...> wrote: >> >> Thanks for the response Andreas but I am already passing string type >> objects in the substitution variables. >> This is really strange as this was working fine before and works fine from >> most places.. >> >> On Tue, Oct 25, 2011 at 12:30 AM, Andreas Mock <and...@we...> >> wrote: >>> >>> Hi Anurag, >>> >>> >>> >>> searching for your error message with google brought this >>> >>> as one of the top results. Probably it helps: >>> >>> >>> http://www.velocityreviews.com/forums/t691384-problem-about-cx_oracle.html >>> >>> >>> >>> Best regards >>> >>> Andreas Mock >>> >>> >>> >>> >>> >>> From: Anurag Chourasia [mailto:anu...@gm...] >>> Sent: Monday, October 24, 2011 8:39 PM >>> To: cx-...@li...; lar...@gm... >>> Subject: Re: [cx-oracle-users] expecting None or a string >>> >>> >>> >>> The print returns this >>> >>> >>> >>> SELECT count(*) FROM T WHERE NBR = '1' and ID='1' >>> >>> >>> >>> Both NBR and ID are varchar in my case. >>> >>> >>> >>> This query works fine when executed directly using Oracle PL/SQL Plus >>> >>> >>> >>> Regards, >>> >>> Anurag >>> >>> >>> >>> On Tue, Oct 25, 2011 at 12:05 AM, Larry Martell <lar...@gm...> >>> wrote: >>> >>> On Mon, Oct 24, 2011 at 12:31 PM, Anurag Chourasia >>> <anu...@gm...> wrote: >>> > Hi All, >>> > I am getting an error "expecting None or a string" when executing a >>> > simple >>> > SQL Query as this. >>> > query = "SELECT count(*) FROM T WHERE NBR = '%s' and ID='%s'" %(nbr,id) >>> > print query >>> > cursor.execute(query) >>> > This was working fine before and I have neither changed the code nor >>> > update >>> > cx_Oracle or Oracle version etc. >>> >>> Well, what do you get when you print out the query? nrb or id probably >>> don't have the value you think. >>> >>> >>> ------------------------------------------------------------------------ ------ >>> The demand for IT networking professionals continues to grow, and the >>> demand for specialized networking skills is growing even more rapidly. >>> Take a complimentary Learning@Cisco Self-Assessment and learn >>> about Cisco certifications, training, and career opportunities. >>> http://p.sf.net/sfu/cisco-dev2dev >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >>> >>> >>> >>> ------------------------------------------------------------------------ ------ >>> The demand for IT networking professionals continues to grow, and the >>> demand for specialized networking skills is growing even more rapidly. >>> Take a complimentary Learning@Cisco Self-Assessment and learn >>> about Cisco certifications, training, and career opportunities. >>> http://p.sf.net/sfu/cisco-dev2dev >>> _______________________________________________ >>> cx-oracle-users mailing list >>> cx-...@li... >>> https://lists.sourceforge.net/lists/listinfo/cx-oracle-users >>> >> > > > -------------------------------------------------------------------------- ---- > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > ------------------------------ Message: 3 Date: Tue, 25 Oct 2011 16:24:38 -0700 From: Christopher Jones <chr...@or...> Subject: [cx-oracle-users] Python users: Oracle Unstructured Data with Multimeda SIG To: cx-...@li... Cc: Marcelle Kratochvil <mar...@pi...> Message-ID: <4EA...@or...> Content-Type: text/plain; charset=ISO-8859-1; format=flowed An Oracle Unstructured Data with Multimeda SIG has been launched by Marcelle Kratochvil from Piction. She is looking for Oracle-user assistance, particularly regarding scripting languages such as Python. Marcelle introduced the SIG in a session at the recent Oracle OpenWorld conference in San Francisco. She is well connected to Oracle development teams and is in a great position to help shape future versions of Oracle and MySQL databases with your input. There is a placeholder site for the SIG at https://sites.google.com/site/ommuds/ If you'd like to get involved, contact Marcelle directly at mar...@pi... Chris -- Email: chr...@or... Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/ ------------------------------ Message: 4 Date: Wed, 2 Nov 2011 14:22:27 +1100 From: Victor Hooi <vic...@ya...> Subject: [cx-oracle-users] Copying tables between two schemas? SQ*PLUS COPY? To: cx-...@li... Message-ID: <CAM...@ma...> Content-Type: text/plain; charset="iso-8859-1" Hi, We have two separate schemas on different Oracle database instances, and we have a need to copy the records from certain tables from one to the other. Due to internal regulations, creating a database link between them isn't an option - so I suppose that rules our using INSERT INTO...SELECT, right? Previously, we were using SQL*PLUS's COPY extension: http://www.oracleutilities.com/SQLPLus/copy.html and this has worked really well. However, now we'd like to automate this, and so I figured cx_Oracle would be the way to go. However, I don't think I can use COPY from cx_Oracle since it's SQL*PLUS specific ( http://stackoverflow.com/questions/7963441/using-sqlplus-copy-from-inside-cx -oracle ). Is there any way at all to get COPY to work from cx_Oracle? Or any other way to achieve the same thing just as elegantly, and not iterate through records? Cheers, Victor -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ---------------------------------------------------------------------------- -- RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1 ------------------------------ _______________________________________________ cx-oracle-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-oracle-users End of cx-oracle-users Digest, Vol 65, Issue 1 ********************************************** |