PDA

View Full Version : Pro*C mode problem


Rocky Dean Pulley
09-08-2004, 03:12 AM
I'm using Pro*C and I'm having a problem... Here is the simple code:

#include <oci.h>
#include <stdio.h>
#include <sqlca.h>

void main()
{
char *url = "web/dreamsys";
char data[30];

EXEC SQL CONNECT :url;
EXEC SQL SELECT VAL INTO :data FROM TMP;

printf("val: %s\n", data);
}

now, when I run it with MODE=ORACLE, here is what I get:

C:\work\db>proc getstuff.pc MODE=ORACLE

Semantic error at line 10, column 22, file getstuff.pc:
EXEC SQL CONNECT :url;
......................1
PCC-S-02322, found undefined identifier
Semantic error at line 11, column 30, file getstuff.pc:
EXEC SQL SELECT VAL INTO :data FROM TMP;
..............................1
PCC-S-02322, found undefined identifier


Am I wrong here? Shouldn't this work with MODE=ORACLE?

If I put the "EXEC SQL BEGIN DECLARE SECTION;" around it then it
works, but I need to be able to not use that...

Thanks!

FredBear
09-08-2004, 08:10 AM
"Rocky Dean Pulley" <it@mikersoft.com> a écrit dans le message de
news:5ae526a4.0409080312.6892de30@posting.google.com... I'm using Pro*C and I'm having a problem... Here is the simple code: #include <oci.h> #include <stdio.h> #include <sqlca.h> void main() { char *url = "web/dreamsys"; char data[30]; EXEC SQL CONNECT :url; EXEC SQL SELECT VAL INTO :data FROM TMP; printf("val: %s\n", data); } now, when I run it with MODE=ORACLE, here is what I get: C:\work\db>proc getstuff.pc MODE=ORACLE Semantic error at line 10, column 22, file getstuff.pc: EXEC SQL CONNECT :url; .....................1 PCC-S-02322, found undefined identifier Semantic error at line 11, column 30, file getstuff.pc: EXEC SQL SELECT VAL INTO :data FROM TMP; .............................1 PCC-S-02322, found undefined identifier Am I wrong here? Shouldn't this work with MODE=ORACLE? If I put the "EXEC SQL BEGIN DECLARE SECTION;" around it then it works, but I need to be able to not use that... Thanks!

What is the difference with your post 15 hours earlier?

--
Regards
Michel Cadot

Rocky Dean Pulley
09-08-2004, 04:40 PM
> What is the difference with your post 15 hours earlier?

I really hate people like you, what was the point of your post, to
prove what a dick you are? If you really want to know the difference,
it was on another group and it had code posted with it.

Jonathan Leffler
09-08-2004, 08:14 PM
Rocky Dean Pulley wrote:
What is the difference with your post 15 hours earlier? I really hate people like you, what was the point of your post, to prove what a dick you are? If you really want to know the difference, it was on another group and it had code posted with it.

http://www.catb.org/~esr/faqs/smart-questions.html

--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/

Rocky Dean Pulley
09-09-2004, 02:47 PM
I believe that I followed those rules just fine. If you are referring
to the "before you ask section"....


1. Try to find an answer by searching the Web.

- I did tons of searching about this and found nothing.

2. Try to find an answer by reading the manual.

- The manual doesn't seem to covert this problem. I post because
according to the manual, what I am doing should work.

3. Try to find an answer by reading a FAQ.

- Again, nothing found on the problem here.

4. Try to find an answer by inspection or experimentation.

- Did tons of experimenting, even with the simplest piece of code
which was posted above.

5. Try to find an answer by asking a skilled friend.

- I don't know anyone with Pro*C experience, sorry!

6. If you are a programmer, try to find an answer by reading the
source code.

- This is not applicable in this case.

Jonathan Leffler <jleffler@earthlink.net> wrote in message news:<uMQ%c.10962$w%6.7362@newsread1.news.pas.earthlink.net>... Rocky Dean Pulley wrote:What is the difference with your post 15 hours earlier? I really hate people like you, what was the point of your post, to prove what a dick you are? If you really want to know the difference, it was on another group and it had code posted with it. http://www.catb.org/~esr/faqs/smart-questions.html

Guest
09-10-2004, 05:39 AM
it@mikersoft.com (Rocky Dean Pulley) wrote in message news:<5ae526a4.0409080312.6892de30@posting.google.com>... I'm using Pro*C and I'm having a problem... Here is the simple code: now, when I run it with MODE=ORACLE, here is what I get: C:\work\db>proc getstuff.pc MODE=ORACLE Semantic error at line 10, column 22, file getstuff.pc: EXEC SQL CONNECT :url; .....................1 PCC-S-02322, found undefined identifier Semantic error at line 11, column 30, file getstuff.pc: EXEC SQL SELECT VAL INTO :data FROM TMP; .............................1 PCC-S-02322, found undefined identifier Am I wrong here? Shouldn't this work with MODE=ORACLE? If I put the "EXEC SQL BEGIN DECLARE SECTION;" around it then it works, but I need to be able to not use that... Thanks!


Why? You *must* declare ALL your bind variables in the declare section!

Sybrand Bakker
Senior Oracle DBA

Rocky Dean Pulley
09-10-2004, 07:50 PM
> Why? You *must* declare ALL your bind variables in the declare section! Sybrand Bakker Senior Oracle DBA

Not according to the documentation. If you use MODE=ORACLE it is
supposed to pick up bind variables without the declare section. There
are also many articles and posts that say this on the 'net. My
problem is that this mode doesn't seem to work for me.


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service