Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pro*C mode problem

550 views
Skip to first unread message

Rocky Dean Pulley

unread,
Sep 8, 2004, 7:12:39 AM9/8/04
to
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!

Michel Cadot

unread,
Sep 8, 2004, 12:10:46 PM9/8/04
to

"Rocky Dean Pulley" <i...@mikersoft.com> a écrit dans le message de
news:5ae526a4.04090...@posting.google.com...

What is the difference with your post 15 hours earlier?

--
Regards
Michel Cadot


Rocky Dean Pulley

unread,
Sep 8, 2004, 8:40:21 PM9/8/04
to
>
> 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

unread,
Sep 9, 2004, 12:14:18 AM9/9/04
to
Rocky Dean Pulley wrote:

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

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

sybr...@yahoo.com

unread,
Sep 10, 2004, 9:39:55 AM9/10/04
to
i...@mikersoft.com (Rocky Dean Pulley) wrote in message news:<5ae526a4.04090...@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

unread,
Sep 9, 2004, 6:47:37 PM9/9/04
to
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 <jlef...@earthlink.net> wrote in message news:<uMQ%c.10962$w%6.7...@newsread1.news.pas.earthlink.net>...

Rocky Dean Pulley

unread,
Sep 10, 2004, 11:50:09 PM9/10/04
to
>
>
> 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.

zhang...@gmail.com

unread,
Feb 25, 2018, 10:42:02 AM2/25/18
to
Hava you resolved the problem, I encountered the same problem.

0 new messages