How to use oracle hints in datastage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mchaves
Participant
Posts: 50
Joined: Mon Aug 08, 2005 9:59 pm
Location: Sydney
Contact:

How to use oracle hints in datastage

Post by mchaves »

Hi,

I am trying to use the hint /*+ append */ on a user-defined sql (insert) but datastage complains about the syntaxe. Any ideas on how to work around this?

Cheers,
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Post the code and the syntax error. Not enough information here. It should work based on what you have stated.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't even need to use User Defined sql if you are doing that just to add the hint. With Column Generated I add it in the Derivation of the first field selected... works like a champ. For select statements anyway. :wink:

Post the complete sql and the complaint.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mchaves
Participant
Posts: 50
Joined: Mon Aug 08, 2005 9:59 pm
Location: Sydney
Contact:

Post by mchaves »

chulett wrote:You don't even need to use User Defined sql if you are doing that just to add the hint. With Column Generated I add it in the Derivation of the first field selected... works like a champ. For select statements anyway. :wink:

Post the complete sql and the complaint.
Thanks guys, I have sorted it out. It's working. I might have typed something that ds couldn't compile.

the sql is like this:

insert into table /*+ append */ ( a, b ) values (:1,:2)

Cheers,
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

Hints work. I have used no_merge hint using user-defined sql

Regards
Sreenivasulu
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Has anyone tried Craig's technique of including the Hint in the expression for the first column using Designer 7.5.1.A. They've upgraded the OCI SQL-builder tool and it's a bit of a syntax-Nazi.

I actually wanted to use the same technique to place a DISTINCT before the first column name, but I cannot get it to work for hints either.

The only things the expression-builder allows you to do are functions that you select from a list (eg. ABS(col)) and arithmetic calculations (eg. col + 10).
Ross Leishman
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I shun the expression builder, so won't have seen this. I've certainly used the /*+ APPEND */ hint to good effect here and there (but still prefer sqlldr).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't use the 'Fully Generated SQL' option now and I wouldn't touch the 'SQL Builder tool' with a thirty-nine and a half foot pole. :wink:

However, putting hints and other goodies in the first column's derivation works fine with the 'Column Generated' option in earlier versions and with the 'Generate SELECT clause from column list; enter other clauses' option in 7.5.1A too from what little I've been able to play with it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Ahhhh. The veil has been withdrawn!!! Column Generated is my new best friend. :mrgreen: It even lets you slip a DISTINCT into the derivation of the first column.

The SQL Builder should come with compulsory public health warnings.

Thanks for your help guys.
Ross Leishman
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

If I have a lot of columns from multiple tables I start with the SQL builder to build a column list and then switch across to generated or user-defined SQL straight afterwards. The SQL builder may be poor at table joins and where clauses but it is very fast for finding multiple tables and choosing the columns from those tables. When you are done it loads those columns into the column list. Faster then running the load table definition several times over.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's an interesting thought, Vincent. I'll have to play around with it. :wink:

At this point, I still prefer to 'seed' things by either dragging the column metadata in from the Repository browser onto a link, or directly via the Load button inside the stage. The method depends on if I want blank derivations or not. And since I've typically built and tested the query from TOAD first, I can then just paste in the 'other' clauses the stage needs.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply