Wrox Programmer Forums
|
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 12th, 2005, 09:22 AM
Registered User
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax for bind variables in Pro*C

Hi,

I need to use bind variables in Pro*C. How do I use it? looking for syntax. PLEASE HELP. It's URGENT. Expert one-on-one doesn't talk about this.

Below is the cut-paste from TKPROF -:

update temp_table set PROCESSED_BY_LOAD='Y',
 country_determine_logic=:b0,date_modify=:b1
where
 rowid=CHARTOROWID(:b2)


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 918 0.22 0.65 0 0 0 0
Execute 918 0.97 1.08 0 1395 9406 918
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1836 1.19 1.73 0 1395 9406 918

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 36 (RHEARAK)

Rows Row Source Operation
------- ---------------------------------------------------
 1 UPDATE
 1 TABLE ACCESS BY USER ROWID TEMP_TABLE


Rows Execution Plan
------- ---------------------------------------------------
 0 UPDATE STATEMENT GOAL: CHOOSE
 1 UPDATE OF 'TEMP_TABLE'
 1 TABLE ACCESS GOAL: ANALYZED (BY USER ROWID) OF 'TEMP_TABLE'

Please see that the parse count and execute count are the same .
So I thought of using bind variables. But I have not worked much on bind variables.

So am confused with the syntax. I tried few options but it's not working.
================================================== ==================
EXEC SQL
 UPDATE temp_table
 SET PROCESSED_BY_LOAD ='Y',
 country_determine_logic=:s_country_determine_logic ,
 date_modify=:s_sytem_date
 WHERE
 rowid = CHARTOROWID(: s_row_id);
================================================== ==================
s_country_determine_logic etc, are host variables.

As far as I know all host/indicator variables are bind variables. Please correct me if I am wrong and let me know the syntax.


Thanks in Advance,
Rhea






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Bind Two Variables to LinkButton Control cyberstore05 .NET Framework 2.0 1 October 31st, 2008 02:50 AM
Bind a Label cp75 ASP.NET 1.0 and 1.1 Basics 19 January 10th, 2007 10:53 AM
Grid Bind msbsam ASP.NET 2.0 Basics 1 December 19th, 2006 07:03 AM
Transferring Macro Variables Values To Another Pro sword_him Excel VBA 0 September 29th, 2006 08:42 AM
Syntax for Populating Variables rit01 ASP.NET 2.0 Professional 0 July 10th, 2006 04:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.