Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Copying VARCHAR2 Data type to a Java Host Variable of String type in embedded SQL

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I would like to know 2 things:
1) Is it possible to copy varchar2 type to a java host variable of type String in an
Anonymous PL/SQL in SQLJ.
Eg:
String var1; // Java String variable var1
String a;
String x;

try { // PL/SQL Block begins here
#sql {
DECLARE
b varchar2(2000);
msg varchar2(2000);
ret boolean;

BEGIN
ret:=di.func(:IN var1, UT a,msg);
b := UT a; //Unable to copy from a to b??
ret1:=ni.func2(:IN b, UT x,msg);
-- Unable to use :IN b i,e the output buffer
-- of the above procedure as input to
-- another procedure
END;
};
catch(SQLException e) { }
2) My Second question is
Looking at the above code how do I pass the OUT buffer returned from one procedure as input to another procedure.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic