PostgreSQL や Firebird で自動採番された主キーの値を INSERT 時に知る [RDBMS]

としておくと、cursor.execute() の後の cursor.lastrowid で、id の値が取ってこれる(Python的に)。

んでもって、PostgreSQL(psycopg2) でも lastrowid って、とってこれるんだけど、それって oid で、主キーの値でないんだよねぇ、と思っていたら、PostgreSQL 8.2 から INSERT文 にRETURNING 句というのを付けると好きな値を取ってこれるらしい。

そして、Firebird でも 2.0 から使えるようになっていて、しかも FAQ。
ちょっと試してみたところ、 kinterbasdb でも値が取得できる。


ちなみに、Firebird 2.0 以降では、トリガーを使わなくてもシーケンス番号を設定することができるようになったので、これと組み合わせればシーケンス番号の追加のためだけのトリガーを作成しなくてもよくなる。

nice!(0)  コメント(20)  トラックバック(0) 

nice! 0

コメント 20


1000000+ unique high-ranking visitors from the US, AU, CA, UK per month to your site
If you need to have so much quality traffic without only a few body movements, you can find the funniness here: http://make[dot - ultimate-link-building[dot - info/
([dot - replaced by .)
by CarlosNum (2018-05-01 10:24) 


Hello. And Bye. Vghrufwiodjowifuegijefqolw
by Thomasnoits (2018-10-14 00:27) 


harvard essay writing <a href=>purdue owl essay writing</a>
writing the persuasive essay <a href=>how to write a critical evaluation essay</a>
writing analytical essays <a href=>how to write a intro paragraph for an essay</a>
latest topics for essay writing <a href=>how to write a critical evaluation essay</a>
how to write a university application essay <a href=>writing essays services</a>
writing essays services <a href=>writing essay services</a>
how to write a convincing essay <a href=>essay writing my family</a>
best essay writing sites <a href=>how to write a movie essay</a>
example of writing an essay <a href=>how to write a good essay introduction</a>
by RaymondUnfag (2018-10-15 05:55) 


write an essay on <a href=>writing descriptive essay</a>
essay writing tools <a href=>writing a quote in an essay</a>
how to start writing an essay examples <a href=>help with college essay writing</a>
writing the body of an essay <a href=>writing the introduction of an essay</a>
good movies to write an essay on <a href=>help writing college essay</a>
writing a cause and effect essay examples <a href=>write an essay about</a>
write analysis essay <a href=>writing college essays for money</a>
writing a comparison and contrast essay <a href=>tips for essay writing in english</a>
how to write a professional essay <a href=>buy custom essays online</a>
by Patrickfible (2018-10-15 05:55) 


how to write a critique essay <a href=>how to write college application essays</a>
how to write an art critique essay <a href=>essay writer</a>
the proper way to write an essay <a href=>how to improve my essay writing</a>
german essay writing <a href=>how to write an essay for graduate school</a>
essay writing for english tests <a href=>how to write mba essays</a>
how to write a self assessment essay <a href=>excellent essay writings</a>
essay writing pdf <a href=>buy essay online safe</a>
essay to write <a href=>writing a history essay</a>
teel essay writing <a href=>write a comparison essay</a>
by AlbertPew (2018-10-15 05:55) 


writing a literature essay <a href=>essay writing about my best friend</a>
writing and essay <a href=>teaching essay writing high school</a>
how to write an art critique essay <a href=>buy law essay</a>
how to write a thematic essay <a href=>rules for essay writing competition</a>
how to write the college essay <a href=>how to write a proper essay</a>
buy pre written essays <a href=>self reflective essay on writing</a>
how to write argument essay <a href=>writing an autobiography essay</a>
a level essay writing <a href=>my best friend essay writing</a>
essay writing review <a href=>writing academic essays</a>
by DavidAvave (2018-10-15 05:55) 


how to write a university essay <a href=>guided essay writing</a>
how to write a essay in english <a href=>essay writing phrases</a>
writing critical essays <a href=>youtube essay writing</a>
how to write an admission essay for graduate school <a href=>writing a critical analysis essay</a>
essay writing images <a href=>how to write dialogue in an essay</a>
write custom essays <a href=>how to write a thesis statement for a research essay</a>
owl essay writing <a href=>how to write a reflective essay</a>
writing an essay powerpoint <a href=>buy custom essay</a>
essay writing tips for ielts <a href=>where can i buy essays online</a>
by JamesClief (2018-10-15 05:56) 


Free Dating Site for AU Singles:
The Best Free Dating Site:
Girls for sex in your town:
Free Dating Site for UK Singles:

dating sites free to lookfree dating site for mobilehalf life and radioisotope dating worksheet answersdating analogysoulmate online datingexample personal dating adssahuarita datingmarine corps dating sitesdating protocol first datesfree dating ukrainian siteshook up two monitorshook up mcallen txpixel gun 3d online datingsinopsis marriage not dating ep 7 part 2dating second cousinjapanese simulation dating games onlinedating websites for hard of hearingthe idea of dating scares meolder dating online safree christian dating chat roomszim sa online datingfree dating uk no sign upinternet dating for 11 year oldsdating site shirtlessdating ads newspaperatlanta speed dating meetupbest vegetarian dating websitesfree dating sites south africa cape towntrusted dating sites australiacarbon dating mt saint helensentp and infp datingare dating sites a good ideayoona and donghae datinglusaka dating sitesknow if your dating psychopath
by Bobbyvieni (2018-10-23 01:43) 


how earn money online by typing:
<a href=>game to earn money online</a>
<a href=>learn earn money online</a>
<a href=>earn money online youtube views</a>
<a href=>earn money online 2017 india</a>
<a href=>earn money online job from home</a>

Popular Tags: earn extra money online surveyslegitimate ways to earn money onlinehow to make money with playing online gameshow to make money by selling books onlinethe best online money making sitesmaking money online in chinamaking money online as a teachertop sites to make money onlineblack desert online how to make money fishingwhat can i do right now to make money onlinehow to make money online in usways to make money online quoragraphic design make money onlineare money making apps legalhow to make money online pdfearn money online telugu 2018how to earn money with mobile onlinetop money earning apps 2018 in telugumake money on ios appsearn money online legitmake money online fast no scamshow to make money online with emaileve online beginner's guide to making iskhow to earn money online from appsmake money online and get paid by cheque
by Charlesinimi (2018-11-23 22:57) 


best money making apps for ios:
<a href=>earn money online to paypal</a>
<a href=>earn money online legitimately</a>
<a href=>make money online 6 figures</a>
<a href=>earn money online on pc</a>
<a href=>make money online yoonla</a>

Popular Tags: can you earn money from surveys onlinegetting paid for online surveys ukhow to make money on betting exchangesto make real money onlinehow to earn money online with drawingsways to earn extra income onlinemake money with an online storehow to make money online under 18 ukhow to make money with mechanical turkhow to make money of online surveyshow to earn money online through governmentmaking money writing articles onlineeasy ways to make money from home onlineplay chess earn money onlinemoney for online surveys ukmake money online fbhow much money can you make on amazon mturkmake money online web chat ukbest way to earn money online apponline money making in americaearn money watching videos apphow to get money by online businesshow to make money online with android mobilemake money easy onlineearn money online with paypal
by AnthonyHanny (2018-11-25 13:54) 


"" - Adobe Lightroom is the most famous epitome editing software because the gain photographers, with hundreds of thousands of effects and presets within reach on the internet.

You can download Lightroom from Adobe’s website.

"" - Adobe Lightroom presets help you to redact your photos in register time by means of doing a lot of the position suitable you. You can plainly crack old-fashioned a pre-defined capacity, while keeping your original aspect and reverting recoil from to it at anytime.

You can use:
Lightroom Presets for Wedding Photography
Lightroom Presets for Baby and Family Photography
Lightroom Presets for Headshots
Lightroom Presets for Senior Portraits
Lightroom Presets for Landscape
Lightroom Presets for Nature Photography
Lightroom Presets for Food Photography
Lightroom Presets for Car Photography
Lightroom Presets for Real Estate
Lightroom Presets for Product and Fashion Photography

And a "" - Orange Theme Lightroom Desktop and Mobile Presets
for everyday shooting.

by lightroomciz (2019-04-23 00:13) 


Comprar Viagra Con Mastercard Priligy 30mg Tablets <a href=>buy levitra overnight</a> Dapoxetine Prix
by Auststeend (2019-04-30 18:34) 


Precio Cialis 5 Mg 28 Comprimidos En Farmacias <a href=>cialis cheapest online prices</a> Levitra Comprare Viagra Zurich Levitra Preiswert
by Auststeend (2019-05-30 19:20) 


Finasteride Avidart Propecia Viagra Generika Gefahrlich <a href=>cialis 5mg best price</a> Where To Buy Cialis 20mg In Uk Prix Cialis France Pharmacie
by Ellemossy (2019-06-03 06:30) 


Isotretinoin acutane Amoxicillin Abnormal Dreams Kamagra Fast London <a href=>cialis 5mg best price</a> Kamagra Vente Libre Kamagra Online Prescription Secure Ordering Real Bentyl Price Best Website
by FranSkige (2019-06-03 10:23) 


Cialis Canada Generic <a href=>online cialis</a> Cytotec En Gynecologie Cialis Generit Acheter Vrai Viagra En Ligne
by Ellemossy (2019-06-19 09:22) 


Lisinopril For Sale Progesterone Australia Anastrozole Benefits For Men <a href=>generic cialis overnight delivery</a> Can You Safely Take Expired Amoxicillin Cialis Generique Prezzo Cialis Italia
by Auststeend (2019-07-01 09:37) 


Cephalexin Antibiotic Cialis Kaufen Erfahrungsbericht Glucotrol Antibiotics Without A Script <a href=>generic 5mg cialis best price</a> Doxycycline 10mg Overseas Low Price
by FranSkige (2019-07-05 06:11) 


Side Effecrs Of Amoxicillin <a href=>canadian cialis</a> Cytotec Online Purchase In Singapore
by FranSkige (2019-07-12 07:37) 


Priligy Sample Canadian Discount Pharmacies <a href=>canadian pharmacy cialis</a> Propecia Comparativa Kamagra Oral Jelly Where To Buy
by Ellemossy (2019-07-20 00:18) 



Facebook コメント

トラックバック 0